Close Menu
  • Articles
    • Learn Electronics
    • Product Review
    • Tech Articles
  • Electronics Circuits
    • 555 Timer Projects
    • Op-Amp Circuits
    • Power Electronics
  • Microcontrollers
    • Arduino Projects
    • STM32 Projects
    • AMB82-Mini IoT AI Camera
    • BLE Projects
  • IoT Projects
    • ESP8266 Projects
    • ESP32 Projects
    • ESP32 MicroPython
    • ESP32-CAM Projects
    • LoRa/LoRaWAN Projects
  • Raspberry Pi
    • Raspberry Pi Projects
    • Raspberry Pi Pico Projects
    • Raspberry Pi Pico W Projects
  • Electronics Calculator
Facebook X (Twitter) Instagram
  • About Us
  • Disclaimer
  • Privacy Policy
  • Contact Us
  • Advertise With Us
Facebook X (Twitter) Instagram Pinterest YouTube LinkedIn
How To Electronics
  • Articles
    • Learn Electronics
    • Product Review
    • Tech Articles
  • Electronics Circuits
    • 555 Timer Projects
    • Op-Amp Circuits
    • Power Electronics
  • Microcontrollers
    • Arduino Projects
    • STM32 Projects
    • AMB82-Mini IoT AI Camera
    • BLE Projects
  • IoT Projects
    • ESP8266 Projects
    • ESP32 Projects
    • ESP32 MicroPython
    • ESP32-CAM Projects
    • LoRa/LoRaWAN Projects
  • Raspberry Pi
    • Raspberry Pi Projects
    • Raspberry Pi Pico Projects
    • Raspberry Pi Pico W Projects
  • Electronics Calculator
How To Electronics
Home » Digital Thermometer with Arduino & LM35 Temperature Sensor
Arduino Projects

Digital Thermometer with Arduino & LM35 Temperature Sensor

Mamtaz AlamBy Mamtaz AlamUpdated:February 2, 20258 Comments6 Mins Read
Share Facebook Twitter LinkedIn Telegram Reddit WhatsApp
Share
Facebook Twitter LinkedIn Pinterest Email Reddit Telegram WhatsApp

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 NameQuantityPurchase Links
1Arduino UNO Board1Amazon | AliExpress
2LM35 Temperature Sensor1Amazon | AliExpress
316x2 LCD Display1Amazon | AliExpress
4Potentiometer 10K1Amazon | AliExpress
5Connecting Wires20Amazon | AliExpress
6Breadboard1Amazon | 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

  1. Calibrated directly in Degree Celsius (Centigrade)
  2. Linear at 10.0 mV/°C scale factor
  3. 0.5°C accuracy guarantee-able (at a25°C)
  4. Rated for full -55°C to a 150°C range
  5. Suitable for remote applications
  6. Low cost due to wafer-level trimming
  7. Operates from 4 to 30 volts
  8. Less than 60 mA current drain
  9. Low self-heating, 0.08°C instill an air
  10. Non-linearity only 0.25°C typical
  11. 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.

LM35 Temperature Sensor Arduino

  • 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).

