What's the best way to measure battery voltage?

Discussion in 'General Electronics Chat' started by Roger at CCCC, Jan 24, 2016.

  1. Roger at CCCC

    Thread Starter Member

    Jun 8, 2009
    What's the best way to measure battery voltage?

    I want to use an Arduino or Electric Imp to monitor the voltage of its battery every hour or so. But the battery's voltage is higher than the maximum analog input voltage (5 v for Arduino and only 3.3 v for Electric Imp). So the obvious way to do that is with a voltage divider across the battery. But the voltage divider drains the battery even when the battery voltage is not being monitored. So what's another way? Is there an IC that measures battery voltage without a drain on the battery itself? Or what's the best way to turn off the voltage divider when it's not being used to monitor the voltage? Is there an IC to do that? Thanks for any suggestions. I'm sure this question has been answered many times, but I couldn't find a good explanation of the best way to do it.
  2. AnalogKid

    AAC Fanatic!

    Aug 1, 2013
    If you have a spare digital output from the arduino, connect it to the gate of a 2N7000 or 7002. Source to GND, Drain to the bottom end of the battery voltage divider. When you want to take a reading, turn on the transistor, take the reading, turn off the transistor. For accurate readings, include the transistor Rdson in the voltage divider calculation.

    GopherT likes this.
  3. Dodgydave

    AAC Fanatic!

    Jun 22, 2012
    You could use Megaohms or Gigaohms resistor divider.
  4. Brownout

    Well-Known Member

    Jan 10, 2012
    Typically, input current to microcontrollers is very low ~50 - 100 nA. So you can easily use a voltage divider in the megohm range, which results in very low battery drain, averaging hundreds of thousands of hours of capacity for a typical automotive battery. I see Dodgydave beat me to this point.

    If you are still determined to switch off the voltage divider, using a megohm divider connected directly to an I/O is workable. No external swtich is needed.
    Last edited: Jan 24, 2016
  5. grahamed

    Active Member

    Jul 23, 2012
    If you disconnect the bottom of the divider from 0V then the middle of the divider will be pulled towards the input voltage and current will flow into the sensing pin and through the protection diodes.....
    Sensacell and Brownout like this.
  6. Roger at CCCC

    Thread Starter Member

    Jun 8, 2009
    Thanks to all responses. Just what I wanted to know !!
  7. RichardO

    Late Member

    May 4, 2013
    With high value resistors, Microchip recommends a capacitor from the A/D input to ground to average out fluctuations of the input voltage caused by the A/D applying varying capacitive loads to the pin during the conversion process.
  8. ian field

    AAC Fanatic!

    Oct 27, 2012
    Connect the battery to the divider via a P-channel MOSFET and use an open collector/drain output to pull the gate down to sample.
  9. marcf


    Dec 29, 2014
    I have used the 20Meg resistor in my fluke DVM as the component in a voltage divider in order to measure very small current leakage. (2v = 10 nano amps)

    Can you use the same process in an ADC converter to monitor voltages with very little loading?

    What are the draw backs of doing this. Seems input capacitance would be one, but if you are measuring DC, so what.

    Would the results be consistent from device to device?

    Just wondering.