# Short time-scale coulomb counting

There exist many coulomb-counter chips which measure the integrated current going into or out of a battery for purposes of estimating the charge state. Are there any good chips for easy circuits for the purpose of measuring how much charge is used by a particular operation which may take 1-500ms? None of the charge-counting chips I've looked at offer good resolution on short time scales. A typical chip, for example, would output roughly two counts per second at maximum input current; if an operation requires e.g. 100mA for 10ms, and 25mA for 90ms, a coulomb-counter which would output two counts per second at maximum current (100mA) would offer one count per 50mC. The operation described would consume 3.25mC, so the counter would only yield one count every 15 operations.

One approach I was considering would be to use a discontinuous-mode switching power supply, operating from a regulated input voltage, and count the number of switcher pulses. That should yield a high-resolution count; if the switching power supply always used the same amount of current in each pulse, and if the current always fell to zero between pulses, the number of pulses should be directly proportional to the total integrated current. Unfortunately, that's not the most efficient way to operate a switcher, and most switchers attempt to operate more efficiently than that.

Supposing the supply voltage will be either 3 or 6 volts, the maximum current is 250mA, and the goal is to have a minimum of 50% efficiency and 3mW quiescent dissipation, what would be the best approach?

Although I'd like to have a general-purpose measurement approach, the particular application I have in mind is determining what factors affect the energy consumption of various "intelligent" RF modules which will be used outdoors. For example, if the modules normally consume one mAs every 15 seconds to maintain a mesh, but during a rainstorm some of the modules will occasionally start consuming 10maS every second for a couple minutes, that sort of thing would be useful to know. If for some reason the idle current which normally sits at 25uA sometimes goes up to 40uA, I'd like to know that too.

