Go Down

Topic: Measuring battery charge (Read 1 time) previous topic - next topic

pgmartin

I have an Arduino based project that will be powered from a 12V SLA battery. One of the features of the project is to show the battery charge status. Assuming that this batteries have an output voltage between 10 and 14V (below is not important, because the battery is dead), I was wandering which alternatives i have to measure the charge as accurate as possible using the Arduino ADC and some analog components.

The first and obvious answer is to use a voltage divider....but, that would leave me with a lot of the reference scope unused. For Example: If i divide the voltage by 3, I'll only be interested in the upper 1 voltage (say between 4 and 5), not using almost 80% of the ADC resolution.

Doing some wikipedia research I came to the differential amplifier, so I thought that mabe using one of this circuits with an OpAmp (powered with 5V) and a Zener diode to compare, giving a reference voltage of 10V.
http://en.wikipedia.org/wiki/File:Op-Amp_Differential_Amplifier.svg


In my beginners mind this sounds like a much better solution, because I could have an input between (ideally) 0 and 5V that represent usable range of the battery. But I would like some experienced advice on this type of solution. What kind of problems may I face with such a solution?
Regards


jackrae

Your first problem is that terminal voltage on an SLA is not a direct indication of state of charge.  One possible concept might be to get a set of state-of-charge vs voltage curves or voltage vs time curves (at constant current) and create a look-up table whereby voltage refers to state of charge.

pgmartin

Quote
Your first problem is that terminal voltage on an SLA is not a direct indication of state of charge.


Thanks you for this info! I wasn't even aware of this problem.

robtillaart

Quote
The first and obvious answer is to use a voltage divider....but, that would leave me with a lot of the reference scope unused. For Example: If i divide the voltage by 3, I'll only be interested in the upper 1 voltage (say between 4 and 5), not using almost 80% of the ADC resolution.


that still means about 200 steps for 4 volt = 0.02V steps (OK with some noise 0.05 or 0.1V accurate) which is not bad. How must accuracy do you want ?

Furthermore you have the very strong assumption that the minimum voltage level will never be below 10V, and if I have learned something it is that assumptions cannot be trusted ;)  So to be robust the voltage divider is not so bad at all imho.

Main drawback of the voltage divider is that it does not protect against unexpected high voltages > 14 V.

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

pgmartin

Quote
Main drawback of the voltage divider is that it does not protect against unexpected high voltages > 14 V.

Right, and the solution I know is using a zener diode to limit the voltage, but it has his drawbacks too.

BenF


The first and obvious answer is to use a voltage divider....but, that would leave me with a lot of the reference scope unused. For Example: If i divide the voltage by 3, I'll only be interested in the upper 1 voltage (say between 4 and 5), not using almost 80% of the ADC resolution.

A simple and also effective solution is to use two ~5V zeners in series to drop voltage from 10-15V into the 0-5V range. 5V zeners are close to temperature neutral and when calibrated, will give you a very accurate reading at full ADC resolution. You will also need a resistor to ground in series with the zener's to match the required zener current (check datasheet).

Downside to this approach is that the zener current will drain your battery when connected. A solution to this is to connect the zener ground path to a digital input pin and only switch this to output/low when measuring and keep it high impedance (mode input) otherwise.

pgmartin

#6
Dec 07, 2011, 02:15 pm Last Edit: Dec 07, 2011, 04:13 pm by pgmartin Reason: 1
Quote
A simple and also effective solution is to use two ~5V zeners in series to drop voltage from 10-15V into the 0-5V range. 5V zeners are close to temperature neutral and when calibrated, will give you a very accurate reading at full ADC resolution. You will also need a resistor to ground in series with the zener's to match the required zener current (check datasheet).


Interesting concept, never thought of using zeners in series. You mean something like this:



Edit: Corrected image.

BillHo

#7
Dec 07, 2011, 03:52 pm Last Edit: Dec 07, 2011, 04:04 pm by BillHo Reason: 1
Your circuit will put 12V to input A0 it will kill the MCU.
It have to be connect in this way.

pgmartin

Thanks billHo, I corrected my design too, to avoid leaving arduino killing circuits posted  :smiley-mr-green:

I'm not certain how should I size the resistor adecuatedly.

My guess was:

  • Zeners need al least 1mA for reverse breakdown, so I need 2mA for the 2 Zeners in zeries

  • the input voltage from the battery is something between 10 and 15V

  • 10/0.002 = 5000 - So using a 4.7K resistor will provide enough current.



Is that right?

MarkT

Zener's don't have a very sharp cutoff at low currents(*), another way to protect is to use a schottky diode to the +5V line, thus preventing the pin going higher than about 5.3V.  Schottky diodes have a lower forward voltage than the protection diodes in the MCU and external schottky diodes can handle a lot more current than the protection diodes (which are meant to protect against static discharge).


(*) this could cause inaccuracy in the voltage divider when close to 5V at the analog input.
[ I won't respond to messages, use the forum please ]

pgmartin

Quote
another way to protect is to use a schottky diode to the +5V line


Meaning that: anode to input, cathode to +5V, right?

Go Up