Room Temperature Display In LCD Monitor Using Arduino

Introduction
  • LM35 is used for finding the temperature of a place.
  • This sensor circuitry is sealed and therefore it is not subjected to oxidation and other processes.
  • It also possess low self heating and does not cause more than 0.1 degree Celsius temperature rise in still air.



    Figure 1: LM35
Parts of list:
  • Arduino
  • LCD Display
  • LM35 temperature sensor
  • Potentiometer
  • Breadboard
  • Hookup wire.
Connection from sensor to board:
  • The first pin can be connected to the Vcc of the 5V to an Arduino board.
  • The second pin can be connected to the A1 of analog side to an Arduino board.
  • The third pin can be connected to the Gnd to an Arduino board.
Connection from LCD Display to Arduino:



                        Figure 2: LCD Display
  • Fix the LCD in the 16 to 2 in the bread board.
  • The 16 pin to the Gnd
  • The 15 pin to the Vcc
  • The 14 pin to the Digital pin 02
  • The 13 pin to the Digital pin 03
  • The 12 pin to the Digital pin 04
  • The 11 pin to the Digital pin 05
  • The 01 pin to the Gnd.
  • The 02 pin to the Vcc.
  • The 03 pin to the potentiometer.
  • The 04 pin to the Digital pin 07.
  • The 05 pin to the Gnd.
  • The 06 pin to the Digital pin 06.
Connection from Potentiometer to Arduino:


Figure 3: Potentiometer
  • Connect as per the preceding figure to the Arduino board and the LCD Display.
  • The Vin connected to the LCD display in 03.
Programming
  1. #include <LiquidCrystal.h>    
  2.     
  3. // initialize the library with the numbers of the interface pins    
  4. LiquidCrystal lcd(2 ,3 ,4 ,5 ,6 ,7);    
  5.     
  6. //declare variables    
  7. float tempC;    
  8. float tempF;    
  9. int tempPin = 1;    
  10.     
  11. void setup(){    
  12.   // set up the LCD's number of columns and rows:    
  13.   lcd.begin(16, 2);    
  14.   lcd.print("Temp1=");    
  15.   lcd.setCursor(0, 1);    
  16.   lcd.print("Temp2=");    
  17. }    
  18.     
  19. void loop(){    
  20.   tempC = analogRead(tempPin);           //read the value from the sensor    
  21.   tempC = (5.0 * tempC * 100.0)/1024.0;  //convert the analog data to temperature    
  22.   tempF = ((tempC*9)/5) + 32;            //convert celcius to farenheit    
  23.     
  24.   // print result to lcd display    
  25.   lcd.setCursor(6, 0);    
  26.   lcd.print(tempC,1);    
  27.   lcd.print("'C");    
  28.     
  29.   lcd.setCursor(6, 1);    
  30.   lcd.print(tempF,1);    
  31.   lcd.print("'F");    
  32.     
  33.   // sleep...    
  34.   delay(1000);    
  35. }   
Explanation
  • It shows the current room temperature in the location.
  • It will display in the LCD monitor as the Celsius to Fahrenheit.
  • The temperature can be display as the temp1, temp2 in the monitor.
Output

                           Figure 4: Output
 
Read more articles on Arduino:

Up Next
    Ebook Download
    View all
    Learn
    View all