LM35 Temperature Sensor: Pinout, Formula & Calculator

Share:
Electronic Sensors
LM35 Temperature Sensor: Pinout, Arduino Formula, Negative Temperature Wiring and Troubleshooting

The LM35 is a small three pin IC that gives an output voltage directly proportional to temperature in degrees Celsius, at 10 mV for every degree. This guide shows how to wire it, read it on an Arduino and fix common errors.

10 mV per °C LM35 Pinout Arduino ADC Formula Negative Temperature Circuit Troubleshooting

The LM35 temperature sensor is the easiest way to add accurate Celsius measurement to a microcontroller project, with no calibration and only three wires. Here you get the pinout, the ADC formula, a calculator, solved examples and field tips for long cables and noisy panels.

Hello everyone, today we are going to understand how the LM35 temperature sensor works, how to wire it to an Arduino, how to convert its ADC reading into degrees Celsius and how to troubleshoot wrong readings.
LM35 temperature sensor

What Is the LM35 Temperature Sensor?

The LM35 temperature sensor is a precision integrated circuit whose output voltage rises linearly by 10 mV for every 1 °C, so 250 mV means 25 °C. It needs no external calibration, draws less than 60 µA and runs from any supply between 4 V and 30 V.

Quick Answer
  • Output: 10 mV per °C, 0 V at 0 °C, so T (°C) = Vout in mV ÷ 10.
  • Pinout (flat face towards you): pin 1 +Vs, pin 2 Vout, pin 3 GND.
  • Range: minus 55 °C to 150 °C for LM35 and LM35A; 0 °C to 100 °C for LM35D.
  • Accuracy: ±0.5 °C at 25 °C for the A grade and ±1 °C for the standard part.
  • Arduino Uno: T = reading × 500 ÷ 1024 with the default 5 V reference.

Texas Instruments, the maker, describes it as a centigrade sensor because its output is already scaled in Celsius, unlike Kelvin sensors that need an offset subtracted. Inside, it is a bandgap circuit, the same principle used in a precision reference voltage chip, trimmed at the wafer level.

LM35 temperature sensor pinout diagram showing Vcc, analog output and ground pins of the TO 92 package
Image credit: Components101. Pinout diagram courtesy of Components101, shown here for educational reference.

The labelled diagram shows the common TO 92 plastic package seen in every Indian electronics shop and college lab kit. Components101 lists pin 1 as Vcc, pin 2 as the analog output and pin 3 as ground, with ±0.5 °C accuracy and a minus 55 °C to 150 °C range.

Advertisement

LM35 Temperature Sensor Pinout and Connection

Hold the LM35 temperature sensor with the flat printed face towards you and the legs pointing down. From left to right the pins are +Vs, Vout and GND, and this order is the same for the TO 92 and TO 220 packages.

PinNameConnect ToNote
1+Vs5 V pin of Arduino4 V to 30 V allowed
2VoutA0 analog input10 mV per °C
3GNDArduino GNDCommon ground with ADC
Quick Tip

Before applying power, check the pin order twice, because a reversed LM35 gets hot within seconds and can be damaged. Touching the body gently after power up is a quick field check.

How the LM35 Temperature Sensor Works

Every silicon junction has a base emitter voltage that falls by roughly 2 mV per °C, while the difference between two junctions run at different current densities rises with absolute temperature. The LM35 combines these signals with an internal amplifier, much like an op amp stage, to produce a clean 10 mV per °C output.

Because the output is linear, there is no lookup table as with an NTC thermistor and no cold junction compensation as with a thermocouple. TI specifies typical nonlinearity of only ±0.3 °C for the standard grade.

10 mV/°CLinear scale factor
60 µAMaximum quiescent current
0.08 °CSelf heating in still air
4 V to 30 VSupply range
Do You Know?

The LM35 output impedance is only about 0.1 Ω at 1 mA, so it can drive an ADC input directly. TI says it can drive 50 pF without special precautions, but a long cable needs extra care.

LM35 Grades and Accuracy

TI sells several grades of the same die, each tested to a different limit. The table below uses the tested limits from the TI datasheet SNIS159H, so you can choose a grade before buying.

GradeRangeAccuracy at 25 °CFull Range Accuracy
LM35Aminus 55 to 150 °C±0.5 °C±1 °C
LM35minus 55 to 150 °C±1 °C±1.5 °C
LM35CAminus 40 to 110 °C±0.5 °C±1 °C
LM35Cminus 40 to 110 °C±1 °C±1.5 °C
LM35D0 to 100 °C±1.5 °C±2 °C

Most hobby modules in India use the LM35DZ version of the LM35 temperature sensor. It is ideal for room, panel and liquid temperatures between 0 °C and 100 °C, but it cannot report below zero.

LM35 Temperature Sensor Arduino Formula

An Arduino Uno has a 10 bit ADC that converts 0 V to 5 V into a reading from 0 to 1023. Each step is 5 ÷ 1024 = 4.88 mV, or about 0.49 °C.

