Which AVR part number? They are all very similar butGoingFastTurningLeft wrote: I am running it to ADC0 on an AVR... pretty sure its a high impedance input when the ADC and port registers are set correctly.
it would be wise to read and understand the full data
sheet for the specific device.
The ADC is a successive approximation type, with a
MUX switch in front and typically requires a source
impedance of 10k or lower.
The reference for the ADC is from an on chip bandgap
which can be further decoupled by a capacitor to the
The AVR has a noise reduction mode that halts the
processor clock during a conversion. This gives 10 bit
performance. 2.56/1024 = 2.5mV/step.
As the LM34 is 10mV per degree C output you are
trying to read only four counts per degree C, so an
intermediate amplifier would be wise.
For a room thermostat a comfort zone is probably
from 20 to 30 deg C. So your LM34 output is only
200mV to 300mV if used directly. Your ADC output
would range from &H00_50 to &H00_78.
If you replace the LM34/35 with a 5k pot (trimmer)
from Vref to Agnd the readings should be solid. If they
are not there is an error in the code (in particular
selecting a suitable sample period and noise
suppression technique). Or system or power supply
noise is to blame.
The LM34/LM35 should produce stable readings on a
DMM. If not there is probably noise from the supply.
A dedicated LDO for the temp sensor is a good idea.