# Monitor Temperature With Voice Alerts

By Deepankar Maithani

7763

This project is based on Arduino Uno and Processing software for monitoring temperature and sending voice alerts. Processing is an open source IDE that can be used to visualise data and implement other functionalities.

## Circuit and working

The circuit is built around Arduino Uno board and LM35 temperature sensor. Connect output pin (V0) of LM35 to A0 pin of Arduino board, Vcc pin to 5V pin of the board, and ground pin to common. Circuit connections of LM35 with Arduino Uno are shown in Fig. 1.

Arduino monitors the output pin of temperature sensor LM35 to calculate ambient temperature. Then, it sends the value on the serial port to which it is connected. Processing software receives incoming data from the port and displays it on the graphical user interface (GUI). It also checks the temperature. If temperature is below 40Â°C, green LED glows. If it is above 40Â°C, red LED glows and a pre-recorded voice alert is played on the laptop speaker.

The microcontroller (MCU) on Arduino has an inbuilt 10-bit analogue-to-digital converter (ADC). Using its ADC, Arduino monitors the output of LM35 through its analogue pin A0. Program (efy_temp.ino) in Arduino, as given below, performs multiplication and division using certain factors to give actual temperature.

temperature=(valĂ—4.88)/10; //multiplication factor to convert the value into temperature

To understand the above relationship, note that ADC on Arduino gets 5V as a reference by default. So, to calculate step size, use the relationship given below.

Stepsize=Vref/2n
where n=number of bits

Here, we have a 10-bit ADC on Arduino. So,
Stepsize=5/1024=0.0048828= 4.88mV

Datasheet of LM35 says that, for every 1Â°C rise, there is an increase of 10mV in output.

Hence, temperature = (valĂ—4.88mV)/10mV

## Understanding the GUI

Processing IDE uses Cartesian coordinates (Fig. 2). It assumes the top-left corner of the rectangular GUI window as having (0,0) coordinates, and all other coordinates are taken with respect to it. To achieve the desired functionality, two libraries are used, namely, serial and minim.

Minim library comes pre-installed with Processing IDE; it needs to be downloaded and installed as explained in the testing steps section.

Processing code (dee_efy.pde) is used to generate the GUI window. The code within setup() runs once and sets the size of the GUI window and loads the essential dependencies. The code inside draw loop runs repeatedly. serialEvent() function is called every time data comes on the serial port. Processing reads it as string and stores it in a variable named data.

Led() function takes care of the red and green LEDs based on the value of temperature.

The application can also be exported to run as a standalone app for Windows, Mac or Linux platforms by going to File>Export Application. Chose the platform for which you want to export and click OK.

## Testing steps

1. Download and install Arduino IDE from websiteÂ and Processing software from this website.
2. Connect Arduino board with laptop or computer using a USB cable and open Arduino code (efy_temp.ino) using Arduino IDE software. Under Tools, select the board as Arduino/Genuino Uno and correct COM port. Next, compile the code and upload it to Arduino board.
3. Open Processing source code (dee_efy.pde) using Processing software. Add the audio library (minim) in this software for voice alerts. For this, go to Sketch>Import Library…>Add Library…>minim. In filter box, search for minim and click on Install, and wait for a few seconds.
4. Add fonts for your GUI. For this, go to Tools>Create Font, select Arial-black-48 and click OK. Colour codes can be obtained from Tools>Color Selector option.
5. Replace COM12 port number in Processing code with your own COM port number. Check COM port under Windows Device Manager. Save the code before running it. Note that the pre-recorded audio files to be played, colour font file and Arduino code should be inside the data folder on your PC.
6. Run the code and a GUI will open with temperature value, as shown in Fig. 3.

In the GUI, green LED will glow when temperature is below the pre-defined limit (40Â°C), and red LED will glow when temperature is above the pre-defined limit along with the voice alert.