Skip to content

TMP36 Temperature Sensor

Convert an analog sensor voltage into an approximate Celsius reading.

TMP36 Temperature Sensor: the matching Arduino Uno circuit rendered in Circuitera’s simulator
Matching Circuitera simulator circuit. Real firmware capture; modeled components are idealized.

Wire it up

Disconnect power before changing connections. Follow terminal names rather than wire colors.

FromToWhy it matters
TMP36 (sensor1) · VCCUno · 5VPower connection
TMP36 (sensor1) · GNDUno · GND.2Ground reference
TMP36 (sensor1) · OUTUno · A0Match this terminal to the sketch

The complete sketch

tmp36-temperature.ino
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

  1. 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.

  2. Explore the live circuit

    Change the simulated temperature from 25 to 40 °C and compare the serial reading.

  3. 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.

Keep exploring.