TMP36/TMP37 Temperature Sensor

The Analog Devices TMP36/7 is a temperature sensor with an analogue output proportional to temperature, housed in a three-lead transistor style TO-92 package.

TMP36.jpg

They work with 2.7V to 5.5V, and draw 0.05mA. You just need to connect them to an analogue input.

Reading the TMP36

The TMP36 is available from SparkFun [1] or Adafruit [2]. It gives a voltage of 10mV per °C and 500mV at 0°C, so on a 5V board the temperature in degrees is given by:

(defun tmp36-temp (a)
  (- (/ (* (analogread a) 125) 256) 50))

Reading the TMP37

The TMP37 gives a voltage of 20mV per °C, and 0mV at 0°C, so the temperature in degrees is given by:

(defun tmp37-temp (a)
(/ (* (analogread a) 125) 512))

In each case the parameter is the pin number of the analogue input you're using.


  1. ^ Temperature Sensor - TMP36 on SparkFun.
  2. ^ TMP36 - Analog temperature sensor on Adafruit.