Shop OBEX P1 Docs P2 Docs Learn Events
How to continuously monitor the voltage of a 12v battery without draining it — Parallax Forums

How to continuously monitor the voltage of a 12v battery without draining it

Here is a difficult problem.
How to continuously monitor the voltage of a 12v battery while draining as little current as possible?
If your ADC's range is only 0-5v, you would need a voltage divider to reduce the battery voltage.
Unfortunately, the voltage divider itself would unnecessarily drain the battery.
How now?

Comments

  • Heater.Heater. Posts: 21,230
    What kind of battery do you have? How many mAH?

    If your voltage divider is made of resistors in the megaohm range then the current draw will be down to micro amps.

    You will of course need a high impedance on your ADC input. Which they generally are.

    I suspect that you or your battery might die of old age before the battery gets discharged.

    Then the question is, where does the power com from for that ADC and whatever is connected to it?

  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2017-02-18 12:49
    Short sample using MOSFET switch to isolate the battery. If you are using a Prop you could leave power on but drop back to RCSLOW and wakeup for another sample in another minute.

    You say "continuously monitor" while draining as little current as possible. Where are your actual parameters? If the battery is supplying a lot of current it might pay to continuously monitor it every minute or even maybe every 10 seconds, not "continuously". If the battery is supplying a lot of current then why can't the monitoring micro draw a measly 20ma? If the battery is not supplying any current then why continuously monitor it?
  • Heater.Heater. Posts: 21,230
    That's the thing. If one want's to measure the shelf life of a watch battery then even continuously drawing micro-amps through a divider will drain it prematurely. Heck, even grease from your fingers across the battery drains it on that scale.

    On the other hand, if it's a tank battery I would not worry :)
  • the battery is actually a 2 cell 1000mAH lithium polymer battery.
    I currently use the Propeller's sigma delta ADC which seems to have around 100k impedance,
    so the voltage divider's impedance had to be much lower than that.

    So when the Propeller chip goes into hibernation, the voltage divider will continue to drain the battery.
    At this rate, I estimated the lithium polymer battery would be over-discharged within 3 weeks. ( which is a bad thing )
  • Heater.Heater. Posts: 21,230
    You could use a tiny reed relay to keep the circuit open. Have the Prop activate the relay and take a measurement every minute or hour or whatever. Presumably you are not expecting things to change in a hurry. Or use MOSFET as Peter says above.

  • An opto MOSFET makes it simple to place the MOSFET in the high side of the circuit. Here is a TLP222 for around about a buck in a DIP4 pack with a maximum R(on) of 2 ohms. Just run a Prop I/O to the LED via a resistor of course to turn this baby on. I'd rather use a real A/D chip, even perhaps a small PIC but then you don't need the Prop, now that wouldn't be much fun.
  • Heater.Heater. Posts: 21,230
    Back in the old days we did this kind of thing with a bridge.

    Get yourself a 24 volt supply.
    Make a potential divider from that 24v to ground with a pot and a resistor.
    Arrange to measure the voltage at the center point of the divider.
    Connect the center point of the divider to the battery with a moving coil amp (micro-amp) meter.
    Arrange to have the pot adjust to keep the meter reading zero all the time.
    In that balance condition the voltage you are now measuring is the voltage of the battery. But there is no current flow!

    Of course when we did this the divider was a meter length of resistance wire with a sliding contact on it. There was no voltage meter, just work out the voltage from the slider position. The moving coil meter was a tiny coil suspended between magnets with tiny mirror attached. A laser bounced off that mirror indicated any current flow in the coil down to pico amps!

    I know. Overkill. But fun. Just rambling on old times again...


  • ErNaErNa Posts: 1,752
    The props sigma delta is only designed that way to have an input range of -.5 to +2.5V. You can increase the input resistance by 10 and so the impedance is much higher. Also you could increase input and compensation resistors by 10. The leaking current of the balancing capacitor and the comparator input should be negligable, at least compared to the leaking out of the WH.
  • Hey, looks like the TLP222A mosfet at the high side will do the trick.
    Thanks a lot.
  • A pmosfet with a nmosfet for its gate to isolate 12V from the 3.3v system
    One just made for that , use a 100K pull-up resistor.
    http://www.mouser.com/ds/2/308/NTJD1155L-D-223159.pdf

    though any dual mosfet will work, example
    lhttp://www.mouser.com/ProductDetail/Fairchild-Semiconductor/FDG6320C/?qs=/ha2pyFadujhT0V6uAIHGKOI0FdjFoQRkSRBoJ5kg90=
  • Unfortunately the NTJD1155 will only operate up to 8v, whereas the 2 cell lithium needs to be charged up to 8.4v.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2017-02-19 00:28
    @william - tony gives you an "example", you can just as easily pick one more suitable using that example. I gave you an example of an OPTOMOSFET as I thought that would not require any head scratching on your part but you are free to take these examples and adapt them for your use.

    btw, a 2 cell lithium is not a "12v" battery. Having the proper details up front helps us help you better.
  • jmgjmg Posts: 15,173
    edited 2017-02-19 05:24
    How to continuously monitor the voltage of a 12v battery without draining it
    Here is a difficult problem.
    Worded like that, yes, it is a difficult/impossible problem.
    How to continuously monitor the voltage of a 12v battery while draining as little current as possible?
    That is no longer the same wording, and thus a different problem.
    If your ADC's range is only 0-5v, you would need a voltage divider to reduce the battery voltage.
    Unfortunately, the voltage divider itself would unnecessarily drain the battery.
    How now?
    Again, more changes in design brief, and you need numbers to define what is tolerable to you.
    That is what design is all about.

    As you allude, any voltage divider has some current cost associated. True Zero is not possible.

    However, microamps are possible, so you need to define how many microamps constitute "unnecessarily drain the battery."

    You can add a series switch, to time multiplex a divider if you are forced to use a high-drain divider, but remember that timing/switch action, also has a current budget.

    Numbers also define what you need.
    eg you can buy 10M resistors, to 0.1% precision, which will load a 10V battery to 1uA, but they are not cheap.
    You may be able to tolerate lower R, or relaxed precision.
    5% come for well under 1c in modest volumes.
    1%, ±100ppm/°C are around 2c in modest volumes
    0.5%, ±50ppm/°C are ~ 4c in modest volumes

    ..and so the design process goes, matching what you can get, at a price you can tolerate, for what you need to do.


  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2017-02-19 05:34
    Adding to jmg's comment, what exactly constitutes "continuously?" Every millisecond? Second? Minute? It all makes a difference in your power budget.

    -Phil
  • ErNaErNa Posts: 1,752
    once again: measuring 12 V needs a voltage divider, but these two resistors can be the input resistor ( 6* 1MOhm) and the feedback resistor ( 1 MOhm). This will load the battery with about 2 µAmps
  • ErNa wrote: »
    once again: measuring 12 V needs a voltage divider, but these two resistors can be the input resistor ( 6* 1MOhm) and the feedback resistor ( 1 MOhm). This will load the battery with about 2 µAmps

    Do you mean that if the Sigma-Delta input and feedback resistors are of very high resistance, there is no need for a voltage divider?
    Meaning the Sigma-Delta circuit can directly measure the voltage of a 12v battery?
  • ErNaErNa Posts: 1,752
    Yes. the delta sigma input and feedback resistors form an voltage divider. I think, Chip had in a box a couple of 100 kOhm resistors and some 1 nF capacitors, he checked the principle and that's it. ;-)
    The two resistors are connected in serial. Depending on the compensation output the common signal is Vss or Vss, do the voltage at tapping point is above or below the threshold voltage of the comparator input (~ 1.4V). The point is: the capacitors voltage is kept constant ( +- few mV) when balanced. So the current from the input and the current to the compensation pin are equal (in average). As those currents are proportional to the voltages applied, the resistor value determines the scaling of the input. If you increase the inpedance of the input network (say 100K->1M), you have to reduce the balancing cap from nF to .1nF. It's all about the relation of the components, not actual values. You onlay have to take into account, that higher impedance is more susceptible to noise, leakage current, and my reduce frequency response, all aspects of no relevance when measuring battery voltage.
  • This can also be done using an RCTIME function, with a capacitor to Vss and a high ohms resistor to the battery (+). Let's say 0.01µF and 3MΩ. The time constant is 30 milliseconds. To read it, make the pin low, let it discharge to near 0V, then make the pin an input and time how long it takes to reach the Propeller's nominal 1.65V threshold. That depends on the battery voltage, faster as the battery voltage is higher. Over the range of voltages expected from a 12V or 7.6V batttery, the relationship is pretty well approximated by MULTIPLIER / (time-to-threshold). The MULTIPLIER accounts for all the slop in the choice of capacitor, resistor, and Prop threshold, and when possible use stable components. The MULTIPLIER can be found by an initial calibration using a known voltage input.

    After the reading is taken, either leave the pin as an input, or make it a high output. That has the effect of channeling the leakage current (a few microamps) back to the power supply, so it helps to power your propeller and is not "wasted". The resistor has to be a high ohms value, because it should never supply more current than can be used by the circuit if for example it goes into a sleep mode, drawing only microamps.

    The RCTIME method works, but it is fussy due to the need for calibration, and the Prop threshold drifts a bit with temperature.
  • jmgjmg Posts: 15,173
    ...
    The RCTIME method works, but it is fussy due to the need for calibration, and the Prop threshold drifts a bit with temperature.

    Any ADC using Prop1 (Sigma-Delta or RC time) will need calibration, as they inherently have the Prop threshold as a variable.
    You can run a second channel, with a voltage reference (which can be a good regulator) to give run-time tracking and auto-calibrate action.
    When using this, Vref needs to be >> vth, and if you are using high value resistors, I'd suggest using the same parts for both feed values, for better tracking, and extract the zero correction in code.
    eg if we assume 1.65V vth, and 16.5V full scale ADC, a 12V reading is 69.69% and a 3v3 Vref gives 11.11%
  • Hi Tracy,

    You have presented the most simple and elegant solution to the problem which i was struggling with for years.
    Your father had taught you well. I am surprised you haven't won the Noble Prize yet.
  • Hi jmg,

    Your auto-calibrate scheme seems very interesting.
    Does it require a switching mechanism to connect the RCTime circuit to either the Vref or the Battery?
    As the RCTime charging curve is not a straight line ( linear ), wouldn't it be difficult extrapolate the voltage of a 8v battery based on a 3.3v reference?
  • jmgjmg Posts: 15,173
    Hi jmg,

    Your auto-calibrate scheme seems very interesting.
    Does it require a switching mechanism to connect the RCTime circuit to either the Vref or the Battery?
    That is not a requirement, but it is an alternative approach.
    Parts from the same tape/reel, as well as adjacent pins, tend to track, which is why I suggested that.
    If you want to eliminate tracking errors, then yes, you can use single divider parts, and switch the voltage.
    That is more parts and more cost.

    What precision do you actually need for this ?
    As the RCTime charging curve is not a straight line ( linear ), wouldn't it be difficult extrapolate the voltage of a 8v battery based on a 3.3v reference?

    'difficult' has many degrees :)

    The curve shape is known, so you can calculate any voltage.
    Sigma-Delta is charge balancing, so it is linear and needs no curve correction.

    The primary purpose of the Vref is to more accurately define the P1 pin thresholds.

    There are also some cases where you only want charge setpoints, not a human display, and for those you can use compile-time calculations.


Sign In or Register to comment.