TMP36 temperature sensor
The TO-92 analog temperature sensor, TMP36 style: three legs, no protocol, and a voltage that is the temperature.
Power it, and the middle leg sits at 500 mV at 0 degrees Celsius, moving 10 mV for every degree after that: 25 degrees is 750 mV, -10 degrees is 400 mV. That offset is the whole trick of the part: it lets a single-supply sensor read below freezing with no negative rail, and it is the thing every sketch using one gets wrong the first time.
Pins
| Pin | What it does |
|---|---|
VS |
Supply, 2.7 V or more. |
VOUT |
offset + slope x temperature. |
GND |
Ground. |
Properties
offset: 500 mV by default (a TMP36); set to 0 for an LM35, which has the same
10 mV a degree with no offset. slope: 10 mV per degree by default.
While it runs
Drag the slider on the part to change the temperature it sits in.
What the model gets right
Below 2.7 V across VS and GND the part is not running and VOUT is high
impedance, exactly what an unpowered sensor does. The output is a low-impedance
source clamped to the rails, so a sensor on a 3.3 V board cannot read above 3.3 V;
the datasheet's 125 degree top of range simply is not reachable there, which is
true of the real part too.
What it does not model
No self-heating, no settling time, no noise, and no datasheet accuracy error. The temperature you set is the temperature that comes back, which makes a demo a demo rather than a calibration exercise. A real TMP36 is ±1 °C at 25 °C and ±2 °C over its range, and the straight line here has none of that.
VOUT drives through 100 ohms, which is a stand-in rather than a datasheet figure:
a real TMP36 has a much lower output impedance but can only source about 50 µA, and
neither the impedance nor the current limit is what the number represents. It is there
so a load on the output is not free. There is no supply-current draw, no supply
rejection, and no way to overload the output. It simply behaves as a 100 ohm source
however much current is taken from it.
Common mistakes
Forgetting the offset when converting the voltage back to a temperature. A sketch that assumes 0 V is 0 degrees, LM35-style, reads a TMP36 as 50 degrees too hot.
See it in action
Thermometer reads a TMP36 straight onto an LCD. Open it at /templates.