Table of Contents
KEY TAKEAWAYS
- The LM35 is a precision analog temperature sensor with a linear 10mV/°C output
- No external calibration is needed — it outputs 0V at 0°C and 1V at 100°C
- Connect the analog output to an ADC pin and convert the reading:
temp = (ADC_value * 5.0 / 1024) * 100 - The LM35 is suitable for ambient temperature monitoring in the range of -55°C to +150°C
LM35 Temperature sensor Features
- Calibrated Directly in Celsius (Centigrade)
- Linear + 10-mV/°C Scale Factor
- 0.5°C Ensured Accuracy (at 25°C)
- Rated for Full −55°C to 150°C Range
- Suitable for Remote Applications
- Operates from 4 V to 30 V
- Less than 60-µA Current Drain
- Low Self-Heating, 0.08°C in Still Air
- Non-Linearity Only ±¼°C Typical
- Low-Impedance Output, 0.1 Ω for 1-mA Load
LM35 Pin-Out:
The LM35 consists of only three pins. The pin-out is as follows:
LM35 Working Principle (LM35 output):
Linear + 10-mV/°C Scale Factor
| Temperature (in °C) | Vout (in mv) |
| -10 | -100 |
| 1 | 10 |
| 10 | 100 |
| 20 | 200 |
| 30 | 300 |
| 90 | 900 |
| 150 | 1500 |

LM35 Temperature Sensor Circuit Configuration
LM35 can be used in two circuit configurations. Both yield different results.In the first configuration, you can only measure the positive temperature from 2 degrees Celsius to 150 degrees Celsius. For this configuration, we simply power lm35 and connect the output directly to analog to digital converters.In the second configuration, we can utilize all the sensor resources and can measure the full range temperature from -55 degree centigrade to 150-degree centigrade. This configuration is a little complex but yields better results. We have to connect an external resistor, in this case, to switch the level of negative voltage upwards. The external resistor value can be calculated from the formula given below the configuration circuit.The second configuration circuit can be made in various ways.To see about the second configuration circuits visit the LM35 datasheet by Texas Instruments. Texas Instruments data sheet enlists the circuit with clear component values.Steps to calculate temperature using LM35 temperature sensor
- Build circuit.
- Power LM35 vcc to +5-20 volts and gnd to ground.
- Connect Vout to analog to digital converter input.
- Sample the ADC reading, vout output voltage.
- Convert the voltage to temperature.
Formula to convert voltage to temperature
Centigrade Temperature = Voltage Read by ADC / 10 mV(mills Volt)
I divided by 10 mV because Linear scale factor is for LM35 is 10mV. Following the above steps and tutorial, you can easily interface LM35 temperature sensor with any microcontroller that has a built-in analog to digital converter pins. Almost all the microcontrollers today have built-in ADC.For a demonstration and an example, I will use Arduino and show you how to interface LM35 with an ArduinoLM35 with Arduino:
For this tutorial we need an arduino board(Uno, Maga, Lenardo etc) and Lm35 temperature sensor. I am using Arduino Uno. What we will do is:- Make the Circuit
- Read the Temperature Sensor Output
- Convert the ADC Value to equivalent temparature
- Display the data in serial monitor
1) Make the Circuit

