Go Down

Topic: analogRead fluctuates (Read 609 times) previous topic - next topic

fcady

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!

Grumpy_Mike

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

RIDDICK

1.
the voltmeter averages its readings...
it doesnt update the display 5000 times per second... :)
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...
-Arne

dhenry

Quote
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.

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy