Go Down

Topic: Analogread fluctuation (Read 38 times) previous topic - next topic


i am trying to measure voltage of 12v battery using arduino
i have coded everything and is working fine
the only problem is the analogread value is fluctuating a lot
i am using a buck converter to power up the arduino mega (6v in at the vin pin)

Please suggest what to do


Says here:

If supplied with less than 7V, however, the 5V pin may supply less than five volts and the board may be unstable
Maybe you aren't getting a reliable 5V. But if you look around the forum you'll find the analog input does fluctuate at the best of times, and it's been suggested to use only every second reading.
meArm build blog:     http://jimbozamearm.blogspot.com/

Please don't PM for technical advice. Firstly my advice is sometimes wrong, and second, in the forum you get a broader, more timely, range of responses.


Aref should always have a capacitor to ground. Something like 0.1uF should be fine.

You might also take 5 or 10 readings and average them.

I presume you are using a resistive voltage divider. Add a 0.01uF capacitor from the analog pin to ground.

If this is in a car, a car is an incredibly noisy place. You may have ground noise. If you want an actual accurate, smooth reading of battery voltage, you might want to put a small Arduino right near the battery.
Steve Greenfield AE7HD
Drawing Schematics: tinyurl.com/23mo9pf - tinyurl.com/o97ysyx - tinyurl.com/q7uqnvn
Multitasking: forum.arduino.cc/index.php?topic=223286.0
gammon.com.au/blink - gammon.com.au/serial - gammon.com.au/interrupts

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!

via Egeo 16
Torino, 10131