TMP36 Temperature Sensor with an Arduino Uno

A low-voltage analog temperature sensor with a 0.5 V offset, so it reads below freezing on a single supply.

TMP36 Temperature Sensor, A low-voltage analog temperature sensor with a 0.5 V offset, so it reads below freezing on a single supply.
In short

The TMP36 runs from 2.7 V to 5.5 V, so on an Arduino Uno it can use the 5V pin as wired here, with VOUT on A0. Its output does not follow the supply, while the Uno's default analog reference is the 5 V rail, so the accuracy of each reading depends on how close the Uno's 5 V really is to 5.0 V.

Wiring the TMP36 Temperature Sensor to the Arduino Uno

Pin by pin.

TMP36 Temperature SensorArduino Uno
VCC5V
VOUTA0
GNDGND

What to know on the Arduino Uno

  • The sketch assumes the ADC reference is 5.0 V. If the Uno's USB 5 V is actually 4.8 V, a sensor at 25 °C (0.75 V) reads as 0.78 V, about 28 °C. Measure your 5V pin and put that value in ADC_VREF.ADI TMP35/36/37 datasheet Rev. F, p. 8; Microchip ATmega328P datasheet DS40002061B, p. 2
  • One step of the Uno's ADC on 5 V is about 4.9 mV, nearly half a degree for a 10 mV/°C sensor, so the sketch averages eight readings.ADI TMP35/36/37 datasheet Rev. F, p. 3; Microchip ATmega328P datasheet DS40002061B, p. 2
  • For a steadier reference, wire the Uno's 3.3V pin to AREF and call analogReference(EXTERNAL) before any analogRead(): about 3.2 mV per step, and the TMP36's whole -40 to +125 °C output still fits under 3.3 V. Set ADC_VREF to 3.3.Arduino language reference, analogReference(); ADI TMP35/36/37 datasheet Rev. F, p. 1
  • Its output drives 50 µA at most, so keep VOUT's wire to A0 short and put nothing else on it.ADI TMP35/36/37 datasheet Rev. F, p. 3

TMP36 Temperature Sensor code for the Arduino Uno

Compiled for arduino:avr:uno on 2026-10-29.

No library needed
// TMP36 Temperature Sensor on Arduino Uno: wiring and a free simulation at https://www.tinkered.ai/components/tmp36/arduino-uno
const int VOUT_PIN = A0;          // TMP36 VOUT
const float ADC_VREF = 5.0;       // the Uno's analog reference: its 5 V
const float ADC_STEPS = 1024.0;   // 10-bit ADC

void setup() {
  Serial.begin(9600);
}

void loop() {
  long sum = 0;
  for (int i = 0; i < 8; i++) sum += analogRead(VOUT_PIN);
  float volts = (sum / 8.0) * ADC_VREF / ADC_STEPS;
  float tempC = (volts - 0.5) * 100.0;      // 0.5 V at 0 °C, 10 mV per °C
  float tempF = tempC * 9.0 / 5.0 + 32.0;
  Serial.print("Temperature: ");
  Serial.print(tempC, 1);
  Serial.print(" C  ");
  Serial.print(tempF, 1);
  Serial.println(" F");
  delay(1000);
}

TMP36 Temperature Sensor on the Arduino Uno: questions

Why is my TMP36 reading a few degrees off on the Arduino Uno?

The sketch's conversion assumes exactly 5.0 V, but USB often gives a little less. Measure the Uno's 5V pin and use that as ADC_VREF, or reference the ADC to the 3.3V pin through AREF.

Can I power the TMP36 from the Uno's 3.3V pin?

Yes. It runs from 2.7 V to 5.5 V (ADI datasheet, p. 3), and its 50 µA is nothing for the 3.3V pin.

How precise is the TMP36 on an Uno?

The Uno resolves about 0.5 °C per ADC step on its 5 V reference, about 0.3 °C with 3.3 V on AREF. The sensor itself is ±3 °C max at 25 °C for the common G grade (ADI datasheet, p. 3), so calibrate against a known temperature.

Keep going

For AI assistants

This guide as plain Markdown. /components/tmp36/arduino-uno.md

What will you build with it?