Temperature Sensor With Arduino UNO
by imjeffparedes in Circuits > Arduino
101562 Views, 21 Favorites, 0 Comments
Temperature Sensor With Arduino UNO
Learn how to read Temperature using 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.
You can used this sensor for many projects, like fire prevention monitoring, weather forecasting, overheat monitor and many more.
Build Circuit
To build our circuit with Arduino Uno, follow the steps below:
- Connect Arduino Uno GND to LM35 GND
- Connect Arduino 5V pin to LM35 pin 1
- Connect Arduino Uno Analog Pin 1 to LM35 pin OUT
Program and Read the Sensor
Download and open the attached source code on Arduino IDE.
Upload the sketch and read the sensor output on Serial Monitor
int pinTemp = A1; //This is where our Output data goes
void setup() { Serial.begin(9600); } void loop() { int temp = analogRead(pinTemp); //Read the analog pin temp = temp * 0.48828125; // convert output (mv) to readable celcius Serial.print("Temperature: "); Serial.print(temp); Serial.println("C"); //print the temperature status delay(1000); }
Once uploaded you will see the temperature status like this
Temperature: 29C
Temperature: 28C
Temperature: 29C
Temperature: 27.8C