| LM35 | Arduino |
| Pin 1 – Vcc | 5v |
| Pin2 – Vout | A0 |
| Pin3 – Gnd | Gnd |
2) Read the Temperature Sensor Output
To read the sensor output, we will simply call theanalogRead() function in Arduino. To this function, we need to pass the ADC channel value, or A0 in our case. A0 is the pin to which the sensor output pin is connected. We will store the result in a variable named ADCValue.float ADCValue; ADCValue = analogRead(A0);
3) Convert the ADC Value to equivalent temparature
Now that we have the ADC value in a variable, we have to do two things:- Convert the ADC Value to equivalent voltage
- Convert the voltage to temperature reading
float tempVoltage = 0; tempVoltage = (5/1023)*ADCValue;Example: if the temperature is 30 degrees, the sensor output will be 300 mV. This will give an ADCValue = 61Converting this value to voltage = (5/1023)*61 = 0.298VSince our sensor output is in mV, we will multiply the entire value with 1000 to convert from voltage to milliVolts. So, our new statement becomes:
tempVoltage = ((5/1023)*ADCValue)*1000; //sensor output in milli voltsNow that we have the voltage of the sensor, we need to convert it to equivalent temperature. Remember, we saw earlier that the scaling factor of LM35 is 10mV/degree Celcius? That is, For every degree celcius of the temperature, the sensor output is 10 mV.So, if we have the mV reading of the sensor and divide it by 10, the new value will be our temperature. Let’s do that:
float temperature = 0; temperature = tempVoltage/10; //temperature in Celcius
4) Display the data in serial monitor
We will now display this calculated temperature in the serial monitor:Serial.print("Temperature = ");
Serial.println(temperature); LM35 with Arduino – Full Code:
Combining all the above knowledge together, we have a small code that can give us the temperature//Arduino code to read temperature from LM35 Temperature Sensor
// by Nerdyelectronics.com
void setup()
{
Serial.begin(9600); //initialize serial communication with 9600 baud rate
}
void loop()
{
float ADCValue;
float tempVoltage = 0;
float temperature = 0;
ADCValue = analogRead(A0);
tempVoltage = ((5/1023)*ADCValue)*1000; //sensor output in milli volts
temperature = tempVoltage/10; //temperature in Celcius
Serial.print("Temperature = ");
Serial.println(temperature);
delay(5000); //We will check the temperature every 5 seconds
}That’s all about LM35 and how to use it for monitoring the temperature. As an upgrade, you can think about sending the temperature value to the cloud. This post explains in details how to send sensor data to the cloud. In the example in the post, I have used LM35 to read the temperature and then send it to cloud.Common Mistakes When Using the LM35
- Integer division in ADC conversion: Writing
(5/1023)*ADCValuein C produces zero because5/1023is integer division. Use(5.0/1023.0)*ADCValueorADCValue * 5.0 / 1023.0to force floating-point math. - Using the wrong reference voltage: If your Arduino is powered via USB, the 5V rail may actually be 4.6–4.8V. For better accuracy, use the internal 1.1V reference (
analogReference(INTERNAL)) and adjust the calculation:temperature = ADCValue * 1.1 / 1023.0 * 100.0. The 1.1V reference is stable regardless of USB voltage. - No decoupling capacitor: The LM35 output is analog and susceptible to noise. Add a 100nF ceramic capacitor between VCC and GND, placed as close to the sensor as possible. Without it, readings can jump ±2–3°C randomly.
- Long wire runs without shielding: If the LM35 is more than 30 cm from the Arduino, the analog signal picks up noise from nearby digital signals and motors. Either use shielded cable or add a 100Ω resistor in series with the output and a 1µF capacitor to ground at the ADC input (low-pass filter).
- Reading too fast: The LM35 output stabilises about 2–4 ms after a power change. If you are switching the sensor on/off to save power, add a short delay before reading. Also, calling
analogRead()in a tight loop with no delay floods the serial monitor and makes the output unreadable — adelay(1000)is usually sufficient for temperature monitoring. - Expecting sub-zero readings on Arduino: The LM35 can measure down to -55°C, but only with a negative supply voltage on pin 3 (or a pull-down resistor circuit). With the standard 3-pin connection to Arduino, it can only read 0°C and above. The datasheet shows the required circuit for negative temperature measurement.
📖 Related: Power Supply and Voltage Regulators for Embedded Systems • ADC in Microcontrollers: How It Works, Reading Patterns, and Common Pitfalls
Going further: The LM35 outputs an analog voltage that the MCU reads through its ADC — for the full picture on resolution, reference voltage, sampling, and the common pitfalls, see our ADC in Microcontrollers guide.

Vivek Bhageria — Lead Firmware R&D Engineer, 12+ years. Ex-Bosch (automotive powertrain), MusicTribe (real-time audio), medical devices. M.Tech BITS Pilani. I write at NerdyElectronics — practical, register-level embedded systems for engineers who want to understand what’s actually happening under the hood.




