How to use LM35 Temperature Sensor with Arduino

lm35 with arduino circuit diagram and arduino code. complete arduino tutorials and projects with source codes

Welcome Everyone...!!!
Here is the first Tutorial in the series of Learn by Doing.Learn Arduino by Doing projects.There is a long list of 100+ amazing arduino projects.So we are going to start with some basic concepts.There are almost 10 first tutorials on Sensors then we will move towards doing amazing and cool projects.
In all these tutorials we will understand each and every component,circuit diagrams and complete Arduino codes.Stay connected on YouTube and  follow for step by step Guide and source codes.
So let's start with the basic LM35 temperature sensor...


  1. Introduction to LM35 Temperature Sensor
  2. Components List
  3. LM35 with Arduino Circuit Diagram
  4. Arduino Code

1-Introduction to LM35 Temperature Sensor

Lm35 is a Temperature Sensor that works with the variations in temperature.The internal structure of Lm35 consist of transistors,amplifier and few resistors.The integrated circuit and the resistors are calibrated in the factory to produce the accurate temperature.

The Lm35 has 3 pins:
  • Input 
  • Output
  • Ground
The output of Lm35 is in volts.Every 10 mv change is equal to 1 degree Celsius
The Exact Equation to convert voltage into degree Celsius is:

(SUPPLY_VOLTAGE x 1000 / 1024) / 10 where SUPPLY_VOLTAGE is 5.0V )

1000 is used to change the unit from V to mV
10 is constant. Each 10 mV is directly proportional to 1 Celcius.
5 is the supply voltage.
The Equation is: (5.0 * 1000 / 1024) / 10 = 0.48828125

2-Components List

  1. Arduino Board with USB Cable
  2. LM35 Temperature sensor
  3. Bread board (for practice)
  4. arduino jumper wires

3-Lm35 Temperature Sensor with Arduino Circuit Diagram

  1. Connect first pin with 5v on arduino
  2. Second with analog pin of arduino A0
  3. Third with Gnd on arduino

4-Arduino Code

float temp;                                        //Defining the temp float variable
int sensor = 0;                                 // The output pin of LM35 on arduino analog pin 0 it could be A0
void setup()
{Serial.begin(9600);                                    //start the serial monitor
void loop(){
temp = analogRead(sensor);                     //assigning the analog output to temp
float mv = ( temp/1024.0)*5000;             // Converting equation for voltage to Celsius
float celsius = mv/10;
Serial.print("The temperature is :");       //Display the results on serial monitor
Serial.println("deg. Celsius");
delay(1000);                                          //1 second delay to avoid overloop


There will be more on Lm35.How to display Temperature on LCD and Weather displaying box arduino Project.Stay connected and subscribe on YouTube for video Tutorials.
Learn by Doing...
Stay motivated and Stay Happy.....!!!!

Next Post »