What is the correct way to calculate system average current to find battery lifetime

I need to calculate the battery lifetime of a system.

Usually I measure the average current and duration of each of the system's individual actions and from there calculate an average current projecting all the different actions to a 1 hour period. Afterwards, sum all the individual averages to get the system's average and then divide the battery capacity (in mAh) by the obtained average current to get the number of hours.

Formula: ((Duration * Current)/3600) * Frequency

For example, if 1 action takes 30 seconds with an average current of 44000uA and this happens 1 every 12 hours, the calculation would be: (30*44000/3600) *(1/12).

Example scenario:

Action Duration (s) Average current (uA) Frequency Average current projected to 1 hour (uA)
Idle - 30 - 30
1 30 44000 1 every 12 hours 30.56
2 1.75 200 360 1 hour 35
3 2 3700 1 per hour 2.06
4 1.3 5000 1 per hour 1.81
5 11 40000 1 every 12 hours 10.19

The average current in 1 hour by adding all the different actions is 114.38uA

This time, I decided to let the system run for 24 hours and use the markers from the measuring software to get the average and from there go back to the calculation.

The average current of the 24 hour run was 98uA which is close to the 114uA considering the fact that some actions won't always take the same time.

Before looking at the results from the 24 hour measurement, I thought I would have to divide the 24 hour average by 24 to obtain the hourly average but that doesn't seem right based on the results from the other calculation.

My question is, why is this daily average "equal" to the hour average I calculated before, is it because 24 hours corresponds to 2 cycles for the largest action, so it "spreads" evenly?

• Tip: you need to put a blank line before and after your Markdown table for it to render correctly. I fixed it. Commented Dec 29, 2021 at 16:21
• I think the sticking point is that current is already a "rate" so you are doing an average of additive rates over a time period, a form of weighted average. This will work if you work through the algebra . Another way is to convert all currents to charge (coulombs) . Do this by multiplying the duration column by the average current. Then you multiply times the number of occurrence in the period you wish to average (e.g. 24hours). For each row you will get a charge quantity which are summed. The final result is converted back to current by dividing this total charge by the time period. Commented Dec 29, 2021 at 16:22
• Does this answer your question? How to calculate battery life Commented Dec 29, 2021 at 17:55

The average current for 24 hours should be the same as the average current for one hour.

If you drive a stop-start pattern for an hour you might travel 30 km. Your average speed for the hour will then be 30 kph. If you repeat that pattern for 24 hours you will have traveled 30 × 24 = 720 km but your average speed will still be 30 kph.

• If on every 10th hour you fall asleep and slam the accelerator to the floor for 10 minutes, is the meaning of hourly average even well defined? Commented Dec 29, 2021 at 16:32
• Both answer and comment are getting to what I am asking, I understand the principle of what @Transistor is describing, but in my case, if instead of taking a 24 hour sample I take a 6 hour sample, the average current will be different, so what I'm trying to figure out is what is the correct time lapse I need to sample to get the correct value. I guess it should be 12 hour multiples as this includes all the events, being 24 hours better since it has more data points. Commented Jan 4, 2022 at 8:19
• Yes, for any periodic "waveform" you would need to average over an integer number of cycles (multiples of 12 hours in your case) or enough cycles that the error of a partial cycle is not significant enough to cause a problem. e.g. 27 days and 3 hours would give an error of 3 / (27 * 24). Commented Jan 4, 2022 at 8:45

Well, the average of a function is given by:

$$\overline{\text{f}}:=\lim_{\text{n}\to\infty}\frac{1}{\text{n}}\int_0^\text{n}\text{f}\left(t\right)\space\text{d}t\tag1$$

So, for your case we get:

$$\overline{\text{i}}=\frac{1}{86400}\int_0^{86400}\text{i}\left(t\right)\space\text{d}t\tag2$$

Where $$\86400\space\text{seconds}=24\space\text{hours}\cdot60\space\text{minutes}\cdot60\space\text{seconds}\$$.

Now, in order to find the integral we use:

• Situation 1: $$2\cdot30\cdot44000\cdot10^{-6}=\frac{66}{25}\tag3$$
• Situation 2: $$360\cdot24\cdot\frac{7}{4}\cdot200\cdot10^{-6}=\frac{378}{125}\tag4$$
• Situation 3: $$24\cdot2\cdot3700\cdot10^{-6}=\frac{111}{625}\tag5$$
• Situation 4: $$24\cdot\frac{13}{10}\cdot5000\cdot10^{-6}=\frac{39}{250}\tag6$$
• Situation 5: $$2\cdot11\cdot40000\cdot10^{-6}=\frac{22}{25}\tag7$$
• Total time of all situations: $$\text{T}_\text{situations}=\frac{76406}{5}\tag8$$

So:

$$\text{T}_{30\space\mu\text{A}}=86400-\text{T}_\text{situations}=86400-\frac{76406}{5}=\frac{355594}{5}\tag9$$

So, we get:

$$\overline{\text{i}}=\frac{1}{86400}\cdot\left(\frac{66}{25}+\frac{378}{125}+\frac{111}{625}+\frac{39}{250}+\frac{22}{25}+\frac{355594}{5}\cdot30\cdot10^{-6}\right)=$$ $$\frac{2252791}{21600000000}\approx0.000104295879\space\text{A}\tag{10}$$

So, the average current is:

$$\overline{\text{i}}_{\space\left[\mu\text{A}\right]}=\frac{2252791}{21600000000}\cdot10^6=\frac{2252791}{21600}\approx104.295879\space\mu\text{A}\tag{11}$$

• The question is "My question is, why is this daily average "equal" to the hour average I calculated before?" Commented Dec 29, 2021 at 19:56
• ... but lovely MathJAX. Commented Dec 29, 2021 at 20:29
• Thanks, this should be similar to my table calculations, your being more precise, but what I'm trying to figure out is with Mr.Robot @ElliotAlderson mentions. Commented Jan 4, 2022 at 8:10