Parts

LM35 temperature sensor: pinout, grades, accuracy and the ADC trap

By Bulan Sarkar

The LM35 in TO-92 is +VS, VOUT, GND: with the flat face toward you and the leads down, the supply is on the left, the output in the middle and ground on the right. The output is 10 mV per degree Celsius, so 250 mV means 25 °C, with no offset to subtract.

This page covers the A, C, CA and D grades, which package each comes in, self-heating, and the most common first mistake: reading it on an Arduino against the 5 V reference. The figures come from TI's LM35 data sheet and, for the ADC, Microchip's ATmega328P data sheet.

Datasheet: Texas Instruments LM35 Precision Centigrade Temperature Sensors (SNIS159H) (PDF)

Advertisement

Pinout by package

LM35DZ TO-92 · TI1=+VS 2=VOUT 3=GND
flat facetoward you+VS1 Positive supplyVOUT2 Output, 10 mV/°CGND3 Ground

Flat face toward you, leads pointing down: +VS, VOUT, GND from left to right.

TI draws the TO-92 from underneath. Seen from below with the flat side up, or from the front with the flat face toward you, the order is the same: +VS on the left.

Only the LM35C, LM35CA and LM35D come in TO-92. The LM35 and LM35A are metal-can (TO-46) parts.

Source: Texas Instruments LM35 Precision Centigrade Temperature Sensors (SNIS159H), p. 3 (LP package, 3-pin TO-92, bottom view with the flat side at the top: +VS (1), VOUT (2), GND (3) from left to right; pin functions table, TO92 column); Texas Instruments LM35 Precision Centigrade Temperature Sensors (SNIS159H), p. 23 (package option addendum: LM35DZ/NOPB in TO-92 (LP), marked LM35 DZ; LM35CZ and LM35CAZ on page 22)

LM35DM SOP-8 · TI1=VOUT 2=N.C. 3=N.C. 4=GND 5=N.C. 6=N.C. 7=N.C. 8=+VS
top view, notch upLM35D M18VOUT+VS27N.C.N.C.36N.C.N.C.45GNDN.C.

Top view, pin 1 top left: VOUT at pin 1, GND at pin 4, +VS at pin 8. The other five pins are not connected.

Source: Texas Instruments LM35 Precision Centigrade Temperature Sensors (SNIS159H), p. 3 (D package, 8-pin SOIC, top view: VOUT 1, N.C. 2, 3, 5, 6, 7, GND 4, +VS 8); Texas Instruments LM35 Precision Centigrade Temperature Sensors (SNIS159H), p. 23 (package option addendum: LM35DMX/NOPB in SOIC (D), marked LM35D M)

LM35DT TO-220 · TI1=+VS 2=GND 3=VOUT
tab =GNDprinted facetoward you+VS1 Positive supplyGND2 GroundVOUT3 Output, 10 mV/°C

Printed face toward you, leads down: +VS, GND, VOUT from left to right. The tab is ground.

Ground is the middle pin here, unlike the TO-92. TI notes the LM35DT pinout differs from the discontinued LM35DP.

Source: Texas Instruments LM35 Precision Centigrade Temperature Sensors (SNIS159H), p. 3 (NEB package, 3-pin TO-220, top view: +VS 1, GND 2, VOUT 3; tab connected to the negative pin (GND))

Which one do you have?

The letters after LM35 are the accuracy grade and the package. The grades are A and CA (the most accurate), plain and C, and D (the cheapest). A Z at the end is the TO-92, M the 8-pin SOIC and T the TO-220; an H is the TO-46 metal can. The TO-92 you find in shops is an LM35DZ, marked LM35 over DZ on two lines; the C and CA grades come in the same package as LM35CZ and LM35CAZ.

Only the C, CA and D grades are made in TO-92. The plain LM35 and the LM35A, the parts rated down to −55 °C, come only in the metal can, where pin 1 is +VS, pin 2 VOUT, pin 3 ground and the case is ground; match the leads to TI's drawing on page 3, as this page does not draw the can. The SOIC (LM35DM) and the TO-220 (LM35DT) exist only in the D grade, and the TO-220 puts ground in the middle.

Absolute maximum ratings

The supply may go from −0.2 to 35 V and the output from −1 to 6 V, with 10 mA out of the output pin at most. TI recommends 4 to 30 V on the supply. On the bench the −0.2 V figure matters most: an LM35 wired in backwards puts the full supply the wrong way across it.

