Arduino Temperature Sensor or Digital Thermometer with LM35

Hi, Today I’ve come up with a cool Arduino microcontroller project for engineering students. Through this article I’m gonna teach you how to make a thermometer with Arduino. The advantage of Arduino temperature sensor is its ease of construction. We had already seen Arduino and its features. Arduino programming is much easier than you think. Our project is a Digital Thermo meter (Arduino digital temperature sensor) built around LM35 temperature sensor. Thermo meters are widely used in many of the electronic devices like air conditioners to inform about the temperature level and control the processes of cooling system. Apart from that temperature sensors are also used in different sections of factories, furnaces and heavy machineries. Arduino-Temperature-Sensor-Circuit Here I used LM35 temperature sensor to detect the temperature level, which can sense the temperature from -55 to 150 °C. The detected temperature is displayed over 16X2 LCD with the help of Arduino. We can also treat this circuit as Interfacing LM35 Temperature Sensor with Arduino. So let’s begin with our Arduino Temperature Sensor.

Components Required for Arduino Thermometer Project

Digital thermometer Arduino uses readily available components that everyone can obtain in any electronics retail shop.

  • Arduino
  • LM35 Temperature Sensor
  • 16×2 LCD Display
  • POT 1kΩ

Arduino Temperature Sensor Circuit Schematics


Working of Arduino Temperature Sensor

  • LM35 is a reasonable temperature sensor available in any of the electronics shops. The output voltage of LM35 is linearly proportional to the Celsius (Centigrade) temperature.
  • The output of LM35 is of 10mV/°C scale factor, that means for each 1°C increase in temperature there will be a corresponding increase in 10mV, so we can easily read temperature value.
  • Arduino has an analog pin (A0) capable of reading analog signals from any sensor. As shown in the circuit diagram the analog pin A0 of Arduino is connected to the output pin of LM35.


Connection diagram of LM35 Temperature sensor

  • Arduino has 10 bit inbuilt ADC, so it can read value from 0 to 1023, i.e. for zero voltage it reads 0000 and for VCC (5V) it reads 1023.
  • Thus I have mapped 0 – 1023 to 0 – 500, because LM35 increments 10mV for each centigrade so the maximum possible increment is 500.

5V is our supply Vcc, so maximum increment is 5V

  • Using this mapping we can take each increment in the ADC value as centigrade increment. (If the ADC value is 27, the temperature value is 27°C)
  • Now let’s go to the program logic. First we may have to declare a long variable ‘A’ to store the value read from LM35, which has its range from 0 to 1023.
  • Then declare another integer variable, ‘B‘ to store mapped (converted) value.
  • The temperature value obtained from pin A0 which is stored to variable ‘A’.
  • Variable A is then mapped or converted to 0 to 500 range and stored on variable ‘B’
  • The value of ‘B’ is directly displayed on 16×2 LCD screen.

Arduino program for Temperature Sensor

[cc lang=C]
#include long A; int B;
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup(){
lcd.print(“THERMO METER”);
pinMode(A0,INPUT); }
void loop() {
lcd.print(“TEMPERARTURE: “);
lcd.print(“‘C “); }
You may also download Arduino program by following this link.

CircuitsGallery Video Lab: Arduino Temperature Sensor Video Demo

I had done a video demonstration of the Arduino Temperature sensor project. Please watch the demo below and share it. You may also visit our YouTube channel for more project demonstrations.

Did you like our temperature sensor Arduino project? Hopefully you can apply this for your academic project. Can I have your comments and thoughts here? Please like and share our facebook page to support us. Next time I will be coming with another wonderful Arduino project, till then bye…

3 thoughts on “Arduino Temperature Sensor or Digital Thermometer with LM35

  1. what if i wanted to display 3 temps to the same display then add a pid loop to follow two of those temps to reach a certian temp

  2. plzzzzz post the complete source code
    when i try using this program it shows this error

    danish:2: error: #include expects “FILENAME” or

    #include long A; int B;


    exit status 1
    #include expects “FILENAME” or

Leave a Reply

Your email address will not be published. Required fields are marked *