A lot of charge integrating devices work by measuring instantaneous current and integrating the measured values. My concern with that is that the instantaneous current will have a rather large dynamic range (I'd like to if possible be accurate to 10uA in low-current situations, but be able to capture events up to 250mA), and taking readings with that level of prevision fast enough to ensure that even short events get integrated accurately would seem a bit tricky.

One solution I'm thinking of would be to use a PIC with a built-in or external analog comparator, running off a regulated 3.30 volts; whenever the output is below 3.10 volts, switch on a PFET with a series resistor adjusted to pass 0.50A with a 0.20 volt drop. If there is a sufficient cap on the output, the PIC should be able to sleep whenever there is adequate voltage on the output; when the voltage falls below 3.10 volts, the PIC could wake up, feed pulses to the PFET until the voltage gets back above 3.10 volts, and, if charging didn't take too many pulses, "go back to bed".

I would expect that measurement scale accuracy should be affected by the accuracy of the PIC's clock, the effective combined resistance of the PFET and series resistor, and the comparison of the output voltage to 3.10 volts, regulation of the 3.30 volt input. Measurement offset accuracy would be purely a function of leakage.

If the goal is to have an overall accuracy of 10%, the PIC would generally have to keep its output within 0.02V of the target. Faced with a 250mA load, a 1000uF cap would drop 0.250V/ms. Keeping the voltage drop below 0.02 volts would require having the PIC wake up within 80us, which I think is probably doable with the RC-oscillator-based PICs.

• Battery-Powered = Power-efficient. Lots of measurements = poor power efficiency. – Connor Wolf Feb 14 '12 at 7:29
• If you don't need good efficiency for your metering circuit (such as if this is for a bench testing setup), a instrumentation amp across a resistor in series with the power connection to the target device, and a computer-based DAQ system will work, and be easy to assemble. – Connor Wolf Feb 14 '12 at 7:30
• Alternatively, Maxim makes a bunch of high-side current sensing devices. One of those, together with a ADC would also work, though you would have to do your own integration. – Connor Wolf Feb 14 '12 at 7:33

It is not difficult to integrate current. If you're willing to roll your own you'll have complete control over the specs.

As you probably know, a capacitor has the relationships Q = CV and $Q = \int i \cdot dt$ .

One way I see off the top of my head to do this is to create a current mirror to charge a cap. Reading off the voltage of the cap is all that is needed. You can get caps as accurate as you need and there are many accurate current mirror configurations.

With such a method you can really get any amount of complexity that you need. You could have multiple resolutions(multiple mirrors and caps of different sizes). You can use op amps to improve the resolution and create a simple reset.

Of course it's not as simple as using a chip but as you have already stated, you can't find any chips that suit your needs.

It may be possible use current sensing(even proximity) but I'm not sure the accuracy you will get. For example, if your load is fairly low you could stick a 1ohm resistor in series. The voltage across the resistor is then equal to the current. Integrate this(say, using an op amp) and you have the charge. The efficiency here would be much larger, almost near unity while the current mirror method will be slightly less than 50%.

• Using a current mirror to charge a cap might work, but unfortunately I don't know any nice way of making a multiplying current mirror. Using a 1:1 current mirror would meant that more than half the energy going into the device under test would be wasted (the current mirror would drop some voltage, and half the current would be going to charge the measurement cap that would then be discharged as waste). I was also thinking of using switched 250mA current source between a power-supply input and a cap that would serve as the input to the circuitry under test. – supercat Feb 10 '12 at 18:51
• Do you have AOE? they are not difficult and he gives several examples. You can make all kinds of fractional mirrors. A switched cap might work too. It would be less direct though and may have accuracy problems if your not careful. – Uiy Feb 10 '12 at 18:52
• At some nice high rate (e.g. 100KHz) sample the voltage on the circuitry-under-test power cap. If it's below the desired threshold, turn on the 250mA source; else turn it off. Count what fraction of the time the current source has to be switched on. That would seem workable, but aesthetically seems a little crude. – supercat Feb 10 '12 at 18:53
• What is AOE (implication--I probably don't have it)? – supercat Feb 10 '12 at 18:54
• super, but if you use a current mirror with ratio you'll reduce the power consumed by measurement. It is 2x the power consumed with a 1:1 current mirror since the mirror will mirror the current in the load. With a 1:1/2 current mirror the power is 1.5x and with a 1:1/5 it is 1.2x. You can create mirrors with fets and op amps too. – Uiy Feb 11 '12 at 21:52

I'd suggest a different approach: connect a small resistor (e.g. 0.1 Ohm 1% or better - the exact resistance should depend on your load current and the accuracy you try to achieve) in series with the battery and across it a high-side current-sense amplifier (e.g. MAX4173) and connect it to a DAC (there are microcontrollers that come with DACs inside). This way you can measure the current in real time (depending on your sampling frequency, of course) and you can do the integration on-line or post-process it (again, depending on what you have and what you want to achieve.

• I've thought of that approach; my concerns would be (1) If I use e.g. a 12-bit ADC sampling at 10KHz with 205mA full-scale, I'd only have 50uA resolution; (2) If a device uses e.g. an extra 100mA for 150uS, I don't know how to ensure that the measurement integrated current wouldn't depend upon when the samples were taken; (3) Getting a quiescent power below 3mW with even a 10KHz sampling rate might be difficult. – supercat Feb 14 '12 at 17:00

Have you considered looking at what other people use for short-time-scale current measurement?

Dr Sergei Skorobogatov. "Side-channel attacks: new directions and horizons". University of Cambridge 2011. mentions "an oscilloscope and a small resistor in power supply line"

Eric Guo. "Tutorial of SHA-3 on SASEBO-GII" 2010. mentions a 1 Ohm resistor between VCC and the device.

Prof. Jean-Jacques Quisquater and Francois Koeune. "Side channel attacks". 2002 mentions a 50 Ohm resistor "inserted in series with the power or ground input. The voltage difference across the resistor divided by the resistance yields the current."

Paul Kocher · Joshua Jaffe · Benjamin Jun · Pankaj Rohatgi. "Introduction to differential power analysis". 2011 mentions "While a resistor in series with a power or ground line is the simplest way to obtain power traces, we have also had success exploiting the internal resistance of batteries and internal power supplies."