Pantech.AI

How to Interface LM35 with Arduino UNO

Overview of LM35

LM35 Temperature Sensor

The LM35 is a temperature sensor capable of measuring temperatures from -55°C to 150°C.

It is a 3-terminal device that outputs an analog voltage proportional to the measured temperature: as the temperature increases, the output voltage also rises.

This analog voltage can be converted to digital form using an ADC, allowing a microcontroller to process the data.

For more details on the LM35 and its usage, see the LM35 Temperature Sensor topic in the sensors and modules section.

Connection Diagram of LM35 Temperature Sensor With Arduino

Interfacing LM35 With Arduino UNO

Measure Temperature using LM35 with Arduino Uno

To measure the surrounding temperature using the LM35 and display it on the Arduino’s serial monitor:

The output from the LM35 is connected to the analog pin A1 of the Arduino UNO. This analog voltage is then converted to its digital form and processed to obtain the temperature reading.

LM35 Temperature Sensor Code for Arduino Uno

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);
}

Leave a Comment

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