Vout (mV) = reading × Vref × 1000 ÷ 1024
T (°C) = Vout (mV) ÷ 10
Short form for 5 V: T = reading × 500 ÷ 1024

Solved example: reading = 62, Vref = 5 V
Vout = 62 × 5000 ÷ 1024 = 302.7 mV
T = 302.7 ÷ 10 = 30.27 °C
T (°F) = 30.27 × 1.8 plus 32 = 86.49 °F

Some code divides by 1023 instead of 1024, and the difference is under 0.1 percent, far smaller than the sensor tolerance. In code, write float tempC = analogRead(A0) * 500.0 / 1024.0; and use a decimal point so the math is not done in integers.

LM35 Temperature Sensor Calculator

ADC Reading to Temperature
Result
Output 302.7 mV, temperature 30.27 °C (86.49 °F), resolution 0.49 °C per step

Second Solved Example: 1.1 V Internal Reference

With analogReference(INTERNAL) the ATmega328P on the Uno uses its internal 1.1 V reference. Each step is now 1.1 ÷ 1024 = 1.07 mV, so resolution improves to about 0.11 °C, while the usable range ends near 110 °C.

For a reading of 233, Vout = 233 × 1100 ÷ 1024 = 250.3 mV, which gives 25.03 °C. Because the internal reference can sit anywhere from about 1.0 V to 1.2 V on a given chip, measure it once at the AREF pin and use that value in your code.

Quick Tip

Take 10 to 20 readings, discard the first one after switching the ADC reference and average the rest. This simple filter steadies the last digit on an LCD.

Advertisement

LM35 Temperature Sensor Negative Temperature Circuit

In the basic single supply circuit the LM35 temperature sensor output cannot go below ground, so it reads only from about 2 °C upwards. For the full minus 55 °C to 150 °C range, TI shows a resistor R1 from the output to a negative supply.

R1 = Vs (negative) ÷ 50 µA
For a minus 5 V rail: R1 = 5 V ÷ 50 µA = 100 kΩ
Output: 1500 mV at 150 °C, 250 mV at 25 °C
Output: minus 550 mV at minus 55 °C

The ADC must then accept a bipolar input, so engineers usually add an offset and gain stage or use a sensor with a built in offset. Cold room and freezer projects in India often skip this effort and use a Pt100 RTD or a digital sensor instead.

LM35 vs Other Temperature Sensors

LM35

Celsius output at 10 mV per °C with zero volts at 0 °C.

Best for: Arduino, panels, lab practicals
Celsius
LM34

Same idea scaled at 10 mV per °F.

Best for: American designs in Fahrenheit
Fahrenheit
LM335

Kelvin output at 10 mV per K, so 2.98 V at 25 °C.

Best for: circuits that need absolute temperature
Kelvin
TMP36

500 mV offset at 0 °C lets a single supply read below zero.

Best for: battery and 3.3 V boards
Offset

For a wider view, see this guide to types of temperature sensors and the comparison of thermistor vs thermocouple.

Do You Know?

The LM35 was originally introduced by National Semiconductor, which Texas Instruments acquired in 2011. That is why old datasheets and textbooks show the National logo on the same part.

Long Cable and Noise Tips

TI recommends a 0.1 µF bypass capacitor from +Vs to GND, placed close to the sensor, as explained in our guide on decoupling capacitors. For remote sensing it shows twisted pair wiring, so run the LM35 temperature sensor on a shielded twisted pair cable and ground the shield at one end only.

A long cable adds capacitance that can make the LM35 temperature sensor output stage oscillate. TI suggests a series damper of 75 Ω and 1 µF from output to ground, or a series resistor, and a simple RC low pass filter at the ADC pin removes most remaining hum.

Keep the sensor ground and the microcontroller ground at the same point to avoid ground loops.

Installation for Accurate Readings

1
Pick the Grade
Use LM35D for 0 to 100 °C and LM35 or LM35A for below zero work.
2
Mount Close
Glue or clamp the body to the surface with thermal epoxy.
3
Seal the Leads
Cover leads with epoxy so moisture cannot leak current.
4
Bypass Supply
Fit 0.1 µF from +Vs to GND at the sensor.
5
Route the Cable
Use twisted pair away from power cables.
6
Verify
Compare with a reference thermometer at two points.

TI notes that the leads should be kept at the same temperature as the surface, otherwise heat flowing along the copper causes temperature measurement errors.

LM35 Troubleshooting Table

SymptomLikely CauseFix
Reads about 500 °CVout shorted to 5 V or open groundCheck pin order and GND wire
Reads 0 °C alwaysOutput open or wrong analog pinConfirm A0 in code and wiring
Jumps by several degreesNoise or long cable oscillationAdd 0.1 µF bypass and RC damper
Reads 2 to 5 °C highSelf heating in still air or warm boardMove away from regulator, reduce load
Sensor body very hotSupply reversedPower off and rewire
Myth: An LM35 needs calibration like a thermistor.
Fact: It is trimmed at the factory to ±0.5 °C or ±1 °C at 25 °C depending on grade.
Myth: It runs well on 3.3 V boards.
Fact: Its minimum supply is 4 V, so power it from 5 V while the output stays below 1.5 V.
Myth: Any LM35 can read minus 20 °C.
Fact: The LM35D stops at 0 °C, and even full range grades need a negative supply circuit.
Myth: More bits always means more accuracy.
Fact: A 12 bit ADC improves resolution, but sensor tolerance still limits accuracy.
Strengths
  • Linear Celsius output, no lookup table.
  • Low current draw below 60 µA.
  • Factory trimmed, no calibration needed.
  • Low cost and easy to source in India.