Absolute maximum and recommended ratings, TI SNIS159H
ParameterLM35DZTO-92LM35DMSOP-8LM35DTTO-220
Supply voltage, absolute maximum +VS−0.2 to 35 V−0.2 to 35 V−0.2 to 35 V
Supply voltage, recommended +VS4 to 30 V4 to 30 V4 to 30 V
Output voltage VOUT−1 to 6 V−1 to 6 V−1 to 6 V
Output current IO10 mA10 mA10 mA
Specified temperature range0 to 100 °C (LM35DZ); −40 to 110 °C (LM35CZ, LM35CAZ)0 to 100 °C0 to 100 °C
Junction temperature TJ150 °C150 °C150 °C
Thermal resistance, junction to air, still air RθJA180 °C/W220 °C/W90 °C/W
Thermal resistance, moving air RθJA90 °C/W105 °C/W26 °C/W

The thermal resistance is not a rating to stay under so much as the number that sets self-heating, below. The TO-92 in still air is 180 °C/W; the TO-220 is 90 °C/W, and 26 °C/W in moving air.

Accuracy, grades and range

VS = 5 V and 50 µA load unless stated; limits are TI's tested or design limits
ParameterLM35DZTO-92LM35DMSOP-8LM35DTTO-220
Accuracy at 25 °CVS = 5 V, 50 µA load; tested limit±1.5 °C (D), ±1 °C (C), ±0.5 °C (CA)±1.5 °C±1.5 °C
Accuracy over the specified rangedesign limit at TMIN and TMAX±2 °C (D), ±2 °C (C), ±1.5 °C (CA)±2 °C±2 °C
Accuracy at 25 °C, typical±0.6 °C (D), ±0.4 °C (C), ±0.2 °C (CA)±0.6 °C±0.6 °C
Sensor gain (average slope)10 mV/°C typ; 9.8 to 10.2 (C, D), 9.9 to 10.1 (CA)10 mV/°C typ; 9.8 to 10.210 mV/°C typ; 9.8 to 10.2
Nonlinearity±0.2 °C typ, ±0.5 °C max (C, D); ±0.15 °C typ, ±0.3 °C max (CA)±0.2 °C typ, ±0.5 °C max±0.2 °C typ, ±0.5 °C max
Load regulation0 to 1 mA, 25 °C±0.4 mV/mA typ, ±2 mV/mA (C, D), ±1 mV/mA (CA)±0.4 typ, ±2 mV/mA±0.4 typ, ±2 mV/mA
Quiescent currentVS = 5 V, 25 °C56 µA typ; 80 µA max (C, D), 67 µA max (CA)56 µA typ, 80 µA max56 µA typ, 80 µA max
Quiescent currentVS = 30 V, 25 °C56.2 µA typ; 82 µA max (C, D), 68 µA max (CA)56.2 µA typ, 82 µA max56.2 µA typ, 82 µA max
Lowest temperature for rated accuracy, basic circuitoutput to ground only, no load1.5 °C typ, 2 °C max1.5 °C typ, 2 °C max1.5 °C typ, 2 °C max
Long-term stability1000 hours at TMAX±0.08 °C±0.08 °C±0.08 °C

TI specifies accuracy as the error between the output and exactly 10 mV/°C times the case temperature. An LM35DZ may be 1.5 °C out at 25 °C and 2 °C out at 0 or 100 °C; the LM35CAZ in the same package is within 0.5 °C at 25 °C. Typical figures are under half the limits, so most parts read better than their grade, but only the limit is promised.

−2 °C−1 °C0 °C+1 °C+2 °CLM35ALM35CALM35LM35CLM35Dat 25 °Cworst over the rated range
Figure 1. Accuracy by grade: blue at 25 °C, grey at the worst point of each grade's range. Limits only; typical parts do better.

The grades also differ in range. With the output simply loaded to ground, the basic circuit reads from 2 °C up; the output can sink only about 1 µA, so it cannot follow the temperature further down. For readings below zero, TI's full-range circuit adds a resistor from the output to a negative supply, sized at −VS / 50 µA, and the output then goes to −550 mV at −55 °C.

basic circuit floor, 2 °CLM35, A−55150LM35C, CA−40110LM35D0100−50 °C0 °C50 °C100 °C150 °C
Figure 2. Specified range by grade. Without a negative supply, every grade reads from 2 °C upward.

Self-heating: why the supply and the load matter

The LM35 measures its own die, and the die warms by the power it dissipates times the thermal resistance. On 5 V with no load that is 5 V × 56 µA = 280 µW, or 0.05 °C in a TO-92 in still air, and 0.072 °C with the 80 µA maximum current. TI's own claim is under 0.1 °C.

Two things spoil that. A higher supply: at 30 V the same 56.2 µA heats it by 0.3 °C. And a load on the output: 1 mA drawn from it adds (5 − 0.25) V × 1 mA, and the rise becomes 0.93 °C, more than an LM35CA's whole error at 25 °C. Feed it into a high-impedance input and run it from 5 V.

LM35D limit, 1.5 °C5 V, typ0.05 °C5 V, max IQ0.072 °C30 V, typ0.3 °C5 V, 1 mA load0.93 °C0 °C0.5 °C1 °C1.5 °C2 °C
Figure 3. How far the TO-92 warms itself in still air. The supply current alone costs a few hundredths of a degree; a milliamp of load costs nearly one.

The leads matter too. In the TO-92 the copper leads are the main heat path, so the die sits closer to the air temperature than to the surface it is glued to. TI suggests a bead of epoxy over the leads and wires so they sit at the surface temperature.

What it is good for

  • Room, enclosure and heatsink temperature on a microcontroller's ADC, from 2 to 100 °C with the D grade, without calibration or lookup tables.
  • Thermostats and fan controllers with a comparator: 10 mV/°C is easy to set a threshold against. The comparator lesson covers the circuit.
  • Remote sensing over a twisted pair, with the damper in the example below.

It is the wrong part below 2 °C without a negative supply, and for anything that needs better than about 0.5 °C without calibration. For high temperatures or a cheaper sensor with more work, see the thermistor.

Worked example: an LM35DZ on an Arduino Uno

The LM35DZ runs from the Uno's 5 V pin, its output goes to A0, and the room is at 25 °C. The ATmega328P's ADC turns a voltage into a code from 0 to 1023: code = VIN × 1024 / VREF.

1. The output. 25 °C × 10 mV/°C = 250 mV.

2. Against the 5 V reference. One code is 5 V / 1024 = 4.88 mV, which is 0.49 °C of temperature. The reading is code 51, which the sketch turns back into 24.9 °C. Every reading moves in steps of almost half a degree, and the top 80 % of the ADC's range (1 to 5 V, 100 to 500 °C) is never used.

3. Against the internal 1.1 V reference. One code is 1.1 V / 1024 = 1.07 mV, or 0.11 °C. The reading is code 232, which gives 24.9 °C, and the full scale is 110 °C, more than the D grade's 100 °C.

4. Calibrate the reference. Microchip guarantees the internal reference only between 1.0 and 1.2 V. A sketch that assumes 1.1 V on a chip whose reference is really 1.2 V reports 22.9 °C; at 1.0 V it reports 27.5 °C. Measure the AREF pin once with a meter and use that figure.

5. Self-heating. 5 V × 80 µA × 180 °C/W = 0.072 °C, small next to the ±1.5 °C of the D grade.

2 VOUT 1 +VS 3 GND U1 LM35 +5 V C1 100 nF R1 75 Ω C2 1 µF ADC
Figure 4. The sensor on a cable to A0, with TI's 75 Ω and 1 µF damper and 100 nF across the supply at the sensor. Simulated at 25 °C: 250 mV at the ADC pin, code 232 against 1.1 V.

On a short lead straight into A0, the LM35 and a 100 nF across its supply are all you need: TI says it drives 50 pF on its own. A cable is a heavier capacitive load than that, and TI's fix is the damper in Figure 4. It carries no DC, so it does not change the reading.

24.024.024.524.525.025.025.525.526.026.05 V reference1.1 V referencetrue temperature, °C (across); reading, °C (up)
Figure 5. True temperature across, reported temperature up. The 1.1 V reference gives steps four and a half times finer.

The ADC itself is good to about 2 codes, Microchip's typical absolute accuracy, so averaging a few dozen readings helps with noise but cannot beat the sensor's grade. The ADCs and DACs lesson explains the steps, and the ATmega328P page covers the chip.

Worked example in numbers

Output at 25 °C
250 mV
Step, 5 V reference
0.49 °C
Step, 1.1 V reference
0.11 °C
Self-heating at 5 V
0.072 °C
Advertisement

