Temperature Alert System

Rahuljat
5 min readAug 13, 2020

--

Aim -Build a project for temperature alert system

Hardware Used -

1. Arduino Uno R3 (1)

2. Temperature Sensor (TMP36) (1)

3. LCD 16x2 (1)

4. 250kΩ Potentiometer (1)

5. 220Ω Resistor (1)

6. Bread Board

Software Used -

Arduino IDE or ThinkerCad (Online web based Simulator)

Circuit Diagram -

Explanation

Hello Everyone!

Myself Rahul Jat pursuing B.Tech from Government Engineering College Bikaner currently working on different IOT , Embedded and Robotics Projects , carrying out a project to demonstrate how we can simulate a Temperature Alert System by temperature sensor, lcd 16*2 , Piezo Buzzer and an Arduino UNO R3 using Tinkercad .

Temperature sensors and LCD can serve as a simple mechanism in different situations such as room temperature monitoring and even plant monitoring or any place that considers temperature as an important element!

I am using it as a alert system to get notified when the temperature is above 50 Degree Celsius alarm will go on and a specific tone will be given as output for notification and the LCD 16*2 will show the temperature with the situation as Normal, Cold or Too hot.

I am using Thinkercad.Tinkercad provides pre-built circuits that can help users to not complicate their circuits by building from scratch.

In the Circuit Desinger, we can search for lcd, which will show that there is a starter circuit that has a pre-connected circuit between an Arduino and LCD.

In Tinkercad, there is only one temperature sensor available, which is the TMP36.

The TMP36 does not have a temperature sensitive resistor. Instead this sensor uses the property of diodes; as a diode changes temperature the voltage changes with it at a known rate. The sensor measures the small change and outputs an analog voltage between 0 and 1.75VDC based on it. To obtain the temperature, we need to measure the output and perform some calculation to convert it to degree celsius.

The TMP36 has 3 pins, which can be easily identified by noticing the flat side of the sensor.

The first pin is the +5V pin which will be connected to the supply.

The second pin is the Vout which will be connected to the Analog In pin, (could be A0-A5). I used A0 for this project.

The third pin is the GND pin which will be connected to the ground of the Arduino.

Interfacing LCD 16*2

Liquid crystal displays (LCDs) are a commonly used to display data in devices such as calculators, microwave ovens, and many other electronic devices..

In this tutorial, I will show you how to use a 16x2 LCD with an Arduino. The 16x2 LCD used in this experiment has a total of 16 pins. As shown in the table below, eight of the pins are data lines (pins 7–14), two are for power and ground (pins 1 and 16), three are used to control the operation of LCD (pins 4–6), and one is used to adjust the LCD screen brightness (pin 3). The remaining two pins (15 and 16) power the backlight.The details of the LCD terminals are as follows:

Terminal 1 - GND

Terminal 2 - +5V

Terminal 3 - Mid terminal of potentiometer (for brightness control)

Terminal 4 - Register Select (RS)

Terminal 5 - Read/Write (RW)

Terminal 6 - Enable (EN)

Terminal 7 - DB0

Terminal 8 - DB1

Terminal 9 - DB2

Terminal 10 - DB3

Terminal 11- DB4

Terminal 12 - DB5

Terminal 13 - DB6

Terminal 14 - DB7

Terminal 15 - +4.2–5V

Terminal 16 - GND

Now Pins which i used to connect my LCD can be seen from the Circuit Diagram.

LCD 16*2

CODE USED -

// include the library code:
#include <LiquidCrystal.h>

#include <SoftwareSerial.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2); //connecting the pins rs,en,d4,d5,d6,d7 to the arduino at pin 12 11 5 4 3 2

int celsius; //declare a function celsius as an integer

void setup()

{

pinMode(A0,INPUT);

pinMode(7,OUTPUT);

Serial.begin(9600); //set the baud rate at 9600 bits per second

lcd.begin(16, 2); //lcd size is 16x2 // Print a message to the LCD.

lcd.print(“Temp Display”);

Serial.println(“Temp Display”); //print the message at the serial monitor

}

void loop()

{

celsius = map(((analogRead(A0) — 20) * 3.04), 0, 1023, -40, 125);//map to obtain temperature mathematically.Meaning 0 = -40degrees and 1023 = 125degrees

lcd.setCursor(0,0); //cursor set to the first pixel of the lcd.

lcd.print(“Temp Display”); //print message to lcd

lcd.setCursor(0,1);//cursor set to the second line first pixel

lcd.print(celsius); //prints the celsius output from the analog read onto the lcd at 0,1

lcd.print(“C”); //print alphabet “c”

Serial.println(celsius); //output shown in the serial monitor

delay(1000); //reading refreshes every 1 second

lcd.clear(); //clears the lcd

if(celsius>50)
{
digitalWrite(7,1);
tone (7,250,100);
delay(100);
lcd.setCursor(8,1);
lcd.print(“Too HOT”);
}
else if(celsius<50 && celsius>=15)
{
digitalWrite(7,0);
lcd.setCursor(8,1);
lcd.print(“Normal”);
}
else if(celsius<15)
{
digitalWrite(7,0);
lcd.setCursor(8,1);
lcd.print(“Cold”);
}

}

Code part 1
Code part 2
Code part 3

RESULT

When start simulation the TMP36 sense temperature and show on LCD.

When the Temperature increases and reached above 50 the Piezo Buzzer will Turn on and produce a specific tone used in code which shows our alert system goes on after reaching specified temperature.

Also LCD shows condition i.e “Too Hot”.

WHATS NEXT!

Use a ESP8266 Wifi module to send the data of temperature to the Thingspeak Cloud. And can use ThingTweet to Tweet automatically when temperature reach above 50 or can create a messenger bot which will notify you through messenger messages about the condition.

Since Thinkercad does not have ESP module so can’t show this project now but will try to show through practical hardware after a while.

--

--