Limitations
  • Needs at least 4 V supply.
  • Negative temperatures need extra circuitry.
  • Analog signal picks up noise on long cables.
  • Not for industrial hazardous areas or high vibration.
Advertisement

Where the LM35 Is Used

Panel and Server Rooms
Fan control and over temperature alarms inside control panels.
Battery Packs
Charge cut off when cell temperature rises.
Incubators and Poultry
Holding a set temperature with a relay or PWM heater.
College Projects
Digital thermometers and data loggers on Arduino.
Power Electronics
Heat sink monitoring for converters and drives.

In a fan controller, the sensor feeds an Arduino that drives a fan through PWM and a MOSFET. This is the same principle used in commercial electronic cooling fans.

TI LM35 Datasheet

PDF
LM35 Precision Centigrade Temperature Sensors
Texas Instruments datasheet with grades, accuracy and application circuits

LM35 Video Tutorial

LM35 Temperature Sensor FAQ

How do you convert LM35 output to Celsius?

Divide the output voltage in millivolts by 10 to get the temperature in degrees Celsius. For example, 250 mV means 25 °C and 302 mV means about 30.2 degrees.

On an Arduino Uno with a 5 V reference, multiply the reading by 500 and divide by 1024. Always use floating point math so the result keeps its decimal places.

What is the output of LM35 at 25 °C?

The output is 250 mV at 25 °C because the scale factor is 10 mV per degree. At 0 °C the output is zero volts in the basic circuit.

At 100 °C the output reaches 1 V, and at 150 °C it reaches 1.5 V on full range grades. This is why the output stays safely inside a 3.3 V or 5 V input range.

Can LM35 measure negative temperature?

Yes, but only the full range grades and only with a resistor from the output to a negative supply. TI uses about 100 kΩ for a minus 5 V rail in its circuit.

The LM35D grade is rated only from 0 to 100 degrees. For freezers on a single supply, a sensor with a built in offset such as the TMP36 is often simpler.

Is LM35 analog or digital?

The LM35 temperature sensor is an analog sensor that gives a voltage proportional to temperature. You need an ADC, a multimeter or a comparator to read it.

Digital sensors such as the DS18B20 or DHT11 send data as serial bits instead. The analog output of the LM35 makes it easy to test with a simple meter on the bench.

What is the difference between LM35 and DHT11?

The LM35 measures only temperature and gives an analog voltage with about ±0.5 °C to ±1 °C accuracy at room temperature. It covers a much wider range than the DHT11 as well.

The DHT11 measures humidity and temperature together over a single digital wire. Its temperature accuracy is about ±2 °C and its range is roughly 0 to 50 degrees.

Why is my LM35 reading wrong or fluctuating?

The usual causes are noise on a long cable, a missing bypass capacitor or a 5 V USB supply that is not exactly five volts. Wrong pin order and integer math in code also give strange values.

Add a 0.1 µF capacitor at the sensor and average several readings in software. Then compare the result with a reference thermometer at room temperature.

Can LM35 work with 3.3 V boards like ESP32?

The sensor needs at least 4 V on its supply pin, so power it from the 5 V or VIN pin of the board. Its output stays below 1.5 V, which a 3.3 V ADC input can accept safely.

The ESP32 ADC is less linear than the Uno ADC near its ends. Calibrate it at two known temperatures or use an external ADC for better results.

Advertisement

Related Articles

External References

What We Learn Today

  • The LM35 temperature sensor gives 10 mV per °C, so dividing the output in millivolts by 10 gives the temperature directly in degrees Celsius.
  • On an Arduino Uno with a 5 V reference, temperature equals reading × 500 ÷ 1024, and the 1.1 V reference improves resolution to about 0.11 °C.
  • Negative temperatures need a resistor to a negative supply, while long cables need a bypass capacitor, twisted pair wiring and an RC damper.
I hope you like above blog. There is no cost associated in sharing the article in your social media. Thanks for reading!! Happy Learning!!
Sunayana Gadepatil, author at Instrumentation Blog
Author · instrumentationblog.in
Ms. Sunayana Gadepatil is an instrumentation professional, technical writer, and the author behind Instrumentation Blog. With a strong interest in industrial instrumentation, process measurement, and automation, she specializes in simplifying complex technical concepts into clear, practical, and easy to understand insights. Through her articles, Ms. Sunayana shares valuable knowledge on flow, pressure, level, temperature, control systems, and industrial automation for engineers, students, technicians, and industry professionals.
Technically reviewed on

Leave a Reply

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