Pages: [1]   Go Down
Author Topic: Measuring battery charge  (Read 1519 times)
0 Members and 1 Guest are viewing this topic.
Chile
Offline Offline
Sr. Member
****
Karma: 0
Posts: 260
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Logged

SW Scotland
Offline Offline
Edison Member
*
Karma: 17
Posts: 1391
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Chile
Offline Offline
Sr. Member
****
Karma: 0
Posts: 260
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 217
Posts: 13742
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley-wink  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.

Logged

Rob Tillaart

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

Chile
Offline Offline
Sr. Member
****
Karma: 0
Posts: 260
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Edison Member
*
Karma: 3
Posts: 1001
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Chile
Offline Offline
Sr. Member
****
Karma: 0
Posts: 260
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: December 07, 2011, 10:13:08 am by pgmartin » Logged

SG
Online Online
God Member
*****
Karma: 11
Posts: 522
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Your circuit will put 12V to input A0 it will kill the MCU.
It have to be connect in this way.


* SLA-Voltage-mesu.jpg (10.4 KB, 517x304 - viewed 167 times.)
« Last Edit: December 07, 2011, 10:04:01 am by BillHo » Logged

Chile
Offline Offline
Sr. Member
****
Karma: 0
Posts: 260
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

0
Offline Offline
Shannon Member
****
Karma: 207
Posts: 12205
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

[ I won't respond to messages, use the forum please ]

Chile
Offline Offline
Sr. Member
****
Karma: 0
Posts: 260
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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

Pages: [1]   Go Up
Jump to: