# TMP36 x Voltage input in arduino

I have a project, using a temperature sensor, TMP36 and Arduino. Basically its a bluetooth thermometer. Everything worked fine at breadboard and connected and energized by my notebook. Now I connected it to a 4 x AA recharchable batteries and I started to get wrong temperatures (running on USB, I get 22 degrees, running on batteries, I get 44 degrees).

As formula to get the temperature, I'm using this one:

$\text{Temp in °C} = \dfrac{Vout(\text{in mV}) - 500 }{ 10}$

My debug info follows:

UPDATE

1. USB (5v)

voltage read from TMP36 = 147

voltage converted to 5v arduino

(147 * 5.0) / 1024  = 0.71

temperature = (0.71 - 0.5) * 100 = 21.78

1. Battery

4 x reachargable AA = 1.2v (voltimeter says 5.6v) not enough energy to turn it on the BT module, but the board was turned on (power light was on)

1. Recharged Battery

4 x reachargable AA = 1.2v (voltimeter says 6v.7)

voltage read from TMP36 = 171 voltage converted to 5v (I assume, that the arduino has a voltage regulator to limit the input to 5v, right?)

171 * 5.0 / 1024 = 0.83
temperature = (0.83 - 0.5) * 100 = 33


my questions are:

• Is there a way to correct it via software or should I drop the voltage, using a diode/resistor?

• At the datasheet its written that the input voltage range is from 7v to 23v. Does it means that it has a regulator to 5v internally to regulate my arduino to 5.5v? Does it means as well that I will need more battery to put it to work?

Arduino used is the Iteaduino BT

• At first glance and skim of the data sheet, nothing jumps out. More information would be helpful, like a schematic maybe. It looks like you are right to subtract off the 500mV offset and then divide by 10 mV/degC, but the answer could be that you have a different analog reference now with a different power supply than before. This could be fixed in software or hardware, at your discretion.. – Kevin H May 28 '12 at 4:51
• psychic debugging: If you did not connect battery power or ground to CPU it may still run, but through protection diodes inputs/outputs. the 200mV reference error looks like a diode dropout causing undersupplied analog reference to lie. – user924 May 28 '12 at 6:19
• Are you running your circuit from the 5V (battery of USB), or the Arduino? The Arduino has indeed a voltage regulator that needs a few volts higher than 5V to get 5V for the board. If you use 5V at the input the board's supply voltage will be too low. I probably will work, but fix this before you start troubleshooting. – stevenvh May 28 '12 at 18:12
• stevenvh: At my datasheet, it says 7v. but then i get wrong measures. Just connected direct to my USB i get the right one.. – VP. May 28 '12 at 18:26