TMP36 Temperature Sensor
Convert an analog sensor voltage into an approximate Celsius reading.

Wire it up
Disconnect power before changing connections. Follow terminal names rather than wire colors.
| From | To | Why it matters |
|---|---|---|
| TMP36 (sensor1) · VCC | Uno · 5V | Power connection |
| TMP36 (sensor1) · GND | Uno · GND.2 | Ground reference |
| TMP36 (sensor1) · OUT | Uno · A0 | Match this terminal to the sketch |
The complete sketch
void setup() { Serial.begin(9600); }
void loop() {
float volts = analogRead(A0) * (5.0 / 1023.0);
float celsius = (volts - 0.5) * 100.0;
Serial.print("temperature:"); Serial.println(celsius);
delay(200);
}
The launch buttons use this same code and a matching saved circuit.
Build it step by step
Open a complete project
Launch in Simulator creates a separate Uno sketch and its matching wired circuit. Existing sketches are preserved. Press Run to compile and execute.
Explore the live circuit
Change the simulated temperature from 25 to 40 °C and compare the serial reading.
Try it on hardware
Disconnect power while wiring. Match terminal names in the table, select the exact board, Verify, then connect and upload. Check component ratings and power requirements first.
Understand the sketch
Offset and slope
This example assumes a 5 V ADC reference and an ideal 500 mV offset plus 10 mV per degree Celsius. Real reference voltage and sensor tolerance introduce error.
If something is different
Impossible temperature
Check +Vs, Vout, and GND against the package pinout. Reversed power can damage a real TMP36.
Expected output and tested scope
The sketch prints a Celsius estimate from the analog voltage; it follows the modeled sensor input.
Version 1 · Last source- and build-matched test: 2026-10-25. Actual shipped AVR-GCC WASM compilation and Uno AVR engine execution; no physical hardware test.
Supported tutorial target: Arduino Uno R3 / ATmega328P. Compile: PASS · Modeled execution: PASS. Other boards require a separate review of pins, voltage, libraries and the exact build profile.