LM35 Temperature Sensor with Arduino and LCD

In this Arduino tutorial we will show how to use LM35 temperature sensor with Arduino and LCD. The Arduino code for the temperature sensor with LCD is provided at the end. The program code will display temperature in degree Celsius and in Fahrenheit unit. Video demonstration and Proteus simulation are also provided to illustrate how it works. 

LM35 Temperature Sensor with Arduino and LCD

Interfacing Arduino with LM35 Temperature Sensor and LCD

The circuit wiring diagram of LM35 temperature sensor, 16x2 LCD and Arduino is shown below.

schematic of LM35 Temperature Sensor with Arduino and LCD

LM35 TO TransistorPackage
Fig: LM35 TO-Transistor Package

Here we have used TO transistor packaged LM35 sensor which has 3 pins. 
The LM35 first pin is the voltage supply pin which can be from 4V to 30V. Here we have connected it +5V supply source. The second pin is the signal pin which is connected to Arduino analog pin A0 as shown in the schematic above. LM35 temperature sensor are easy to use. They do not require any external calibration circuit and can be directly connected to a micrcontroller ADC pin. The third pin is ground pin which is connected to the ground of the supply source. This temperature sensor can work over a temperature range −55°C to 150°C with resolution of 10mV per °C.


 The LCD pin RS and E are connected to digital pin 7 and 6 and the pins D4, D5, D6 and D7 are connected to the digital pins 5,4,3 and 2 of the Arduino.

Arduino Code for LM35 Temperature Sensor with LCD

Below is the Arduino programming code that display temperature on 16x2 LCD read by Arduino from LM35 temperature sensor.

#include <LiquidCrystal.h>
LiquidCrystal lcd(7,6,5,4,3,2);

void setup () {
lcd.begin(16,2);
lcd.print("Temperature:");
}

void loop() {
float c = analogRead(A0);
c = (c*5)/1023;
c = c*100;
float f = (c*9)/5 + 32;
lcd.setCursor(0,1);
lcd.print(c);
lcd.print((char)223);
lcd.print("C");
lcd.print("(");
lcd.print(f);
lcd.print((char)223);
lcd.print("F)");
}

Video demonstration of LM35 with Arduino and LCD

Below is a video demonstration to show you how it works after you have assembled the LM35 temperature circuit provided above.


Proteus Simulation of LM35 temperature sensor with Arduino and LCD



You might also be interested in our similar tutorials:


Post a Comment

Previous Post Next Post