Problems with analogRead()

Hi all,

I'm using a LM34DZ(http://www.national.com/ds/LM/LM34.pdf) currently. I've got the wiring pretty straight forward with the Vin to the 5v, the ground to gnd and the Vsupply to analog pin 3 .

The readout I'm getting is 1020ish, regardless of the current temperature and regardless of how long I've left it alone. I've also duplicated the results with another LM34 and different analog pins.

The specs indicate that the LM34 should provide 10mv per degree so at room temp you would expect to see around 700mv.

(I presume you meant Vs is connected to 5V)

If you have a voltmeter, connect Vout to the meter and see what you read. Disconnect it from the Arduino pin if you dont get a meaningful reading.

If not, try connected a pot instead of the temp sensor to the arduino as per the analog tutorial and see if you can change the analogRead value by changing the pot.

Also check that the Aref arduino pin isn't acidently shorted to ground, that would cause the reading on all analog pins to be 1023.

I sounds like you hooked it up reversed.

It should be :

Ground to ground of course Vs to 5V Vout to analog pin

The Vin is currently the 5v and the Vout is hooked into the analog pin. Sorry for putting the confusing wiring up.

I took a multimeter to it last night and, to my horror, found it was indeed putting out about 1 volt, translating to 100 degrees F. Now, taking into account self heating and other various factors, I still do not understand how the little bugger is putting 102 when the ambient temperature is around 60-70.

It does appear (luckily) that there are no shorts in the system. I'll double check the Aref pin later tonight but could it be possible I just got a bad batch of LM34's?

If you are getting 1 volt into the analog pin then you should be reading a little over 200, not 1023.

Ok. So get this. I pulled all my other junk off for the moment (i had an LCD screen wired up on the digital side) and put the sensor in as such.

I make sure the wiring is correct (Vin+ to the 5v+) and after plugging it up for a moment, the arduino shuts off and the probe is now super hot.

I'm noob for sure, but jeez. How'd I screw this up?

I make sure the wiring is correct (Vin+ to the 5v+) and after plugging it up for a moment, the arduino shuts off and the probe is now super hot.

Would VIN be that 12v wall wart your using to power the Arduino by any chance. :P

You want the 5v pin, not VIN.

Not the Vin on the arduino but the lm34