0
\$\begingroup\$

I'm working on a project where I want an Arduino Uno to measure the voltage of a 12V lead acid battery.

The Uno's analogue read pins can't handle raw 12V, so I need to use a voltage divider with roughly a 1/3 stepdown ratio to take the max 14.70 (while charging) down to 5V or less so the pin doesn't fry.

I initially built my divider circuit with R2=503K ohms, and R1 = 1M Ohms, which should give a Vout/Vin ratio of 0.334. I built the circuit and in practice I get a ratio of 0.252 or something like that (battery voltage is 12.97 and the divider is outputting 3.28V, all measured with multimeter.) 0.252 would be fine and safe enough for the Arduino, but I want to get as close to 0.334 as possible to get as much resolution of my battery voltages as the 0-5V of the analogue pin can give me.

I chose the biggest resistors I have because I don't want any more current than absolutely necessary to flow through the divider and get wasted as heat (also makes me nervous as a short circuit risk.) I do realize that this will make the current flow through the divider extremely small, something on the order of 10^-6 Amps. However this seems to be affecting the voltage that's produced.

I wonder if there is some sort of minimum current requirement for a multimeter/analogue pin to read a voltage correctly?

I've double checked the resistor values with the multimeter (within what their specs say they should be with 5% tolerance) and I set up an experiment that demonstrated the weird behaviour I'm seeing.

With R2=R1, I built two different voltage dividers, the first one with two 680K resistors, and the second one with 68K resistors.

The 68K divider gave Vout/Vin of 6.33/12.97=0.488, closer to the theoretical number I should be getting of 0.500.

The 680K divider gave Vout/Vin of 4.85/12.96=0.373.

What gives?

\$\endgroup\$
12
  • \$\begingroup\$ You may want to use a buffer between your divider and the analog pin. With such high value resistors, any loading, affects the voltage reading significantly. \$\endgroup\$
    – Big6
    Feb 21 '20 at 18:41
  • 2
    \$\begingroup\$ Does this answer your question? Why high impedance source in ADC input causes error? \$\endgroup\$ Feb 21 '20 at 18:57
  • 3
    \$\begingroup\$ @Big6, if Im understanding the root of the issue, its basically that once I have a circuit where the order of magnitude of its impedance is on par with what the multimeter or ADC is (ballpark 1 MOhm for multimeter, Im seeing 10-100 MOhm for Arduino ADC), the multimeter starts acting like another big resistor instead of an approximately infinitely resistive path? \$\endgroup\$ Feb 21 '20 at 19:06
  • 1
    \$\begingroup\$ You're correct. And that's why a buffer helps. It presents itself as a low impedance source to the measurement device. \$\endgroup\$
    – Big6
    Feb 21 '20 at 19:12
  • 1
    \$\begingroup\$ "Im seeing 10-100 MOhm for Arduino ADC" - I'm not sure where you're getting those values, but the Atmega328P datasheet mentions that the ADC is optimized for use with a source impedance of <10kΩ. It's quite likely the impedance of your voltage divider is too high. \$\endgroup\$
    – marcelm
    Feb 21 '20 at 21:32
0
\$\begingroup\$

The load is also part of the voltage divider. When you connect your voltmeter it takes some current and in doing so changes the voltage at the junction.

The Arduino will do this too. There should be details of how much in the manual for the Arduino's processor.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.