Is a “dynamic voltage divider” even a thing? I am using an ADC ADS1115 to measure voltage on batteries. Now these batteries are sometimes 12 volts, 24 volts or a bank of 48 volts or even 72 volts.

To get 5 volts at the output of a voltage divider with 72 volts input, I need R1 to be 20 kΩ and R2 to be 1.5 kΩ. Like this I can have 0 to 72 volts measured.

However if now the input voltage is 12 volts… using the same voltage divider, I get 0.833 volts output and with 24 volts battery input, I get 1.667 volts output.

Is there a way I can measure these voltages without doing any hardware or source code modification and re-upload to code to Arduino?

  • 1
    \$\begingroup\$ you can change the gain in software. well it's not really gain, though they call it that, but basically you can adjust the max expected voltage to get full 15b resolution at 0-0.256v... github.com/adafruit/Adafruit_ADS1X15/blob/master/… \$\endgroup\$
    – dandavis
    Commented Mar 5, 2021 at 23:42

1 Answer 1


Additional hardware is needed to MUX ANALOG switches to a string of REsistors to selected sources for choosing an output with the necessary protection for OVP and ESD.

One additional input must be higher R to detect all inputs scaled low to determine which one to select with Reed Relays.

So the other way is to scale down all inputs to 5V max and then amplify all inputs too low back to 3V then scan all the sources to see which has overvoltage (5V max) then choose the next lower one.

There may be a smarter way. But this is more than the Arduino can do on its own without a fancy MUX shield. (IDK) I did this in the late '70's for a rocket payload full of different batteries using a Rack of cards on a remote computer to two umbilical. I did this using mercury wetted relays bundled on a card and after configuration scanned 96 every second.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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