Current logger for battery systems

Started by perky, October 08, 2016, 02:42:17 PM

perky

Does anyone know of a low cost piece of test equipment that can log or give an indication of average current consumption for battery operated equipment? I'd like to measure the current of my radio system and average it over a long period of time (maybe a week), so it would need to read uA and mA current and log it dynamically down to ms resolutions.
Mark.

WhiteHare

#1
A few ideas, but it depends on what resolution uA you need. 

1.  Maybe try an ADC in combination with Dave Jone's Microcurrent instrument?  If it were me, I'd opt for this.

2.  Alternatively, there may (?) be a newer version of the INA219 that you could leverage.  I found the INA219 to be good for capturing milliamps, and it seemed reasonably accurate.  Also, the INA219 is readily available on breakout boards for connection to arduino (and adafruit has a library for it).  IIRC, it may only be good down to 800uA resolution though.  But if there's something newer, it might have better resolution than that.  I don't recollect the refresh rate, but I suspect it may be longer than 1ms.

3.  Maybe simply a high resolution ADC in combination with a sense resistor?  Noise will be your enemy, but maybe there's a way to filter that.

4.  If you had a big enough capacitor, you could charage it up and run off that to count coulombs.  You'd need to then subtract the charge that would have been lost due to leakage.  One of the other forum members here (Emjay) once suggested that method.  This would allow you to derive the average current consumption that you're apparently interested in.

perky

Thanks. I'm edging toward coulomb counters (e.g. something like SiLabs TS1108) if they have the resolution. My controller takes about 5uA when asleep and the radio 45mA when transmitting, but there are also a couple of boost regulators which are turned on and off when needed. Ideal would be an off the shelf piece of test gear (or eval board).

WhiteHare

#3
Yeah, unfortunately, out of the box the Dave Jones Microcurrent would have trouble handling that wide a range.    You could set it to uA *or* to mA, but it can't span both by itself. 

Please do let us know what you come up with, because I'm sure it's something most of us would want to do also.

perky

This thread on the EEVBlog forum has some interesting stuff, especially the EFM32 Zero Gecko Starter Kit circuit. They use the LTC6102 zero drift precision current monitor and two precision opamps on its output to give a wide output range. It should be relatively easy to use an MCU measuring those voltages and integrating over time to provide a coulomb counter. Pity I've no time to do it but would make a useful piece of test gear.

http://www.eevblog.com/forum/testgear/measuring-current-on-a-low-power-iot-device/

WhiteHare

#5
One of the yzxstudio usb mah meter devices leverages a chip that's impressive that you could possibly use.  One of Julien Illett's youtube videos (possibly this one:
  https://www.youtube.com/watch?v=jYfzGoLxR4M

or if not, then one of his other ones) goes over it. I don't remember if it matches your requirements, but it's possibly worth a look.

perky

They're designed for USB so not accurate enough I think, the resolution is pretty poor and we need measurement down microamp levels.

Here's a Sparkfun coulomb counter based on a LTC4150, they have used a 50mR sense resistor so it gives a pulse on INT# every 170.7uAh for a max current of 1A. No reason I can see not to increase the sense resistance to say 0.25R, that would allow 200mA max current with a pulse every 34.1uAh. You'd need to measure the time between them to measure average current, just divide 34.1 by the time in hours between the pulses to give average current in uA.

https://learn.sparkfun.com/tutorials/ltc4150-coulomb-counter-hookup-guide

Mark.

WhiteHare

Quote from: perky on October 08, 2016, 06:41:31 PM
They're designed for USB so not accurate enough I think, the resolution is pretty poor and we need measurement down microamp levels.

Here's a Sparkfun coulomb counter based on a LTC4150, they have used a 50mR sense resistor so it gives a pulse on INT# every 170.7uAh for a max current of 1A. No reason I can see not to increase the sense resistance to say 0.25R, that would allow 200mA max current with a pulse every 34.1uAh. You'd need to measure the time between them to measure average current, just divide 34.1 by the time in hours between the pulses to give average current in uA.

https://learn.sparkfun.com/tutorials/ltc4150-coulomb-counter-hookup-guide

Mark.

I seem to recall that the sparkfun coulomb counter was done in a weird way.  Namely, it counts the coulombs that are used to power the instrument in addition to the current under test.  If that instrument current is constant (don't know if it is), then maybe that's easy to subtract out.  If not, then it might pollute the accuracy of what you're after.  Anyhow, perhaps worth looking into before you order one.

perky

#8
Mmm. Here's the schematic:
https://cdn.sparkfun.com/datasheets/BreakoutBoards/LTC4150_BOB_v10.pdf

As you can see, it's bidirectional. So if you connected the power source to JP3 and connected the UUT to JP2 you should only read the UUT's current. I think the problem you're thinking of might be that they seem to have labelled IN and OUT round the wrong way (in fact OUT, i.e. JP3, is connected to SENSE+ which would normally be connected to the power source to get a positive reading). If someone does connect the power source to JP2 and the UUT to JP3 to follow the IN and OUT labels then you're right, it would measure the instrument's power as well as the UUT's power.

Mark.
Edit: This appears to be designed for larger systems and to have the coulomb counter permanently installed in that system, in which case you would want to read the total charge used, but by reversing the connections as above you can use it to measure lower powered systems. I may well buy one of these and bodge it onto an existing MCU board that has an FTDI header so it can dump out the accululated uAh and use the whole thing as a bench tester.

WhiteHare

#9
Sounds promising.  It's only accurate to the most recent interrupt, but if you're averaging over a week, that shouldn't matter.

Any particular reason why you're measuring over such a lengthy period of time?

perky

Only that there are daily things it does as well, a week would give a good indication but that may be OTT.
Mark.

WhiteHare

@perky
Did you have a chance to try it out?  How did it go?

perky

Not yet, I'm going to do so within the next few weeks, I've got one of those Sparkfun coulomb counters from eBay to mess with now. My project is going into a trial period soon and calculated battery life is 2.4 years, but I'd like a true current measurement to check my calcs aren't way off.
Mark.

WhiteHare

@perky
Cool.  I followed your lead and ordered one from Aliexpress on the hope that it will prove useful someday.

WhiteHare

#14
In my case, I'm wanting to measure the amount of coulombs produced by a very small solar cell.  So, it can't be used to power the LTC4150.  However, looking at the PCB:

it looks as though I can cut the trace between the 4.7uF capacitor and OUT+, then solder a wire wire to the capacitor pad to power the LTC4150 independent of voltages on IN and OUT.  Then I'll just connect the solar cell to IN, and it should do the coulomb counting.  So, that's what I plan to do.  I hope it works.