Step 1: How to use a temperature sensor

How to measure temperature!

Using the TMP36 is easy, simply connect the left pin to power (2.7-5.5V) and the right pin to ground. Then the middle pin will have an analog voltage that is directly proportional (linear) to the temperature. The analog voltage is independent of the power supply.

To convert the voltage to temperature, simply use the basic formula:

Temp in Celsius = [(Vout in mV) - 500] / 10

So for example, if the voltage out is 1V that means that the temperature is ((1000 mV - 500) / 10) = 50 degrees Celsius

If you're using a LM35 or similar, use line 'a' in the image above and the formula: Temp in Celsius = (Vout in mV) / 10

Testing your temperature sensor

Testing these sensors is pretty easy but you'll need a battery pack or power supply.

Connect a 2.7-5.5V power supply (2-4 AA batteries work fantastic) so that ground is connected to pin 3 (right pin), and power is connected to pin 1 (left pin)

Then connect your multimeter in DC voltage mode to ground and the remaining pin 2 (middle). If you've got a TMP36 and its about room temperature (25 degrees C), the voltage should be about 0.75V. Note that if you're using a LM35, the voltage will be 0.25V
(See image below)

You can change the voltage range by pressing the plastic case of the sensor with your fingers, you will see the temperature/voltage rise.
(See image below)

Or you can touch the sensor with an ice cube, preferably in a plastic bag so it doesn't get water on your circuit, and see the temperature/voltage drop.
(See image below)

Connecting to your temperature sensor

These sensors have little chips in them and while they're not that delicate, they do need to be handled properly. Be careful of static electricity when handling them and make sure the power supply is connected up correctly and is between 2.7 and 5.5V DC - so don't try to use a 9V battery!

breadboarded to-92 -

