The given project illustrates interfacing of temperature sensor LM35 with Arduino and displaying current temperature on LCD. The LM35 sensor generates analog voltage corresponding to sensed temperature. Its output varies from 0 to 1 V as 10 mV / oC. So it can be easily interfaced with Arduino by connecting its output to Arduino’s analog input pin. So change in temperature i.e. a change in analog voltage input that is recorded as the change in analog value in Arduino. The value is further converted into actual and accurate temperature and then it is displayed on LCD. The accuracy of temperature is upto 2 digits after decimal point. So we can measure very accurate temperature using this application.
Fig. 1: Prototype of Arduino Based Accurate Temperature Monitor
Circuit description
1. The output of LM35 sensor is connected to analog input pin A0 of Arduino board. Its Vcc pin is connected to +5 V and Gnd pin to ground.
2. Data pins D4, D5, D6 and D7 of LCD are connected to digital pins D5, D4, D3, and D2 respectively. En pin of LCD is connected to pin 11 and Rs pin is connected to pin 12.
3. RW pin is connected to ground.
4. A 10K pot is connected to 3rd pin VEE of LCD to vary its brightness.
5. LED+ terminal and LED- terminal are connected to 5V and ground to turn on LED back light for LCD.
Circuit operation
• The LM35 sensor give 0 to 1 V output as 10 mV/oC – means as temperature varies by 1 oC the output voltage from sensor increases by 10 mV and vice versa.
• Because the output of sensor is connected to analog input of arduino it will convert this into digital value from 0 to 1023.
• Because LM35 sensor output is limited to 0 – 1 V only, internal reference voltage of 1.1 V is selected for internal ADC operation.
• So as temperature increases, the analog output from sensor increases from 0 to 1 V and arduino generates corresponding digital value from 0 to 1023.
• So 0 to 1 V range is divided in 1024 steps – means each step has 1/1024 = 0.00097 = 0.97 mV resolution.
• Because LM35 sensor output changes by 10 mV on each 1 oC change in temperature, so when analog reading changes by 10 / 0.97 = 10.31, it indicates temperature changes by 1 oC.
• So Arduino reads analog voltage output from sensor, gets analog value between 0 to 1023 divide it by factor 10.31 and displays this value on LCD as current temperature.
• As the temperature increases or decreases the analog output voltage from sensor increases or decreases, Arduino reads this voltage, convert it into corresponding temperature value and displays it on LCD.
Software program:
For complete above circuit operation, the program is downloaded into Arduino microcontroller ATMega328. The program is edited and compiled in Arduino IDE. And then it is uploaded to Arduino board.
Project Source Code
###
//Program to #include <LiquidCrystal.h> float temperature; // initialize the library with the numbers of the interface pins LiquidCrystal lcd(12, 11, 5, 4, 3, 2);void setup() { // set internal reference voltage 1.1 V for ADC analogReference(INTERNAL); // set up the LCD's number of columns and rows: lcd.begin(16, 2); // Print a message to the LCD. lcd.print("temperature:"); }void loop() { int sensor_value; sensor_value = analogRead(A0); // get the sensor reading temperature = sensor_value/10.31; lcd.setCursor(0,1); // set cursor to 2nd line 1st column lcd.print(temperature); // print temperature lcd.print("deg C”); delay(1000); // 1 sec delay }###
Circuit Diagrams
Project Video
Filed Under: Electronic Projects
Filed Under: Electronic Projects
Questions related to this article?
👉Ask and discuss on Electro-Tech-Online.com and EDAboard.com forums.
Tell Us What You Think!!
You must be logged in to post a comment.