NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Support Forum » Temp sensor problems

September 13, 2010
by DanN
DanN's Avatar

Have everything set up as told in the guide and get this output:

" ADC: 1023 of 1024 Temperature: 499.5

F "

That can't be right, If that was the temperature I think I would be dead

September 14, 2010
by Rick_S
Rick_S's Avatar

It appears you may have something connected incorrectly at or near the lm35 temperature sensor. Make sure the three wires and temp sensor are wired properly.

This photo may help a bit.

Photo

Rick

September 14, 2010
by Rick_S
Rick_S's Avatar

(I'm sorry) I meant the LM34 temperature sensor.

Rick

September 14, 2010
by DanN
DanN's Avatar

Thanks, a wire was loose, got it working now. The temperature seems high though, 79+, when it should be 70-73

September 14, 2010
by bretm
bretm's Avatar

Same thing here. It was reading 85 when two other nearby thermometers (digital and analog) agreed on upper 70's.

September 14, 2010
by mrobbins
(NerdKits Staff)

mrobbins's Avatar

Hi DanN and bretm,

If the temperature is reading higher than expected, please be aware of two things.

1) The Analog to Digital convert makes a relative measurement of the sensor voltage to AREF. In our calculations, we are simply assuming that AREF = 5.000 volts. However, if the battery is starting to get weak, etc, the 7805 regulator may not be able to keep up, and the voltage may drop below 5 volts. Additionally, the 7805's have some allowable tolerance for output voltage.

2) The LM34 sensors are not perfect. There is some tolerance. See this forum post where I talk about the manufacturing limits of the LM34. The key part:

"Around room temperature, the "D" grade is listed as +/- 1.2 degrees F "typical", and +/- 3.0 degrees "tested limit". The "tested limit" means they test every single chip in a controlled environment at 77 degrees F, and if the LM34 outputs anywhere between 0.740 and 0.800 volts, it passes."

The first test to do is to take a digital multimeter and read the voltage directly at the output of the LM34 to ground. Assuming that you trust the multimeter, this will tell you whether that error is on the LM34's side, or on the ADC/microcontroller's side. Also measure the GND to +5V voltage, and report back here with as many digits as your multimeter allows.

Hope that helps!

Mike

September 27, 2010
by Rob56
Rob56's Avatar

I was having similar problems with my temperature sensor. The output from the voltage regulator is just 4.83V with a battery voltage of 8.24V. Also, the temperature at the LM34 seems to actually be higher than the free air temperature, by a degree or two--when I hold the bulb of my analog thermometer close to the LM34, the analog one goes up almost two degrees. Using "sample * (4830.0/1024.0/10.0)" instead of "sample * (5000.0/1024.0/10.0)" in sampleToFahrenheit reduces the error to about one degree.

Post a Reply

Please log in to post a reply.

Did you know that a microcontroller can measure an RC time constant? Learn more...