Temperature Sensor TMP36

Introduction

The TMP36 reads the ambient temperature. As temperature rises, the voltage across the diode increases at a known rate. The sensor has no moving parts, so it does not wear out over time. The TMP36 can read between -40 and 150 C (Adafruit).

Sources

The TMP36 is inexpensive. It is available for $2.00 at Adafruit, for $1.50 at Sparkfun, among others.

Applications

We used the TMP36 in a project to test air quality. We were using the MQ-135 air quality sensor, and in order to calibrate that sensor's results, we needed to also know the temperature and the humidity.

But the TMP36 has many different applications. You could use the ambient temperature to control the color of an LED or to affect a video display, for example.

Electrical Characteristics

Here is the TMP36 Datasheet\\ The TMP36 takes between 2.7 and 5.5V, and it draws 0.05 mA of current.

Pin Description

The left pin should be connected to power, the right pin to ground, and the middle pin should be read as analog output.

Microcontroller Connections

Here is an image of the TMP36 connected to an Arduino Uno, along with an HIH4030 humidity sensor and a MQ135 air quality sensor.

Code Sample

TMP36 Code Sample .
The sensor can be read as an analog input. The input values are then converted to voltage. Then you can convert the voltage to Farenheit and/or Celsius values. We know from the datasheet that at 50 degrees C, the sensor outputs exactly 1V. We use this information to convert the values.

The Arduino has an internal temperature sensor. You can tap into that temperature sensor as a comparison to the TMP36.
TMP36 Code Sample with Internal Temp
The code is based on Secret Thermometer code. We found that the Arduino's temperature sensor is not very accurate, however.

Typical Behavior

We found that the sensor takes a while to get accurate results, sometimes as long as 10-20 minutes.

References

Adafruit's tutorial

Keywords

Temperature, Thermometer, Hot, Heat, Cold, Farenheit, Celsius, Degrees, Weather