Introduction: How to Use the TMP36 Temp Sensor - Arduino Tutorial

The TMP35/TMP36/TMP37 are low voltage, precision centigrade temperature sensors. They provide a voltage output that is linearly proportional to the Celsius (centigrade) temperature. The TMP35/ TMP36/TMP37 do not require any external calibration to provide typical accuracies of ±1°C at +25°C and ±2°C over the −40°C to +125°C temperature range.

In this tutorial you will learn how to use the TMP36 sensor with Arduino uno. The room temperature will be printed to serial monitor.

Before we start let's see more information about this sensor.

Step 1: About TMP36 Sensor

Features:

  • Low Voltage Operation (+2.7 V to+5.5 V)
  • Calibrated Directly in °C
  • 10 mV/8°C Scale Factor (20 mV/8°C on TMP37)
  • ±2°C Accuracy OverTemperature (typ)
  • ±0.5°C Linearity (typ)
  • Stable with Large Capacitive Loads
  • Specified -40 °C to +125 °C, Operation to +150 °C
  • Less than 50 µA Quiescent Current
  • Shutdown Current 0.5 µA max

You can see the TMP36 pinout in the image above.

Find more info here: datasheet

Step 2: What You Will Need

For this project you will need:

  • Arduino uno
  • Breadboard
  • TMP36 temp sensor

Step 3: The Circuit

The connections are pretty easy, see the image above with the breadboard circuit schematic.

Make sure to watch sensor from front side:

  • Connect the 5V pin to 5 Volts (5V)
  • Connect the SIGNAL pin to analog pin 0
  • Connect the GND pin to ground (GND)

Step 4: The Code

Here's the code, embedded using codebender!

We will use code from SparkFun Inventor's Kit - SIK Guide, Example sketch 07. The code is pretty self-explanatory, and the comments do a better job than me explaining how it works.

Try downloading the codebender plugin and clicking on the Run on Arduino button to program your Arduino board with this sketch. And that's it, you've programmed your Arduino with this sketch. Press connect button below to start serial communication and receive temperature from sensor.


Step 5: Well Done!

You have successfully completed one more Arduino "How to" tutorial and you learned how to use the TMP36 temperature sensor with Arduino.

I hope you liked this, let me know in the comments.

There will be more of them, so make sure to click Follow button!

Comments

author
WalterR1 (author)2017-06-30

After you've got it working you can condense it down to a single calculation (of course losing all the valuable documentation and debugging ability that you gain from doing it line by line). For farenheit I did this:

round(((((analogRead(tempin)*3.3)/4095.0)-0.5)*100.00)*1.8)+32.0)

author
WalterR1 (author)2017-06-30

Putting a 10 picofarad capacitor from the middle terminal to ground should siphon off any transient rf that you're picking up... mine settled down when I did that.

author
TomR121 (author)2016-08-01

Hello,

I am brand new to Arduino Uno and the world of electronics in general. I bought the Arduino starter kit a little while back, and I decided to go through the ten projects outlined in the booklet that came with the kit. One of the projects is called the "Love-o-meter" which sends variable voltages to LEDs based on the TMP36's readings. A prerequisite to the whole project is knowing the baseline room temperature, and since I don't have a thermometer, I thought I'd simply use the sensor itself to give me that information. So I found this instructable and followed the directions, plugged in the code and voila it was giving me temperatures...except that they seemed to be about 20 degrees cooler than what the room feels like. (I just discovered that my AC unit has a thermostat that is reading 72 degrees Farenheit when the temp sensor was spitting out an average of 58 degrees Farenheit.) Any help in understanding this discrepancy would be greatly appreciated! I just want to learn from what I have just discovered.

Best,

Tom

author
ElectroD1 (author)TomR1212017-01-02

You can try using a different source of power for your project. I have had issues with the sensor reading incorrect values when I am powering the Arduino from certain USB devices and wall power supplies.

author
ElectroD1 (author)ElectroD12017-01-02

I just did a test, and got temperature values about 6 degrees Fahrenheit lower powering the Arduino from a 9v a wall power supply versus from my laptop's USB ports.

About This Instructable

34,756views

35favorites

License:

Bio: Arduino Tutorials by Codebender.cc Team
More by codebender_cc:How to use a magnetic door switch / sensor with ArduinoHow to Measure LUX With ArduinoHow to Control an RGB LED Strip - Arduino Tutorial
Add instructable to: