Go Down

### Topic: Measuring battery charge (Read 2539 times)previous topic - next topic

#### pgmartin

##### Dec 06, 2011, 07:48 pm
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

#1
##### Dec 06, 2011, 08:00 pm
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

#2
##### Dec 06, 2011, 08:04 pm
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

#3
##### Dec 06, 2011, 08:09 pm
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

#4
##### Dec 06, 2011, 09:23 pm
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

#5
##### Dec 06, 2011, 09:30 pm

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 pmLast 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 pmLast 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

#8
##### Dec 07, 2011, 04:24 pm
Thanks billHo, I corrected my design too, to avoid leaving arduino killing circuits posted

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

#9
##### Dec 08, 2011, 02:12 pm
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 will NOT respond to personal messages, I WILL delete them, use the forum please ]

#### pgmartin

#10
##### Dec 12, 2011, 01:14 pm
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

Please enter a valid email to subscribe