Author Topic: measuring mAh consumption over two weeks?  (Read 8519 times)

0 Members and 2 Guests are viewing this topic.

Offline incfTopic starter

  • Frequent Contributor
  • **
  • Posts: 482
  • Country: us
  • ASCII > UTF8
measuring mAh consumption over two weeks?
« on: July 22, 2025, 11:53:46 pm »
I've got a battery powered product where measuring the average current consumption under normal operation would require a two week test cycle.

I've got a joulescope, and it is great and possibly could do it. But it would be really nice to have a piece of standalone equipment that could be put somewhere out of the way and run on its own undisturbed by people jostling cables, and undisturbed things like PC reboots or PC out of memory errors.

Does anyone have any recommendations about how to approach this?

We can easily measure and estimate what the mAh consumption should be piecemeal (in small short duration chunks), but calculations can be incorrect and real measurements often catch unexpected issues.
« Last Edit: July 23, 2025, 12:28:05 am by incf »
Test
 

Offline radiolistener

  • Super Contributor
  • ***
  • Posts: 5744
  • Country: Earth
Re: measuring mAh consumption over two weeks?
« Reply #1 on: July 23, 2025, 12:11:51 am »
To measure mAh accurately, you should connect the battery to the load through an ammeter and a voltmeter, and record their readings at fixed time intervals - such as every 60 seconds or every 3600 seconds - depending on the desired precision. Then, compile all these measurements into a table and integrate the current over time using a tool like Octave to calculate the total charge consumption. This approach provides a reliable, data-driven estimate beyond simple calculations.

It is important to maintain precise intervals between measurements or to record the exact timestamp of each measurement. This accuracy enables proper integration of the battery capacity over time and allows you to construct accurate battery discharge curves.
« Last Edit: July 23, 2025, 12:17:17 am by radiolistener »
 

Offline incfTopic starter

  • Frequent Contributor
  • **
  • Posts: 482
  • Country: us
  • ASCII > UTF8
Re: measuring mAh consumption over two weeks?
« Reply #2 on: July 23, 2025, 12:24:26 am »
One snag, it consumes power in 100 microsecond blips.

My bench meter only does an approximate and variable ~2.11 samples per second (probably less, and more variably, if logging over the network via script, which could be timestamped and post processed)

I feel like I'd need a large LC filter to get the bandwidth of the measurement well below 1Hz to make that sort of thing work.

sidenote: still interested in hearing peoples' opinions about standalone battery simulator test equipment
« Last Edit: July 23, 2025, 12:26:56 am by incf »
Test
 

Offline radiolistener

  • Super Contributor
  • ***
  • Posts: 5744
  • Country: Earth
Re: measuring mAh consumption over two weeks?
« Reply #3 on: July 23, 2025, 12:33:26 am »
If your device draws 100 µs current pulses, you ideally need to sample much faster than that, at least 10 samples per pulse, to capture the true consumption accurately. Alternatively, adding a low-pass filter to smooth out the current draw can allow you to measure the averaged consumption with standard, slower equipment, without directly capturing each pulse.

However, if your goal is to measure the actual battery capacity, it’s generally better to discharge it through a constant load with equivalent average power, rather than using the pulsed load directly. If you specifically want to characterize the device’s real consumption, then a different measurement approach is required, tailored to its pulsed operating mode.
« Last Edit: July 23, 2025, 12:35:54 am by radiolistener »
 

Offline incfTopic starter

  • Frequent Contributor
  • **
  • Posts: 482
  • Country: us
  • ASCII > UTF8
Re: measuring mAh consumption over two weeks?
« Reply #4 on: July 23, 2025, 12:42:09 am »
Hmm... low pass filtering to produce a sub 1-Hz bandwidth with a ESR of 10 ohms or less and a leakage current of 1uA or less looks expensive. Possibly more expensive than a battery simulator, or the time it would take to fiddle around with a dedicated PC setup with a USB connected joulescope or similar.
Test
 

Offline radiolistener

  • Super Contributor
  • ***
  • Posts: 5744
  • Country: Earth
Re: measuring mAh consumption over two weeks?
« Reply #5 on: July 23, 2025, 01:10:40 am »
You don’t necessarily need to filter all the way down to a 1 Hz bandwidth. A low-pass filter with a 20-30 Hz cutoff, combined with a 1000 Hz sampling rate, can still effectively smooth out the 100 µs current pulses and allow meaningful measurements - without requiring exotic components. At this sampling rate, it’s best to directly integrate the current over time for accurate results.

Just to clarify, is your main objective to characterize the device's actual power consumption profile, rather than measure battery capacity?
« Last Edit: July 23, 2025, 01:12:41 am by radiolistener »
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 17806
  • Country: fr
Re: measuring mAh consumption over two weeks?
« Reply #6 on: July 23, 2025, 01:18:37 am »
I don't know any fully standalone equipment that will do this properly. If you have a Joulescope and are happy with its performance, I would stick to that. Use a laptop on AC, its battery will cover occasional power cuts, place the whole thing in a segregated area, add a large sign saying "DO NOT TOUCH" with huge letters, and hope for the best.
 

Offline johansen

  • Super Contributor
  • ***
  • Posts: 1435
Re: measuring mAh consumption over two weeks?
« Reply #7 on: July 23, 2025, 01:59:21 am »
why not run it from a smaller battery that has a known milliamp hour capacity.
 

Offline incfTopic starter

  • Frequent Contributor
  • **
  • Posts: 482
  • Country: us
  • ASCII > UTF8
Re: measuring mAh consumption over two weeks?
« Reply #8 on: July 23, 2025, 02:06:10 am »
Just to clarify, is your main objective to characterize the device's actual power consumption profile, rather than measure battery capacity?

Yes.

why not run it from a smaller battery that has a known milliamp hour capacity.
I can't easily do that. Special battery, special chemistry. High ESR. Rare. (not really that special, but enough to be quite some effort to emulate without causing problems)
Needs to be 3.6V-ish, tolerate 100mA pulses sometimes lasting a second several times in a row, and have a capacity of something like 10mAh to expire in a reasonable time frame.

Edit: coin cell is interesting, but it looks like a ton of work to get an accurate measurement of capacity under pulse conditions. Capacity varies non-linearly with load, temperature, etc.
« Last Edit: July 23, 2025, 02:16:14 am by incf »
Test
 

Offline Doctorandus_P

  • Super Contributor
  • ***
  • Posts: 5368
  • Country: nl
Re: measuring mAh consumption over two weeks?
« Reply #9 on: July 23, 2025, 02:09:28 am »
One snag, it consumes power in 100 microsecond blips.

If you want to log those blips with a 1% accuracy, you would need a 1Msps acquisition rate. This can still be done with a uC, but you will need a fairly quick one for the math. You can use a diode as current sensor. It's not very accurate (you can improve that by either putting it in an oven, or adjusting for temperature drift). The advantage of a diode is that it can be used as a current sensor over a very wide current range, from 10's of nA to A.

The simplest way is to just use a small button cell that lasts about a week, and then time how long it takes to deplete it. You write you normally use some "special battery". But is it really needed to emulate that special battery? I assume that special battery is for an expected life of months or years, but for testing purposes a much smaller battery may be more suitable, and depleting it in a few days or a week may be an advantage.

Slightly more sophisticated is to use two coin cells, and a level detector that switches to the spare battery when the main battery is depleted.

Coin cells are cheap (20ct or so), so you can buy a batch, and drain a few to test for capacity and spread in capacity.

Another (but similar) option is to use a capacitor with a charging circuit. When the capacitor voltage gets below 3.2V you charge it up to 4.2V. (Suitable levels for Li-Ion) And then you simply keep track of the charge cycles for the capacitor.
« Last Edit: July 23, 2025, 02:13:01 am by Doctorandus_P »
 
The following users thanked this post: incf

Offline Doctorandus_P

  • Super Contributor
  • ***
  • Posts: 5368
  • Country: nl
Re: measuring mAh consumption over two weeks?
« Reply #10 on: July 23, 2025, 02:23:22 am »
Just to clarify, is your main objective to characterize the device's actual power consumption profile, rather than measure battery capacity?

Yes.

What is the difference? Power consumption is directly mapped to battery life expectancy. So of course it's not to measure "battery capacity", but you use a (any) battery of a known capacity, and can calculate average power consumption from when it's depleted.

Lithium coin cells are the easiest, but you can also use LIR. (I.e. "LIR2032" instead of "CR2032") The rechargeable cells have a smaller capacity, but you can test, retest and verify it. You also don't have to charge them fully, but put in a defined amount of mAh for testing. (But do compensate (test for) battery efficiency. But ( think) battery efficiency is mostly determined by changes in charge / discharge voltage, and not by the amount of electrons that move though the battery).

For a more complete measurement than the advise given here, you would effectively be building your own variant of the JouleScope. You can make it smaller if you have a smaller dynamic range, and it's not so difficult if you don't need much accuracy, but it would still be a fair amount of work to design the hardware and write the software.

For better advise, describe your product better.
What is the range of voltages and currents? (Coin cell, or grid battery?)
How big is it? how big can the test equipment be?

Another unknown is what you can use as the main power devise. Can your test equipment run from a separate power supply? (Mains, or a separate battery?)
« Last Edit: July 23, 2025, 02:25:35 am by Doctorandus_P »
 

Offline incfTopic starter

  • Frequent Contributor
  • **
  • Posts: 482
  • Country: us
  • ASCII > UTF8
Re: measuring mAh consumption over two weeks?
« Reply #11 on: July 23, 2025, 02:58:09 pm »
What is the difference?
If a battery can last 40 years, I can't wait 40 years to see if there is a firmware bug.

And other battery chemistries behave differently with respect to pulse loading. We probably have to measure current consumption, not time, to get a good idea of what to expect form it. I wish 10mAh batteries had good performance at 100mA.

Lithium coin cells are the easiest, but you can also use LIR. (I.e. "LIR2032" instead of "CR2032") The rechargeable cells have a smaller capacity, but you can test, retest and verify it. You also don't have to charge them fully, but put in a defined amount of mAh for testing. (But do compensate (test for) battery efficiency. But ( think) battery efficiency is mostly determined by changes in charge / discharge voltage, and not by the amount of electrons that move though the battery).

Those batteries do not characterize capacity under ~100mA 5 second and ~10mA 100 microsecond pulse conditions. It would not be accurate.

Please let me know if I am wrong. But we need something like +/-25% measurement accuracy or better. Can a coil cell do that?

For a more complete measurement than the advise given here, you would effectively be building your own variant of the JouleScope. You can make it smaller if you have a smaller dynamic range, and it's not so difficult if you don't need much accuracy, but it would still be a fair amount of work to design the hardware and write the software.
Definitely not doing that.

For better advise, describe your product better.
What is the range of voltages and currents? (Coin cell, or grid battery?)
How big is it? how big can the test equipment be?

Another unknown is what you can use as the main power devise. Can your test equipment run from a separate power supply? (Mains, or a separate battery?)
3.6V, 3uA normally up to to 100mA for several seconds at a time.
Small.
A bench power supply is fine to emulate a battery.
« Last Edit: July 23, 2025, 03:08:03 pm by incf »
Test
 

Offline voltsandjolts

  • Supporter
  • ****
  • Posts: 3815
  • Country: gb
Re: measuring mAh consumption over two weeks?
« Reply #12 on: July 23, 2025, 03:44:21 pm »
What is the difference?
If a battery can last 40 years, I can't wait 40 years to see if there is a firmware bug.


Extrapolating from two weeks to forty years is a fool's errand, even if you are aware of self discharge, pulse loading effects, passivation, electromigration, dendrites, internal pressure changes...
 

Offline incfTopic starter

  • Frequent Contributor
  • **
  • Posts: 482
  • Country: us
  • ASCII > UTF8
Re: measuring mAh consumption over two weeks?
« Reply #13 on: July 23, 2025, 05:06:35 pm »
That is why the thread is about measuring mAh, not time.

We don't care about time, we care about total quantity of charge consumed.

Proxy measurements using time are of little use if they cannot be made to accurately correspond to a given quantity of charge.
Test
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 19222
  • Country: us
  • DavidH
Re: measuring mAh consumption over two weeks?
« Reply #14 on: July 23, 2025, 05:46:17 pm »
I've got a joulescope, and it is great and possibly could do it. But it would be really nice to have a piece of standalone equipment that could be put somewhere out of the way and run on its own undisturbed by people jostling cables, and undisturbed things like PC reboots or PC out of memory errors.

The Joulescope connected to an independent PC tucked out of the way and on a battery backup will be the easiest thing to do.  If a Windows PC, then I would disconnect the network to prevent unintended updates which reboot it.  A spare laptop might be ideal.

Quote
Does anyone have any recommendations about how to approach this?

A sample every 50 microseconds for 2 weeks is about 24 gigasamples, so possible but not really practical.  That means doing what the Joulescope does and making short integrated measurements.  The circuit to do this is not difficult, and could be combined with a DSO or counter, but this is just duplicating what a Joulescope does.

I do no have anything like a Joulescope, but have made that type of measurement like I described.  I integrated the signal into a custom but simple charge balancing circuit which then produced a pulse measured by a universal counter set to totalize mode.  Calibrate it to measure nanoamp-hours or whatever.  I guess the output from the counter could be logged by a PC to get some idea of what is going on over 2 weeks.

With some care, accuracy could be 1% or better.  Instead of integrating the output from a current measurement, use the charge balancing circuit to directly deliver charge to the load and count the charges.  This reduces errors to charge injection and leakage, which can be on the order of picoamps, yielding dynamic range and resolution of 12 digits.
« Last Edit: July 23, 2025, 05:52:32 pm by David Hess »
 

