LM35 Temperature Sensor with LCD Display Arduino Code

Introduction

In this tutorial, we learn how to interface the LM35 temperature sensor with Arduino using LCD 16×2 display. LM35 is a three-terminal temperature-detecting device. It is operated to measure temperature in the range of -55°C to 150°C. It is a three-terminal device that creates an analog voltage proportional to the temperature around its area.

We can turn over the analog output into digital utilizing ADC. The sensitivity of LM35 is 10mV/degree Celsius it does not need any additional calibration (e.g. 300mV means 30℃). Its output is especially accurate. provide voltage ranges from 4V to 30V.

Hardware Required

You will require the following Hardware Components for interfacing the LM35 Temperature Sensor with Arduino.

Components#Buy From Amazon
Arduino UNO1Buy Now
16×2 LCD Display1Buy Now
LM35 Temperature Sensor1Buy Now
Variable Resistor 10kΩ1Buy Now
Resistor 220Ω1Buy Now
Jumper WiresFewBuy Now
Breadboard1Buy Now

What is LM35 Temperature Sensor?

LM35 is a precision integrated-circuit temperature sensor that can be used to measure temperature with an accuracy of ±0.5°C at room temperature. It is a small and inexpensive device that can be easily interfaced with microcontrollers, such as Arduino, to measure temperature in various applications. The LM35 sensor converts the temperature into an analog voltage output that is proportional to the temperature, with a scale factor of 10mV per degree Celsius. The output voltage of the sensor can be directly read by a microcontroller’s analog input pin, which can then be used to calculate the temperature using a simple mathematical formula. The LM35 is a popular choice for temperature sensing applications due to its accuracy, ease of use, and low cost.

Pinout

LM35-LM-35-Temperature-Sensor-Pinout

Pin Configuration

Pin NoNameFunction
1VccSupply voltage; 5V (+35V to -2V)
2OutputOutput voltage (+6V to -1V)
3GroundGround (0V)

Specifications

  1. Operating Voltage: 4V to 30V
  2. Temperature range: -55°C to +150°C
  3. Output Voltage: 10mV/°C
  4. Accuracy: ±0.5°C
  5. Quiescent Current: Less than 60uA
  6. Package Type: TO-92

Features

  1. Easy to use
  2. High accuracy
  3. Low power consumption
  4. Linear output
  5. Calibrated in Kelvin
  6. Self-calibrated circuitry

Circuit Diagram

The following circuit shows you the connection of the LM35 Temperature Sensor with Arduino Please make the connection carefully

LM35-Temperature-Sensor-and-LCD-Display-Interfacing-with-Arduino-Circuit

Circuit Connections

Connect the powered VCC & GND pin of the LM35 temperature sensor to the 5V and GND of Arduino. and the analog output pin of the sensor is attached to the analog input pin A0 of Arduino.

The brightness of the LCD is controlled by the 10kΩ potentiometer the first and third pin of the potentiometer is connected to the VCC and GND of Arduino. and the second pin is attached to pin 3 of the LCD. the first pin and third pins of the potentiometer can be interchanged.

The 1, 4, and R / W pin of the LCD is connected to the GND of Arduino, and Pin 2 of the LCD is connected to the + VCC of Arduino with 220Ω resister. Pin E (Enable), and RS pin of the LCD is connected to digital pin D11 and D12 of Arduino, and the D4, D5, D6, and D7 of the LCD is connected to D5, D4, D3, and D2 pins of Arduino

Installing Arduino IDE Software

First, you will require to Download the updated version of Arduino IDE Software and Install it on your PC or laptop. if you Learn How to install the Arduino step-by-step guide then click on how to install Arduino Button given Blow

Installing Libraries

Now when you are Ready to upload the code, to the Arduino Board you will need first to add the Following Libraries in Arduino, If you Learn How to add the library in the Arduino step-by-step guide click on how to install the library Button given Blow

Code

//For more Projects: www.arduinocircuit.com
#include <LiquidCrystal.h>
int sensor = A0;
float temp;
float tempc;
float tempf;

LiquidCrystal lcd (12, 11, 5, 4, 3, 2);
void setup () {
lcd.begin (16, 2);
}

void loop () {
temp=analogRead(sensor);
tempc=(temp*4.88)/10;
tempf=(tempc*1.8)+32;
lcd.setCursor(0,0);
lcd.print("Temp in C = ");
lcd.println(tempc);
lcd.setCursor(0,1);
lcd.print("Temp in F = ");
lcd.println(tempf);
}

Applications

  1. Temperature measurement in industrial applications
  2. HVAC (heating, ventilation, and air conditioning) systems
  3. Medical equipment
  4. Environmental monitoring systems
  5. Automotive applications
  6. Home appliances such as refrigerators, ovens, and air conditioners

Conclusion

The LM35 is a versatile temperature sensor that can be used in a wide range of applications. It offers high accuracy and reliability, making it an ideal choice for use in various industries. With its ease of use and low power consumption, it is an excellent option for battery-powered devices. Its linear output and self-calibrated circuitry also make it a popular choice among hobbyists and enthusiasts.

Leave a Comment


error: