Comparison · Beginner · 3 min read
Temperature Sensor ICs
LM35, TMP36, TMP117 and MCP9808
By Geekobot Learning Team · Updated 29 Oct 2026
On this page
Temperature sensor ICs come in two kinds. Analog parts such as the LM35 and TMP36 output a voltage proportional to temperature: 10 mV per degree C. Digital parts such as the MCP9808 and TMP117 send an exact reading over I2C, with better accuracy and no ADC noise. Use digital chips on ESP32 boards, where the built-in ADC is poor, and analog chips for the simplest Arduino projects.
Key specs at a glance
- LM35
- 10 mV/°C, 0 °C output 0 V (LM35D 0 to 100 °C), 4 to 30 V supply, ±0.5 °C at 25 °C
- TMP36
- 10 mV/°C with 500 mV offset, so below zero works; 2.7 to 5.5 V supply, ±2 °C
- MCP9808
- I2C 0x18 to 0x1F, ±0.25 °C typical, 0.0625 °C resolution
- TMP117
- I2C, ±0.1 °C from -20 to 50 °C, 16-bit
- LM75 / TMP102
- I2C 0x48 to 0x4F, 0.5 to 0.0625 °C steps
- Typical use
- Room, enclosure and board temperature
Analog vs digital
Analog sensors are one wire to an analog pin; digital sensors are two wires to the I2C bus and need no ADC.
| Chip | Output | Accuracy | Supply | Notes |
|---|---|---|---|---|
| LM35 | 10 mV/°C voltage | ±0.5 °C | 4 to 30 V | Needs 4 V or more on the basic version; cannot read below 0 °C without extra parts |
| TMP36 | 500 mV + 10 mV/°C | ±2 °C | 2.7 to 5.5 V | Works at 3.3 V and reads negative temperatures |
| MCP9808 | I2C digital | ±0.25 °C | 2.7 to 5.5 V | Eight addresses; alert pin |
| TMP117 | I2C digital | ±0.1 °C | 1.8 to 5.5 V | Medical-grade accuracy; low power |
| DS18B20 | 1-Wire digital | ±0.5 °C | 3 to 5.5 V | Waterproof probes; see its own guide |
- LM35
- Output:
- 10 mV/°C voltage
- Accuracy:
- ±0.5 °C
- Supply:
- 4 to 30 V
- Notes:
- Needs 4 V or more on the basic version; cannot read below 0 °C without extra parts
- TMP36
- Output:
- 500 mV + 10 mV/°C
- Accuracy:
- ±2 °C
- Supply:
- 2.7 to 5.5 V
- Notes:
- Works at 3.3 V and reads negative temperatures
- MCP9808
- Output:
- I2C digital
- Accuracy:
- ±0.25 °C
- Supply:
- 2.7 to 5.5 V
- Notes:
- Eight addresses; alert pin
- TMP117
- Output:
- I2C digital
- Accuracy:
- ±0.1 °C
- Supply:
- 1.8 to 5.5 V
- Notes:
- Medical-grade accuracy; low power
- DS18B20
- Output:
- 1-Wire digital
- Accuracy:
- ±0.5 °C
- Supply:
- 3 to 5.5 V
- Notes:
- Waterproof probes; see its own guide
Reading an LM35 on an Uno
The Uno's default 5 V reference gives only about 0.5 degree steps. Switching to the internal 1.1 V reference improves resolution to about 0.1 degree and covers 0 to 110 °C.
const int PIN = A0;
void setup() {
Serial.begin(115200);
analogReference(INTERNAL); // 1.1 V on ATmega328 boards
analogRead(PIN); // discard the first reading after changing reference
}
void loop() {
long sum = 0;
for (int i = 0; i < 16; i++) sum += analogRead(PIN); // average out noise
float volts = (sum / 16.0) * 1.1 / 1023.0;
Serial.print(volts * 100.0); // 10 mV per degree C
Serial.println(" C");
delay(500);
}TMP36 formula
For the TMP36, remove the 500 mV offset first: temperature in °C = (voltage - 0.5) × 100. At 750 mV the reading is 25 °C. The TMP36 works from 3.3 V, so it suits ESP32 and Pico, though their ADCs are less linear than an Uno's. Keep the leads short and add a 0.1 µF capacitor across the supply.
Why digital chips are better on 3.3 V boards
The ESP32's ADC is noisy and non-linear. A digital chip such as the MCP9808 or TMP117 sidesteps that. They share the I2C bus with other sensors, return exact temperatures and allow alert interrupts. Libraries from Adafruit and SparkFun handle the register details.
Measurement tips
- Self-heating from a board or regulator can add several degrees. Mount the sensor away from heat sources.
- For surface temperature, press the chip against the surface with thermal paste.
- For liquids use a sealed probe such as the DS18B20; bare ICs must not be immersed.
- Allow a few minutes for the sensor to match the object.
Try it: Adc resolution calculator
Change the values and the diagram and results update as you type.
Common mistakes to avoid
- Using the 5 V analog reference and wondering why readings jump by 0.5 °C.
- Powering an LM35 from 3.3 V and getting wrong values.
- Placing the sensor next to a regulator or motor.
- Forgetting TMP36's 500 mV offset.
- Immersing a bare chip in water.
Frequently asked questions
LM35 or TMP36?
TMP36 if you want 3.3 V operation or negative temperatures. LM35 is more accurate at 5 V.
Which temperature sensor is most accurate?
TMP117 is accurate to ±0.1 °C. MCP9808 is also excellent. DHT11 is around ±2 °C.
Can an ESP32 read an LM35?
Poorly. The ADC is noisy and the LM35 needs more supply voltage. Use a digital sensor.
What is the difference between a sensor IC and a module?
The IC is the bare chip. A module adds the pins, resistors and capacitors you need to wire it easily.
Do I need pull-ups on I2C sensors?
Most breakouts already include them.
How do I measure outdoor temperature?
Use a shielded, ventilated housing so sunlight does not heat the sensor.
Parts for this guide
Calculators
Terms in this guide
Projects that use it
Put this into practice: 13 step-by-step builds in our project library use parts from this guide.
Keep learning
Sources
Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.




