Wednesday, 31 May 2017

batteries - How to measure battery voltage


I am building a battery powered device. Almost all of my logic is running at 3.3v, although I do have a 5v supply for a few hobby servos.


I want to measure the battery voltage, but I can't do so directly with the ADC on my controller because the battery voltage (depending on the cell count of the lithium polymer battery that the user connects to the device) can vary between 6 and 36 volts. (My 5V and 3.3V supplies are fine with this input variation already.) The ADC can't measure anything above its supply voltage.



Obviously I need some sort of amplifier with a fractional gain, about 1/12 or so. Should I just use a simple voltage divider? How do I decide what values to use? Maximizing sleep-mode battery life is a concern, so that votes for using large values. What constrains how large those values can be? (The input impedance of the ADC, right?)


Am I better off using some sort of opamp amplifier circuit for some reason?


What's the usual solution here?



Answer



There is no one "usual" solution. Some are:



  1. Use a high side switch. Use a fairly low impedance voltage divider, but only turn it on for a short time around each battery reading. Since it's on for only a very small part of the total time, the average current draw will be low. This is usually done with a P channel FET so as not to add a offset voltage.

  2. Use as high a impedance divider as your A/D can tolerate. A/Ds are specified for some maximum source voltage impedance for two reasons, to charge up the sample and hold cap within the specified acquisition time, and so that leakage current causes a small enough offset to ignore. Too high impedance for the first reason can be overcome by a longer sampling time, which some A/Ds allow you to control. However, there is nothing you can do about the leakage. 100 nA will cause 100 mV error with 1 MΩ source impedance, for example.

  3. Use a high impedance divider followed by a buffer amp. You still have to consider leakage, but good opamp input leakage is usually a lot less than microcontroller pin leakage.



No comments:

Post a Comment

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...