Here we will setup Temperature Sensor LM35 with Arduino in Easy Steps
We all use weather applications to know the current temperature. This requires the Internet. So if I say you can know your area temperature without the Internet, how it will be?
In this post, I will share how to get local area temperature using LM35 Temperature Sensor with Arduino UNO Board.
LM35 Temperature Sensor with ESP8266 NodeMCU
Components Used:(Click to Buy)
What is LM35 Temperature Sensor?
LM35 is an integrated analogue temperature sensor whose electrical output is proportional to Degree Centigrade. LM35 Sensor does not require any external calibration or trimming to provide typical accuracies.

It has 3 pins – two pins are 5V and Ground. The middle pin is Voltage out. We use the reading of this pin to determine the temperature using some arithmetic calculation.
Because
Connect LM35 with Arduino
Following Connection Diagram you can see how to connect LM35 with Arduino UNO.


Code Explain for LM35 with Arduino
We are here using
After calculating we are displaying the temperature in serial monitor in both Celsius and Fahrenheit.
Arduino Sketch of LM35 with Arduino
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 | /* https://somtips.com https://youtube.com/somtips */ const int sensor=A0; // Assigning analog pin A0 to variable 'sensor' float tempc; //variable to store temperature in degree Celsius float tempf; //variable to store temperature in Fahreinheit float vout; //temporary variable to hold sensor reading void setup() { pinMode(sensor,INPUT); Serial.begin(115200); } void loop() { vout=analogRead(sensor); vout=(vout*500)/1024; tempc=vout; // Storing value in Degree Celsius tempf=(vout*1.8)+32; // Converting to Fahrenheit Serial.print("in DegreeC="); Serial.print("\t"); Serial.print(tempc); Serial.println(); Serial.print("in Fahrenheit="); Serial.print("\t"); Serial.print(tempf); Serial.println(); delay(1000); } |
Output LM35 with Arduino
So here you can see the temperature is showing in the serial monitor of the Arduino IDE.