Tips and checks

  • Put 100 nF from +VS to ground right at the sensor. TI recommends it in noisy places, and a long supply lead is always a noisy place.
  • Throw away the first reading after switching the ADC reference. Microchip says it may be wrong; the AREF pin also needs a moment to settle.
  • Glue the sensor to what you are measuring and cover the leads, or it reads somewhere between the surface and the air.
  • Need 0.1 °C resolution on a 5 V reference? Amplify the output: a non-inverting amplifier with a gain of 4 maps 0 to 100 °C onto 0 to 4 V.
  • Keep it dry. TI warns that moisture corrodes the sensor and its leads, especially where condensation forms in the cold; coat the board and the leads.

Substitutes and equivalents

The true equivalents are the better LM35 grades in the same TO-92. Other analog temperature sensors use a different scale or an offset, so they are not drop-in parts even when the pins match.

Pin order read with the flat face toward you, leads down, left to right
PartPinsVerdict
LM35CZ+VS-VOUT-GNDSame TO-92 and pins as the LM35DZ, ±1 °C instead of ±1.5 °C at 25 °C, and rated from −40 to 110 °C instead of 0 to 100 °C. A straight upgrade.Texas Instruments LM35 Precision Centigrade Temperature Sensors (SNIS159H), p. 3; Texas Instruments LM35 Precision Centigrade Temperature Sensors (SNIS159H), p. 8; Texas Instruments LM35 Precision Centigrade Temperature Sensors (SNIS159H), p. 4
LM35CAZ+VS-VOUT-GNDThe best TO-92 grade: ±0.5 °C at 25 °C and ±1 °C at 110 °C, same pins and range as the LM35CZ. Use it where nobody can calibrate the sensor.Texas Instruments LM35 Precision Centigrade Temperature Sensors (SNIS159H), p. 5; Texas Instruments LM35 Precision Centigrade Temperature Sensors (SNIS159H), p. 22

Checking an LM35 with a multimeter

  1. Power it from 5 V and put the meter between VOUT and ground on the 2 V or 200 mV DC range. At room temperature it should read about 10 mV per degree: 250 to 300 mV in a 25 to 30 °C room.
  2. Pinch it between finger and thumb. The reading should climb by several tens of millivolts over half a minute and fall back when you let go.
  3. Measure the supply current: about 56 µA, and no more than 80 µA for a D grade at 5 V. A part that reads near the supply voltage or draws milliamps is wired wrong or damaged.

Reading datasheets shows how to find these test conditions in TI's tables.

What we'd do

Buy the LM35DZ for a 0 to 100 °C job and the LM35CAZ when you cannot calibrate and need half a degree. Run it from 5 V, never load its output, and on an Arduino read it against the internal 1.1 V reference after measuring that reference once at the AREF pin.

Questions people ask

What is the LM35 pinout?

In TO-92, with the flat face toward you and the leads down: +VS, VOUT, GND from left to right. In the TO-220 (LM35DT) it is +VS, GND, VOUT, and the tab is ground.

How do I convert the LM35 output to °C?

Divide the output in millivolts by 10. On a 10-bit ADC that is code × VREF / 1024 × 100: with the 1.1 V reference, code × 0.107.

What is the difference between the LM35 and the LM35DZ?

The D is the cheapest grade (±1.5 °C at 25 °C, 0 to 100 °C) and Z the TO-92 package. The plain LM35 is a more accurate, wider-range grade sold only in a metal can.

Can the LM35 measure below 0 °C?

Not in the basic circuit, which stops at 2 °C. With a resistor from the output to a negative supply it reads down to the grade's limit: −40 °C for the C grades, −55 °C for the LM35 and LM35A.

Will the LM35 work from 3.3 V?

Not within its rating: TI specifies 4 to 30 V. On a 3.3 V board, power it from the 5 V rail; its output stays at 1.5 V or below, which a 3.3 V ADC can read.

Buying LM35 sensors in India

Ask for the LM35 by its full part number (LM35DZ, LM35CZ or LM35CAZ): a bag labelled only LM35 does not tell you which grade you are getting. Check every new sensor against a known thermometer with the meter test above before trusting it. Our guide to buying electronic components in India compares ten online sellers and covers how to spot fakes.

Advertisement

One email a month from the bench

New circuits, lessons, part guides and calculators, on the first Sunday of each month.

We'll send one email to confirm. Every email has a one-click unsubscribe. Privacy policy

Used in these lessons

Lessons that go deeper

Datasheets this page was checked against

Makers revise datasheets. If the copy you download has a newer revision and a number here disagrees with it, the datasheet wins, and we would like to hear about it.