Offline radiolistener

  • Super Contributor
  • ***
  • Posts: 5744
  • Country: Earth
Re: measuring mAh consumption over two weeks?
« Reply #15 on: July 23, 2025, 09:20:47 pm »
A sample every 50 microseconds for 2 weeks is about 24 gigasamples, so possible but not really practical.

You don't necessarily need to store all high-rate measurement samples. Instead, you can integrate the energy consumption in real time and periodically log intermediate results for plotting or tracking trends. This significantly reduces data volume while still providing accurate long-term insights.
 

Offline cunningfellow

  • Regular Contributor
  • *
  • Posts: 182
  • Country: au
Re: measuring mAh consumption over two weeks?
« Reply #16 on: July 23, 2025, 10:24:17 pm »
Do you really need to measure current accurately for 2 weeks?

Does each type of "event" have a fairly fixed power consumption?  If it does I would just accurately record the consumption of each type of "event" and then log how many of each type of event happens in your 2 week test period.

The changes you make to the firmware to log the event types/times will increase the power consumption over the two week period - but you don't care about that as you already recorded accurate power for each event before hand.
 

Offline mtwieg

  • Super Contributor
  • ***
  • Posts: 1811
  • Country: us
Re: measuring mAh consumption over two weeks?
« Reply #17 on: July 23, 2025, 11:00:09 pm »
A sample every 50 microseconds for 2 weeks is about 24 gigasamples, so possible but not really practical.

You don't necessarily need to store all high-rate measurement samples. Instead, you can integrate the energy consumption in real time and periodically log intermediate results for plotting or tracking trends. This significantly reduces data volume while still providing accurate long-term insights.
Yeah, this sounds like something one could whip together with an arduino and serial port without much trouble...

You might look at specialized coulomb counter chips like the LTC2944. Its measurement is based on a true analog integrator, so it should be able to accurately meter charge even in very fast pulses. The arduino would then read it via I2C and print to serial.
 

Online Siwastaja

  • Super Contributor
  • ***
  • Posts: 11275
  • Country: fi
Re: measuring mAh consumption over two weeks?
« Reply #18 on: July 24, 2025, 06:19:41 am »
undisturbed things like PC reboots or PC out of memory errors.

This part is trivial: just don't use Windows.

Of course a full-blown PC is still not the most efficient solution (energy or unit cost or size wise) but the advantage of general purpose computer is the low setup cost (in time spent), you probably have some lying around already and can use scripting languages, keyboards, displays, networking, ssh, whatever, with minimum time invested. Nothing beats that convenience for one-off custom monitoring/logging needs.
 

Online MariuszD

  • Frequent Contributor
  • **
  • Posts: 703
  • Country: pl
Re: measuring mAh consumption over two weeks?
« Reply #19 on: July 24, 2025, 07:35:21 am »
My bench meter only does an approximate and variable ~2.11 samples per second (probably less, and more variably, if logging over the network via script, which could be timestamped and post processed)

I feel like I'd need a large LC filter to get the bandwidth of the measurement well below 1Hz to make that sort of thing work.
You can make an RC filter <0.1Hz using resistors in the megaohm range and film capacitors with a capacitance of a few µF.

You can use several RC circuits to increase the attenuation of higher frequencies.
 

Offline tszaboo

  • Super Contributor
  • ***
  • Posts: 9835
  • Country: nl
  • Current job: ATEX product design
Re: measuring mAh consumption over two weeks?
« Reply #20 on: July 24, 2025, 08:08:49 am »
A sample every 50 microseconds for 2 weeks is about 24 gigasamples, so possible but not really practical.

You don't necessarily need to store all high-rate measurement samples. Instead, you can integrate the energy consumption in real time and periodically log intermediate results for plotting or tracking trends. This significantly reduces data volume while still providing accurate long-term insights.
Yeah, this sounds like something one could whip together with an arduino and serial port without much trouble...

You might look at specialized coulomb counter chips like the LTC2944. Its measurement is based on a true analog integrator, so it should be able to accurately meter charge even in very fast pulses. The arduino would then read it via I2C and print to serial.
It's incredibly not trivial to measure power consumption on a device like this. Your measuring device needs to cover 7 orders of magnitude, and do that with range switching without UVLO to the DUT.
My bench meter only does an approximate and variable ~2.11 samples per second (probably less, and more variably, if logging over the network via script, which could be timestamped and post processed)

I feel like I'd need a large LC filter to get the bandwidth of the measurement well below 1Hz to make that sort of thing work.
You can make an RC filter <0.1Hz using resistors in the megaohm range and film capacitors with a capacitance of a few µF.

