# Amp-Hour Meter for Solar Batteries

Discussion in 'Electronic Design' started by Marky, Dec 16, 2007.

1. ### MarkyGuest

Hi All,
I am designing an Amp-Hour meter to log the current going into my
solar batteries, which is charged by a PWM regulator. The regulator is
pulsed at 100- 150hz. In my design I am using a shunt resistor to
measure the current and a micro calculate and display the Amp-hour
value. I need the current reading to be =<1% accurate, so what sample
frequency I need to set the adc to get this result? How many adc bits
I need ? Do I need to convert the sample voltage to rms voltage (e.g
V* ((duty cycle)^-2)) to calculate the Amp -hour?

Parameters
Max charge current = 20Amp
Shunt Resistor 0.005Ohm
signal conditioning = op-amp with gain of 20

Thanks

marcus

2. ### Martin RiddleGuest

<1% ?

Most all meters, scopes are 2% so forget about even a 1% accuracy.

Cheers

3. ### MooseFETGuest

You are using this on DC I asssume.

20 * 0.005 = 0.1V

You need a low offset voltage op-amp to amplify this up to a better
voltage for the ADC's input. Since this is DC, you don't need much
bandwidth. If you want the most accurate results you can get, look at
chopper stablized op-amps.

Next you need to limit the band width of what you put into the ADC to
be much less than 1/2 the rate the ADC is sampling at. Again since
this is DC, you don't need to provide much bandwidth. The cut off
frequency of the filter will be set by how large of capacitors and
resistors are practical. You want to use either plastic or NPO/COG
capacitors.

Once you have figured out the filter's bandwidth, multiply that by,
lets say, 10 and you have the minimum sample rate.

Chances are you will want to use a 12 bit ADC. The accuracy you need
comes from its offset voltage and its linearity not simply from the
number of bits.

Assuming you have a micro reading the ADC, you can further improve the
filters out most of the AC hum you may have picked up.

4. ### Martin GriffithGuest

something like this maybe?
http://focus.ti.com/docs/prod/folders/print/bq2013h.html

martin

5. ### Jeff LiebermannGuest

If you want to buy one instead of designing one from scratch, see:
Why such accuracy?
Well 1% is 100 "samples" over the range. Good form is to have +/- 1
LSB accuracy, so that's 200 "samples". 256 bits is 8 bits of
resolution.

The 100-150Hz will result in some calculation problems, so it's
probably best to just integrate the detected current across your shunt
with a big cazapitor, and deal with slow changing DC instead of
rapidly pulsing DC.
Full scale voltage = 20A * 0.005 ohms = 0.1V
A gain of 20 will give you 0 to 2 volts to feed to the A/D.
No clue what you're using for an A/D converter but whatever you select
will need to work with a 0 to 2V input range.

6. ### MarkyGuest

No reason, I thought it was a good starting point.

I will give this a try.
Interesting, I will order a freebie sample from TI to play with.

I have plenty of 10k and 200K resistors in my tool box.

Thanks guys, your help is appreciated!!