They come in a "TO-92" package which means the chip is housed in a plastic semi-cylinder with three legs. The legs can be bent easily to allow the sensor to be plugged into a breadboard. You can also solder to the pins to connect long wires. If you need to waterproof the sensor, you can see the next step for an Instructable for how to make an excellent case.
<p>Is there a way to have two temp sensors on one Arduino and when one temp drops below the other, it turns on a blower fan?</p>
<p>2 analog inputs, compare them with if(analogRead(portForSensor1) &lt; analogRead(portForSensor2)) digitalWrite(fanPort);</p>
<p>is there any way to use the ds18b20 temp. sensor in &quot;analog mode&quot; this way.? no libraries, no conversions. i just need to see raw data/numbers (0-1024) on serial monitor. <br>i just can't find a single post that doesn't involve libraries</p><p>thank you, very informative post.!</p>
Since many years I'm using the LM35 in &quot;metal case&quot; for a lot experiments in the physical chemistry practical course of the ETH Zurich. The metal case has the advantage of a shorter time constant compared to TO-92 (~3s vs. &gt;8s), but it is much more expensive. Recently I replaced the LTC2408 ADC interfaced via the lpt port by the ADS1248 and an Arduino for data transfer to the host.
<p>Do you happen to have any code for retrieving data from the ads1248? despite the input, the adc the adc result doesn't follow.</p>
I know some detail about thermocouples which tried to outline in the site<br> <a href="http://www.about-thermocouples.com" rel="nofollow">http://www.about-thermocouples.com</a><br> But i came to know about such IC first time.Can it be used to display temperature directly.
I would think about going to the Digital sensor DS18B20. A how-To for Arduino is here: http://arduino-info.wikispaces.com/Brick-Temperature-DS18B20
<br>174<br>6.18V power supply<br>0.84 volts<br>33.88 degress C<br>92.98 degress F<br><br>173<br>6.22V power supply<br>0.84 volts<br>33.76 degress C<br>92.76 degress F<br><br>Heres the problem, .. its more like 70-72 degrees in here and im using USB power which my volt meter measures at 5.10v, the sensor @ the sensor is measuring .583v help me out here.<br>
From memory there is a way to change vref so you can do the 3.3v scale on a 5v arduino.<br><br>Be careful as from memory you can damage the 'druino if you feed it 5v when the ADC is expecting 3.3v
This is great! I've never found such a simple explanation as to how to use an Arduino before. Could you tell me though, what's the maximum length that the wires can be between the Arduino and sensor? Thank you for a great 'ible!
This was a great idea and has taught me a lot about this platform. had a suggestion thought, how bout if you can find a way to put the read out on a pc and a built in lcd screen, that way you can take this anywhere and it ll let ya tell you the temp where ever you are. the applications in ghost hunting would be tremendous.
Wow, they are so much you can do with the Arduino, I must get my self one...
Yeah, I may get myself one...
Thats cool
Laugh out loud...
Meh, 'lol' is easier to type. :-)
I'm getting myself an arduino(and now that i am typing it more often i now know how to spell it right! :P), The lowest price i found anywhere on the internet(blagonet, blagoshpere lol what did i say lol? lol) at $27.9869 American dollars! But it is the Older one, From 07 the latest one from 09 is the one i want for like 3 dollars more at 29.99 American Dollars. On ebay i found one for 19.99, but of course, its a fake, coming from hong kong and having more than 10000 of them...so yeah...
Get the Duemilanove. It's worth the extra $3. &gt;.&gt; It automatically switches to the power source your using, so you don't have that annoying jumper, and with the ATMega328p it has twice as much storage space for sketches and twice as much ram and EEProm compared to the Diecimillia. <br/><br/>Heres a good place to get one:<br/><a rel="nofollow" href="http://www.sparkfun.com/commerce/product_info.php?products_id=666">http://www.sparkfun.com/commerce/product_info.php?products_id=666</a><br/><br/>If you havn't already gotten one.<br/>
I'm getting a duemilanove from some place for about 27 dollars, look for my topic about it
Just be sure to build a robot that takes over the world and it has to look like this:<br/><a rel="nofollow" href="http://bbs.chinadaily.com.cn/attachments/month_0805/cute%20little%20bunny_LZcNR0iKF5qw.jpg">http://bbs.chinadaily.com.cn/attachments/month_0805/cute%20little%20bunny_LZcNR0iKF5qw.jpg</a><br/>
lol, I would need an arduino nano XD
how many seconds do i need to wait between polling the sensor ? i would like to poll the sensor every .5 - 1 second. is this feasible ?
Artificial Intelligence: Thanks for your help. The link you provided to the wiki was very helpful. It seems that type K thermocouples are the most practical for hobbyist use. For those interested, you can purchase a type K for $6 at the below link: <a rel="nofollow" href="http://www.virtualvillage.com/thermocouple-with-14-x-4-type-k-probe/sku003820-031.">http://www.virtualvillage.com/thermocouple-with-14-x-4-type-k-probe/sku003820-031.</a> I'm sure there are plenty of other sources as well; (If your oven came with a meat probe, you have a thermocouple)<br/>
Is anyone aware of similar temperature switches that would work at high temperatures such as those in a BBQ grill (200-600 degrees F)?
I know they make thermistors and thermocouples which would work in that range.
Thanks much for the help
For measuring such high temperatures, you may want an other type of temperature sensor called a <a rel="nofollow" href="http://en.wikipedia.org/wiki/Thermocouple">thermocouple</a>.<br/>
It's shaped like a transistor?
Great Instructable. $2 seemed high for the TMP 36...I found them on Digikey for a bit less, $1.35 <a rel="nofollow" href="http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=TMP36GT9Z-ND">http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&amp;name=TMP36GT9Z-ND</a> Prices drop as you go higher in quantity.<br/>
Great instructable 4 stars and thanks I always had a bit of difficulty with accuracy.
I never knew about these before! Very interesting!

About This Instructable


218 favorites


Bio: All-original DIY electronics kits - Adafruit Industries is a New York City based company that sells kits and parts for original, open source hardware electronics projects ... More »
More by adafruit: Adaruit Resistor Helper Adafruit Photo Tutorial Logger Shield: Datalogging for Arduino
Add instructable to: