Reading Temperature Using LM35 Temperature Sensor With Arduino Uno

by Utsource in Circuits > Arduino

4423 Views, 0 Favorites, 0 Comments

Reading Temperature Using LM35 Temperature Sensor With Arduino Uno

LM35_Interfacing_Diagram.png
Hi guys in this instructables we will learn how to use LM35 with Arduino. Lm35 is a temperature sensor which can read temperature values from -55°c to 150°C.
It is a 3-terminal device that provides analog voltage proportional to the temperature. Higher the temperature, higher is the output voltage.

The output analog voltage can be converted to digital form using ADC so that a microcontroller ( in our case Arduino ) can process it.

Things You Need

images(90).jpg
Km5Zu-2RIncAUweU7uG7IhyWPySZ0SqIgAI0-vk9w7767_IkthCPCcsirj2GGmXF4IdQDg8UVpHVLVM6CXnzFsG1hnAdSkK7BIhIOtEldXoZiDsvzsPo-6o0rD6Mda7UyOE=w456-h323-nc.png
electronics-kit-resistor-led-button-breadboard-wire-1697-1024x1024.jpg

For this instructables you will need following things :

1x Arduino uno ( or any other equivalent)

1x LM35 TEMPERATURE SENSOR

Jumper wires

Breadboard

Connections

LM35_Interfacing_Diagram.png
The connections are very easy connect everything According to the image shown and you'll be fine.

We will be Measuring the temperature of surroundings using LM35 and displaying it on the serial monitor of Arduino.



Here, LM35 output is given to analog pin A1 of Arduino UNO. This analog voltage is converted to its digital form and processed to get the temperature reading.

Code

images(85).jpg

Please copy the following code & Upload it to your arduino Board :

const int lm35_pin = A1; /* LM35 O/P pin */

void setup() {
Serial.begin(9600);
}

void loop() {
int temp_adc_val;
float temp_val;
temp_adc_val = analogRead(lm35_pin); /* Read Temperature */
temp_val = (temp_adc_val * 4.88); /* Convert adc value to equivalent voltage */
temp_val = (temp_val/10); /* LM35 gives output of 10mv/°C */
Serial.print("Temperature = ");
Serial.print(temp_val);
Serial.print(" Degree Celsius\n");
delay(1000);
}


Video

Testing the Temperature Sensor

Screenshot_20191014-092045__01.jpg
After connecting everything together and uploading the code to the arduino Board, i opened the serial monitor in my PC and as you can see in the picture that we are able to get out temperature output on our serial monitor.