LM35 Arduino Connection

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.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// 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) + 32;
 
  // Print the temperature in Celsius to the Serial Monitor
  Serial.print("Temperature: ");
  Serial.print(temperatureC);
  Serial.print("°C, ");
 
  // Print the temperature in Fahrenheit to the Serial Monitor
  Serial.print(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.

LM35 Temperature Sensor Arduino LCD Display

  • 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.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
 
// Initialize the library with the I2C address of the display (usually 0x27 or 0x3F)
LiquidCrystal_I2C lcd(0x27, 16, 2);
#define sensor A0
 
byte degree[8] =
{
  0b00110,
  0b00110,
  0b00000,
  0b00000,
  0b00000,
  0b00000,
  0b00000,
  0b00000
};
 
void setup()
{
  lcd.init();                      // initialize the lcd
  lcd.backlight();
  lcd.createChar(1, degree);
 
  lcd.setCursor(0, 0);
  lcd.print("Digital Thermometer");
  delay(2000);
  lcd.clear();
}
 
void loop()
{
  /*---------Temperature-------*/
  float reading = analogRead(sensor);
  float temperatureC = reading * (5.0 / 1023.0) * 100;
  // Convert Celsius to Fahrenheit
  float temperatureF = (temperatureC * 1.8) + 32;
 
  /*------Display Result in Celsius------*/
  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print("Temp: ");
  lcd.print(temperatureC);
  lcd.write(1); // Degree symbol
  lcd.print("C");
 
  /*------Display Result in Fahrenheit------*/
  lcd.setCursor(0, 1);
  lcd.print("Temp: ");
  lcd.print(temperatureF);
  lcd.write(1); // Degree symbol
  lcd.print("F");
 
  delay(2000); // Update every 2 seconds
}

Upload the above code to the Arduino Board. The LCD will start displaying the temperature reading both in degree Celsius & Fahrenheit Scale.

Interfacing LM35 Temperature Sensor with Arduino & LCD Display




Video Demonstration & Explanation:

Watch this video tutorial that explains all about Digital Thermometer Using Arduino & LM35 Temperature Sensor.

Digital Thermometer using LM35 Temperature Sensor and Arduino
Watch this video on YouTube.

The LM35 Temperature Sensor can be interfaced with ESP32 Web Server to display the temperature readings on a web page.

Share. Facebook Twitter Pinterest LinkedIn Tumblr Email Reddit Telegram WhatsApp
Previous ArticleHome Automation using Amazon AWS IoT Core & ESP32
Next Article IoT AC Energy Meter with ESP32 & HMI Display

Related Posts

DC Energy Meter using Arduino

Build a DC Energy Meter using Arduino – 32V/5A

Updated:August 26, 20252K
Interfacing ADXL375 Accelerometer with Arduino

Interfacing ADXL375 Accelerometer with Arduino (±200g)

Updated:June 28, 2025
PZEM-004T Arduino Energy Meter

DIY AC Energy Meter using PZEM-004T & Arduino

Updated:March 6, 20258K
Interfacing BMI160 Accelerometer & Gyroscope with Arduino

Interfacing BMI160 Accelerometer & Gyroscope with Arduino

Updated:February 2, 20259K
Password Based Door Lock Security System Using Arduino & Keypad

Password Based Door Lock Security System Using Arduino & Keypad

Updated:February 2, 20252436K
Earthquake Detector Alarm with with Accelerometer & Arduino

Earthquake Detector Alarm with Accelerometer & Arduino

Updated:February 2, 2025661K
View 8 Comments

8 Comments

  1. jesima on November 22, 2018 5:41 PM

    why this byte degree(8) function is used in this program.please explain me

    Reply
    • Alex Newton on November 22, 2018 6:11 PM

      It is used for displaying degree sign.

      Reply
  2. Arushi Pipania on July 8, 2019 10:15 PM

    okay. thank you.

    Reply
  3. Arushi Pipania on July 14, 2019 10:57 AM

    Do I need to first test my lcd working with arduino? or can i just directly connect like the above circuit and tset the circuit directly?

    Reply
  4. Vinay Singh on October 24, 2020 3:50 PM

    I have few doubts plz contact me. It’s very important

    Reply
  5. Vinay Singh on October 24, 2020 3:51 PM

    Plz contact me. I have few doubts.

    Reply
  6. titus is cool on June 10, 2021 4:26 AM

    why does it say exit status 1
    ‘LiquidCrystal’ does not name a type
    when u upload it ?

    Reply
  7. Vinay kumar on September 17, 2021 12:58 PM

    Sir We uploaded the laptop there but the lcd display does not make sense at all temperature

    Reply

CommentsCancel reply

Latest Posts
IoT Based PM & Air Quality Monitoring System using ESP32

IoT Based PM & Air Quality Monitoring System using ESP32

May 31, 2026
DIY ESP32 MLX90640 IR Thermal Camera with Live Web Display

DIY ESP32 MLX90640 IR Thermal Camera with Live Web Display

May 10, 2026
IoT Activity Tracker with ESP32 & Accelerometer Gyroscope

IoT Activity Tracker with ESP32 & Accelerometer/Gyroscope

May 2, 2026
A Guide to Sourcing Obsolete ICs for Vintage Projects

Beyond AliExpress: A Guide to Sourcing Obsolete ICs for Vintage Projects

April 21, 2026

ESP32 IoT Vehicle Motion Analyzer with MPU6050 & LIS3MDL

April 27, 2026
Building a Smart Sensor Node with a BLE Microcontroller

Building a Smart Sensor Node with a BLE Microcontroller

February 26, 2026
High-Accuracy Pitch, Roll, Yaw with ESP32 & BNO08x IMU

High-Accuracy Pitch, Roll, Yaw with ESP32 & BNO08x IMU

April 27, 2026
DIY Colorimeter using AS7265x Spectroscopy Sensor & ESP32

DIY Colorimeter using AS7265x Spectroscopy Sensor & ESP32

February 1, 2026
Top Posts & Pages
  • IoT Based PM & Air Quality Monitoring System using ESP32
    IoT Based PM & Air Quality Monitoring System using ESP32
  • 12V DC to 220V AC Inverter Circuit & PCB
    12V DC to 220V AC Inverter Circuit & PCB
  • IoT AC Energy Meter with PZEM-004T & ESP32 WebServer
    IoT AC Energy Meter with PZEM-004T & ESP32 WebServer
  • Buck Converter: Basics, Working, Design & Application
    Buck Converter: Basics, Working, Design & Application
  • ECG Graph Monitoring with AD8232 ECG Sensor & Arduino
    ECG Graph Monitoring with AD8232 ECG Sensor & Arduino
  • How to use INA219 DC Current Sensor Module with Arduino
    How to use INA219 DC Current Sensor Module with Arduino
  • L293D Dual H-Bridge Motor Driver IC Pins, Circuit, Working
    L293D Dual H-Bridge Motor Driver IC Pins, Circuit, Working
  • ESP32 CAN Bus Tutorial | Interfacing MCP2515 CAN Module with ESP32
    ESP32 CAN Bus Tutorial | Interfacing MCP2515 CAN Module with ESP32
Categories
  • Arduino Projects (197)
  • Articles (60)
    • Learn Electronics (19)
    • Product Review (15)
    • Tech Articles (28)
  • Electronics Circuits (46)
    • 555 Timer Projects (21)
    • Op-Amp Circuits (7)
    • Power Electronics (13)
  • IoT Projects (204)
    • ESP32 MicroPython (7)
    • ESP32 Projects (81)
    • ESP32-CAM Projects (15)
    • ESP8266 Projects (76)
    • LoRa/LoRaWAN Projects (22)
  • Microcontrollers (38)
    • AMB82-Mini IoT AI Camera (4)
    • BLE Projects (18)
    • STM32 Projects (19)
  • Raspberry Pi (93)
    • Raspberry Pi Pico Projects (57)
    • Raspberry Pi Pico W Projects (12)
    • Raspberry Pi Projects (24)
Follow Us
  • Facebook
  • Twitter
  • Pinterest
  • Instagram
  • YouTube
About Us

“‘How to Electronics’ is a vibrant community for electronics enthusiasts and professionals. We deliver latest insights in areas such as Embedded Systems, Power Electronics, AI, IoT, and Robotics. Our goal is to stimulate innovation and provide practical solutions for students, organizations, and industries. Join us to transform learning into a joyful journey of discovery and innovation.

Copyright © How To Electronics. All rights reserved.
  • About Us
  • Disclaimer
  • Privacy Policy
  • Contact Us
  • Advertise With Us

Type above and press Enter to search. Press Esc to cancel.

Ad Blocker Enabled!
Ad Blocker Enabled!
Looks like you're using an ad blocker. Please allow ads on our site. We rely on advertising to help fund our site.