analogRead fluctuates

Hi everybody, I've written a program that constantly uses analogRead to measure the voltage being outputted by a sensor I made. I am testing the voltage with a voltmeter and it's very steady, but the arduino reading is fluctuating by 0.05 to 0.2 volts around what the voltmeter says. When I measure ground directly it seems to be fine. Any ideas what could be the problem? I tried grounding the analog pins that I wasn't reading from, but it didn't help. Thanks!

This is normal. Either put a 0.1uF cap across the voltage input or average ten or so readings.

the voltmeter averages its readings...
it doesnt update the display 5000 times per second... :slight_smile:
2.
possibly ur reference voltage is not very stable?
those 5V from the USB are not very stable...
3.
ur sensor might have some noise on the output that u cant c...
e. g. 50Hz/60Hz mains power lines cause some noise...
but 0.2volts (appr. 40LSB @Vref=5V) sounds a little bit too noisy...

fluctuating by 0.05 to 0.2 volts around what the voltmeter says.

That's 1 - 4 lsb. Typically a fluctuation of 1-2 lsbs is normal. So yours is slightly outside of that range, which could be due to the sensor's output - put it on a scope for sure.

BTW, the fluctuation you observed is the reason the adc module makes a good random number generator.