1
\$\begingroup\$

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

schematics data sheet

\$\endgroup\$
  • 1
    \$\begingroup\$ 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.. \$\endgroup\$ – Kevin H May 28 '12 at 4:51
  • 1
    \$\begingroup\$ 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. \$\endgroup\$ – user924 May 28 '12 at 6:19
  • \$\begingroup\$ 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. \$\endgroup\$ – stevenvh May 28 '12 at 18:12
  • \$\begingroup\$ stevenvh: At my datasheet, it says 7v. but then i get wrong measures. Just connected direct to my USB i get the right one.. \$\endgroup\$ – VP. May 28 '12 at 18:26
0
\$\begingroup\$

You can neither correct it in software, nor use a diode or resistor to drop the voltage if you don't know the cause, or the error function. You get 44° instead of 22°. What would you do to solve this? Divide by 2? Would a reading running on USB of 15° also result in 30° when running on the batteries? A diode would be a bad solution in any case.

My first reaction was that the batteries would give a too high voltage. The first line of the datasheet says 2.7V to 5.5V operation. Now if those were Alkaline batteries you would have 6V, that's outside specifications, and then anything can happen. Always make sure you're within specs before you start looking at other things.
But you say they're rechargeable, that's probably NiMH, at 1.2V per cell that would give you 4.8V, almost the same as the USB's 5V. That can't explain it.

I realize it will be a simple schematic, but still: post it here. We'll need to have a look at every possibility. In the mean time, measure the batteries' voltage and report back.

\$\endgroup\$
  • \$\begingroup\$ the first line of which "datasheet"? there are two linked in my question. The arduino used has as input voltage range 7v - 23v. \$\endgroup\$ – VP. May 29 '12 at 15:48
  • \$\begingroup\$ @VP01 - Is that the reason for the downvote? The links weren't there when I answered the question. neither the update information, which is much more than what you originally presented. I answered based on what you gave us. The downvote is unjustified. \$\endgroup\$ – stevenvh May 29 '12 at 16:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.