Arduino B.Tech/Diploma Beginner

Digital Thermometer with Arduino & LM35 Temperature Sensor

Interfacing LM35 Temperature Sensor with Arduino & 16x2 I2C LCD Display to print temperature readings of LM35DZ on LCD Screen with Code

  • Suitable forB.Tech/Diploma Arduino students
  • Build time1-2 weeks
  • LevelBeginner
  • Available atAjvika Labs, Kakinada

About this project

Overview
In this project, we interfaced LM35 Temperature Sensor with Arduino to design a digital thermometer. The measured temperature will be directly displayed on a 16*2 LCD. Earlier we learned about
DS18B20
MAX6675
&
MLX90614
digital temperature Sensors. But LM35 is an analog temperature sensor.
LM35DZ is capable of reading the temperature in Centigrade scale. The output voltage of the sensor is directly proportional to the temperature in centigrade. LM35 can be used in the range of -55°C to +150°C with +/- 0.75°C accuracy. So let’s learn how to design a Digital Thermometer Using Arduino & LM35 Temperature Sensor.
Bill of Materials
We need the following components for designing a digital thermometer.
S.N.
Components Name
Quantity
Purchase Links

Arduino UNO Board

Amazon
AliExpress

LM35 Temperature Sensor

Amazon
AliExpress

16x2 LCD Display

Amazon
AliExpress

Potentiometer 10K

Amazon
AliExpress

Connecting Wires

Amazon
AliExpress

Breadboard

Amazon
AliExpress
LM35 Temperature Sensor:
The LM35 series are precision integrated-circuit temperature devices with an output voltage linearly-proportional to the Centigrade temperature. The LM35 device has an advantage over linear temperature sensors calibrated in Kelvin, as the user is not required to subtract a large constant voltage from the output to obtain convenient Centigrade scaling. The LM35 device does not require any external calibration or trimming to provide typical accuracies of ±¼°C at room temperature and ±¾°C over a full −55°C to 150°C temperature range.
Lower cost is assured by trimming and calibration at the wafer level. The low-output impedance, linear output, and precise inherent calibration of the LM35 device make interfacing to readout or control circuitry especially easy. The device is used with single power supplies, or with plus and minus supplies. As the LM35 device draws only 60 µA from the supply, it has a very low self-heating of less than 0.1°C in still air.
Features
Calibrated directly in Degree Celsius (Centigrade)
Linear at 10.0 mV/°C scale factor
0.5°C accuracy guarantee-able (at a25°C)
Rated for full -55°C to a 150°C range
Suitable for remote applications
Low cost due to wafer-level trimming
Operates from 4 to 30 volts
Less than 60 mA current drain
Low self-heating, 0.08°C instill an air
Non-linearity only 0.25°C typical
Low impedance output, 0.1Ωfor 1 mA load
Working
In order to understand the working principle of the lm35 temperature sensor, we have to understand the linear scale factor. In the features of lm35, it is given to be +10 mills volt per degree centigrade. It means that with an increase in output of 10 mills volt by the sensor out pin the temperature value increases by one. For example, if the sensor is outputting 100 mills volt at vout pin the temperature in centigrade will be 10-degree centigrade. The same goes for the negative temperature reading. If the sensor is outputting -100 mills volt the temperature will be -10 degrees Celsius.
The circuit diagram is shown above. Briefly, there are two transistors in the center of the drawing. One has ten times the emitter area of the other. This means it has one-tenth of the current density since the same current is going through both transistors. This causes a voltage across the resistor R1 that is proportional to the absolute temperature and is almost linear across the range we care about. The “almost” part is taken care of by a special circuit that straightens out the slightly curved graph of voltage versus temperature. The amplifier at the top ensures that the voltage at the base of the left transistor (Q1) is proportional to absolute temperature (PTAT) by comparing the output of the two transistors.
The amplifier at the right converts absolute temperature (measured in Kelvin) into either Fahrenheit or Celsius, depending on the part (LM34 or LM35). The little circle with the “i” in it is a constant current source circuit. The two resistors are calibrated in the factory to produce a highly accurate temperature sensor. The integrated circuit has many transistors in it — two in the middle, some in each amplifier, some in the constant current source, and some in the curvature compensation circuit. All of that is fit into the tiny package with three leads.
Interfacing LM35 Temperature Sensor with Arduino
Let us interface the LM35 Temperature Sensor with the Arduino UNO Board. The connection diagram is so simple.
Connect the VCC of the LM35 to 5V on the Arduino.
Connect the GND of the LM35 to GND on the Arduino.
Finally, connect the Vout (output) of the LM35 to one of the Arduino’s analog input pins (e.g., A0).
You can use a breadboard for connection and connect using the jumper wires.
Source Code/Program for Reading Temperature Value
Let us take a look at the code for reading temperature reading from LM35 Temperature Sensor using Arduino Board.
The temperature in degrees Celsius is calculated by reading the analog voltage output from the LM35 sensor, converting that reading to a voltage value, and then converting this voltage into a temperature. The formula used is:
Temperature (°C) = (Sensor Value ×
5.0
⁄
1024.0
) × 100.0
This formula takes the analog sensor value (0-1023), scales it to a 0-5V range (because the Arduino analog inputs map 0-5V to 0-1023), and then multiplies by 100 because the LM35 increases 10mV (or 0.01V) per degree Celsius, effectively converting the voltage to temperature.
The following code reads temperature data from an LM35 sensor connected to an Arduino and calculates the temperature in both Celsius and Fahrenheit. It then prints these temperature readings to the Serial Monitor every second, allowing for real-time monitoring of the sensor’s output.

// Define the LM35 sensor input pin
const
int
lm35Pin
=
A0
;
void
setup
(
)
{
// Begin Serial Communication at 9600 baud rate
Serial
begin
(
9600
)
;
}
void
loop
(
)
{
// Read the value from the sensor
int
sensorValue
=
analogRead
(
lm35Pin
)
;
// Convert the sensor reading to temperature in degree Celsius
float
temperatureC
=
sensorValue *
(
5.0
/
1024.0
)
*
100.0
;
// Convert Celsius to Fahrenheit
float
temperatureF
=
(
temperatureC *
1.8
)
+

;
// Print the temperature in Celsius to the Serial Monitor
Serial
(
"Temperature: "
)
;
Serial
(
temperatureC
)
;
Serial
(
"°C, "
)
;
// Print the temperature in Fahrenheit to the Serial Monitor
Serial
(
temperatureF
)
;
Serial
println
(
"°F"
)
;
// Wait 1 second before reading again
delay
(
1000
)
;
}
Upload the code to the Arduino UNO Board and open the Serial Monitor, once uploading is completed.
The Serial Monitor will show the value of temperature reading in both Celsius and Fahrenheit readings.
Interfacing LM35 Temperature Sensor with Arduino & LCD Display
Now let us add a 16×2 I2C LCD Display to the above circuit, so that we can display the LM35 Temperature readings on LCD Screen using the modified Arduino Code.
Connect the VCC of the LCD to 5V on the Arduino.
Also, connect the GND of the LCD to GND on the Arduino.
Connect the SDA Pin of the LCD to A4 on the Arduino
Finally, connect the SCL Pin of the LCD to A5 on the Arduino
Source Code/Program for Displaying LM35 Temperature Values on LCD
The following code interfaces an Arduino with a 16×2 LCD display using I2C communication to create a digital thermometer. It reads the temperature from an LM35 sensor, displays the temperature in both Celsius and Fahrenheit on the LCD, and updates the display every 2 seconds. A custom character is used to display the degree symbol next to the temperature values.
Before compiling the code, add
I2C LCD Library
to the Arduino library folder.

Technologies used

ArduinoBLEDS18B20LCDI2CAWS

Hardware components

  • Arduino
  • DS18B20
  • LM35

Software & tools

  • Arduino IDE

What you get

  • Working project / hardware kit, tested before delivery
  • Complete source code with explanation
  • Project demo and guidance for your viva
  • Project report, PPT and IEEE paper support (on request)
Delivery & Payment
Delivery takes a minimum of two weeks from the date your inquiry is confirmed. Payment is in two parts: • 50% advance to start the project • Remaining 50% before delivery Note: • Documentation and PPT are not included by default • If you need documentation/PPT, it can be arranged for extra time and cost We'll confirm the exact timeline and cost with you after reviewing your requirements.