You can use several RC circuits to increase the attenuation of higher frequencies.
This resets the device when that 100mA pulse happens.

3.6V, 3uA normally up to to 100mA for several seconds at a time.
Small.
A bench power supply is fine to emulate a battery.
I can appreciate this issue, as I often have to do similar lifetime estimations. There are 2-3 tools that we have in the office to do these kind of things.
DMM6500 multimeter: Has fast 1MSPS sampling to capture peak current and accurate enough for sleep current. But not really suitable for this IMHO.

Nordic PPK power profiler kit: Low cost device to measure these RF sensors. Unfortunately it's not very reliable, I found it often times to measure the current incorrectly, depending on what the DUT does. Since the FW guys love this thing it's very frustrating when it does that, leading to endless discussions for days, writing reports and so on. I don't think this can do measurements for weeks out of the box. Though it comes with a python library so maybe you can make some software for it to do that measurement and filter/decimate/average the data to manageable amount.

Keithley 2280S: This is a precision power supply. It has a resolution of 0.1uA in it's 100mA range, and accuracy of maybe 3-4uA. I use it in trend plotting mode, and use the statistics to get an average current. It's a Keithley so it's almost good, but disappointing. When you are in statistics, it won't show you the number of points used for the statistics, or elapsed time. Also a 3000 EUR power supply with math functions somehow cannot calculate power. I don't think the statistics in this will go for weeks, you probably have to program it through SCPI and write your own code to calculate the average.

I almost bought the Julescope, but honestly after buying several PPKs I don't think I want to have yet another disappointing USB gadget.
 

Online RoGeorge

  • Super Contributor
  • ***
  • Posts: 8497
  • Country: ro
Re: measuring mAh consumption over two weeks?
« Reply #21 on: July 24, 2025, 08:26:02 am »
Power the device from a small battery of a known capacity, or from a supercap, then write down the date/time when the device has stopped working.

This way, you don't need to measure the energy at all, only measure the total time the battery lasted.  :)

After all, that's the most important thing to know, how long it takes until the battery gets exhausted.  Then, by knowing the initial battery capacity and the running time, you can calculate the average current, too, if needed.

Offline tszaboo

  • Super Contributor
  • ***
  • Posts: 9835
  • Country: nl
  • Current job: ATEX product design
Re: measuring mAh consumption over two weeks?
« Reply #22 on: July 24, 2025, 08:40:10 am »
Power the device from a small battery of a known capacity, or from a supercap, then write down the date/time when the device has stopped working.

This way, you don't need to measure the energy at all, only measure the total time the battery lasted.  :)

After all, that's the most important thing to know, how long it takes until the battery gets exhausted.  Then, by knowing the initial battery capacity and the running time, you can calculate the average current, too, if needed.
The ESR of such battery is going to be so different that your measurement is completely wrong.
Even if you would use a battery that is 1/100th of the capacity of the original (if it exists) then your measurement would take ~ half a year. The expected battery life is 40 years.
 

Online RoGeorge

  • Super Contributor
  • ***
  • Posts: 8497
  • Country: ro
Re: measuring mAh consumption over two weeks?
« Reply #23 on: July 24, 2025, 09:38:56 am »
It doesn't say 40 years in the OP, but if that's the time range, then the Iavg becomes irrelevant.  ;D
Unless maybe, you install the device on a satellite or something, but anyway.

If I were to try to measure such a small quantity, then I'll probably do the other way around, by powering the device from a low leakage capacitor (a small enough one), and adding just the right amount of current into the capacitor (through a big series resistor and a constant voltage power supply).  Then lower the current (increase the series resistor) until the device stops working in a day or so.

The idea is to 'starve' the device until the added energy through the series resistor become less than the energy needed by the device.  The capacitor is to average the voltage.



Aside from that, I think the idea of improvising while doing such a delicate measurement (instead of just using the instrument that is already there) should be reconsidered.  The point of spending money on lab instruments is exactly for situations like this, so to be able to measure reliably, and also to spare the time of trying (and failing) with all kind of improvisations.

I'll use the existing lab instrument.

Online GigaJoe

  • Frequent Contributor
  • **
  • Posts: 815
  • Country: ca
Re: measuring mAh consumption over two weeks?
« Reply #24 on: July 24, 2025, 09:58:44 pm »
are we talking to use PC integrated sound card , and some basic circuit to make fit it for measurement ??  some has 96k sampling , and 2 channels ...
software definitely exist

oops ..  i forgot about input caps
« Last Edit: July 24, 2025, 10:03:53 pm by GigaJoe »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

-->