## Calculating Watt & Watt-hour consumed from battery

5 posts / 0 new
Author
Message

1. I have a data logger for 48V battery which takes reading every 1 second of voltage & current & store it in a file.

2. Reading is something like this:

a) 47.4V, 50A

b) 47.3V, 49.4A

..

..

and so on until battery discharges completely in one hour.

3. How to calculate Watt & Watt hour consumed from it over hour

Normally if voltage is same, I calculate by difference of current between two  multiply by voltage.

But in this case voltage is also reducing(during discharge) & going up during charge.

How to do the calculations of Watt & Watt/hour in it, should I take average of voltage over period of time & multiply by current difference?

This topic has a solution.

Last Edited: Tue. Feb 6, 2018 - 02:44 AM

I'm just going to talk about discharge first.  It seems that you want to know the watt hours expended during a discharge cycle.

It seems to me that your intervals are short enough that you could just take the average volts and amps and multiply them tor the 1 second bit of the data.

from your numbers 47.35V x 49.7 amps = about 2353.3 W-seconds. Add all of the 1 second values up and divide by 3600 to get the watt hours expended in the discharge cycle.

You could do the same thing for a charge cycle. If you're going to do both charge and discharge over the time interval in question, it would be fairly complicated to calculate. You would have to be sure just when things switched between charge and discharge.

hj

This reply has been marked as the solution.

Trapezoid rule.

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

Volt * Amp = Power = Watt.

Watt * second  = Joule = Energy.

You can of course easily detmine the power at a given time by measuring the voltage and current and multiplying them.

a). 47.4V * 50.0A =  2370.0W

b). 47.3V * 49.4A =  2336.6W

c). 47.1V * 49.3A = 2322.0W

n). ...

The way to measure wat hours is to make use of a "Joule Counter" register.

1 Watt during 1second is 1 Joule.

So if we assume you measure both voltage and current EXACTLY once a second then your batterery delivers 2370Joule in the first second 2336.6 Joule in the second second, 2322 Joule in the 3rd second etc. So add these numbers for a totat Joule count. 2370 + 2336.6 + 2322 = 7028.6 Joule in the first 3 seconds. (This is called integration).

If you have combinations of partial charges / discharges you want a bi-direcational current measurement.

If the current flows into your battery you add the number to your Joulecount, and if you are taking current out of your battery the current will be negative and adding these "negative" joules to your Joulecount will decrease the amount of Joules left in your battery.

(Normally this is turned around. A "full" battery is interpreded as "0" and the amount of Joules delivered to the load is interpreted as a positive number).

It does not matter much which you choose, just pick a convention and stick with it.

Your uC is however fast enough to sample both current and voltage at 100Hz, 1kHz or even faster if needed. (But even sampling @ 10Hz is probably plenty).

If you sampled at 100Hz for example, the first measurements would still have the same powers a + b + c, but each power level represents only 1/100th of the energy.

2370.0W during 1/100s = 23.7 Joule.

Because your uC can easily sample at such sample rates there is no need for Trapezoidal rules or other interpolation techniques.

To make it easier for the uC  you can work with direct ADC samples and use a conversion factor for displaying your results.

The Joule count number will get large very fast, so you have to use Long ints, floats, and or use a scale factor to prevent overflow.

There is also a long standing discussion about what to integrate. Do you want to integrate the Amps (and create amp * hous or amp *seconds in the accumulator) or do you want to integrate Joules in the accumulator.

Keeping track of the Joule count is the more "intuitive" way, you are of course interested in the amount of energy your battery contains.

If you take the battery chemistry as a base rule however it seems more logical to count the Amp hours.

Amps = current flow = Amount of electrons / second.

The amount of energy you can get out of a battery charge depends on the current (losses over internal resistance) and temperature.

The amount of electrons you can get out of a battary charge depends more on the battery chemistry and is probably a more constant number when load or temperature changes.

Because amp hous is more losely related to the battery chemsitry it is ( I think) a better representation for the quality of the battery while it wears over time.

I'm no battery expert, so It's a bit of gueswork here, but it seems very logical to me.

For real numbers you have to dive a bit into the chemistry of the battery you use.

Hint:

Battery level measurements are a very common practice and there are probably 100's or more people who have tread this path before you.

github is often a good place to look for source code examples.

Paul van der Hoeven.
Bunch of old projects with AVR's:
http://www.hoevendesign.com

Last Edited: Sun. Feb 4, 2018 - 11:51 AM