Author Topic: Measuring wide range current draw of micropower applications  (Read 3178 times)

0 Members and 1 Guest are viewing this topic.

Offline AmperTopic starter

  • Frequent Contributor
  • **
  • Posts: 290
  • Country: 00
Measuring wide range current draw of micropower applications
« on: October 30, 2019, 06:53:06 pm »
Hi!

I just had a little bit of time continuing my geiger counter power supply project (https://www.eevblog.com/forum/projects/low-quiescent-standby-boost-regulator-3-3-500v/), which now is working pretty much as i want it to but i ran into a new problem.

To summarize: The current state of the project is a Attiny13 controlling a boost converter feeding a cocroft walton multiplier boosting the voltage up from 3.3V to 500V. It charges up a 1uF storage cap so the multiplier, diodes and voltage divider go to sleep after a charge cycle. A new cycle is triggered either by watchdog timer or a certain number of pulses detected corresponding to a known discharge of the storage cap.

This results in a current draw of roughly 6uA while sleeping and 20-50mA for a few milliseconds recharging which happens at least every half hour by watchdog. The amount of energy pumped will depend on the depletion of the storage cap by detection, moisture or just loss in parts.

Until now i measured the average current draw by supplying the entire thing with a set of two 25F 2.5V capacitors in series and measuring the drop over a longer period of time. This worked nicely but has a set of annoying drawbacks, its labor intensive, the voltage is not constant, the capacitors have a voltage dependent capacity, a lot of tolerance and unknown self discharge which is also dependent on charge state, time, settling time and so on....

I now reached a current of 50uA using this method but i feel like this is the end of what is reasonable this way.

Now my question is, how do i o it better without having the dedicated professional instruments?

Sadly i dont have a bench meter with a modern logging function and the hp3457a only supports gpib which i dont have any hardware for.

How do i get the huge dynamic range required and the sampling rate needed for including millisecond pulses every few hours?


cheers!
 

Online iMo

  • Super Contributor
  • ***
  • Posts: 5570
  • Country: va
Re: Measuring wide range current draw of micropower applications
« Reply #1 on: October 30, 2019, 07:48:51 pm »
Sense a shunt with a logarithmic amplifier and ADC it with say 12bit adc at 10k samples per second. You may be logging the data on an SPI sdcard.. $10 hw solution.. :)
Readers discretion is advised..
 

Offline AmperTopic starter

  • Frequent Contributor
  • **
  • Posts: 290
  • Country: 00
Re: Measuring wide range current draw of micropower applications
« Reply #2 on: October 30, 2019, 08:41:24 pm »
mhoh, log amp is a nice idea, this way i could even do the math on the uC and record just averages and peaks.
 

Offline OM222O

  • Frequent Contributor
  • **
  • Posts: 768
  • Country: gb
Re: Measuring wide range current draw of micropower applications
« Reply #3 on: October 30, 2019, 08:58:52 pm »
you can use a universal shunt that has different ranges (I have a general purpose one that goes from 1ohm to 100kohm in 6 steps, where each step increases resistance by 10x) (you can look up ayrton shunt as well) and combine that with an ADC that measures the voltage across the shunt resistor. then you can dynamically switch the shunt resistance when the voltage goes too high / too low. a simple ADC + micro sd card should be easy enough to finish the task. I can draw a full schematic if you want but parts count is less than 20 and it's a fairly trivial task , so you should be able to do it yourself.

edit: I have a made a milliohm meter using that exact same technique, you can copy the universal shunt and the ADC sections directly and use them. just add a SD card reader to the MCU for logging over long periods. see the attachment for the schematic.
« Last Edit: October 30, 2019, 09:01:23 pm by OM222O »
 

Offline AmperTopic starter

  • Frequent Contributor
  • **
  • Posts: 290
  • Country: 00
Re: Measuring wide range current draw of micropower applications
« Reply #4 on: October 30, 2019, 09:31:15 pm »
Thats actually also something thought about but i didnt know how to bridge the resistors fast enough to catch millisecond pulses. Just having one shunt and multiple amplifiers and DACs could work too i guess just doing the switching over purely in software as the ranges are overrun.

One thing i just noticed is that basically i could just have the logger measure the high pulses and times between them as the low state is pretty much 6uA unchanged and i can measure that using the 3457a. Then its just a question of sampling rate and enough resolution to integrate the pulses, a cheap stm32f103 could probably do that (they have pretty fast adcs iirc). Of cause its only suitable for this particular case but it may e the smallest effort.
 

Offline ogden

  • Super Contributor
  • ***
  • Posts: 3731
  • Country: lv
Re: Measuring wide range current draw of micropower applications
« Reply #5 on: October 30, 2019, 09:42:50 pm »
One thing i just noticed is that basically i could just have the logger measure the high pulses and times between them as the low state is pretty much 6uA unchanged
Your high pulses most likely are unchanged as well. You need to measure consumption and pulses for max/min voltage. Then you just need to count pulses per period (day or few?) which can be done using whatever you have on hand - PC, rPI or MCU board with small software.  Everything else can be calculated.
« Last Edit: October 30, 2019, 09:45:47 pm by ogden »
 

Offline AmperTopic starter

  • Frequent Contributor
  • **
  • Posts: 290
  • Country: 00
Re: Measuring wide range current draw of micropower applications
« Reply #6 on: October 30, 2019, 10:05:05 pm »
Sadly no, the pulses are the variable. They depend on all sorts of factors like humidity, temperature, supply voltage, discharge rate of the geiger and so on. Just as an example: The storage cap is 1uF charged to 500V, im measurng the voltage through a 100GOhm Resistor wich already doubles the amount of discharge. I once had the tube supply wire touch a dry rag and it caused a five fold current increase.... Talking 10s of micro amps on the primary corresponds to insane and ridiculous problems on the secondary wich is all the reason for me having to measure it precisely so i can compare different parts and climate conditions.
 

Offline OM222O

  • Frequent Contributor
  • **
  • Posts: 768
  • Country: gb
Re: Measuring wide range current draw of micropower applications
« Reply #7 on: October 30, 2019, 10:06:36 pm »
Thats actually also something thought about but i didnt know how to bridge the resistors fast enough to catch millisecond pulses. Just having one shunt and multiple amplifiers and DACs could work too i guess just doing the switching over purely in software as the ranges are overrun.

One thing i just noticed is that basically i could just have the logger measure the high pulses and times between them as the low state is pretty much 6uA unchanged and i can measure that using the 3457a. Then its just a question of sampling rate and enough resolution to integrate the pulses, a cheap stm32f103 could probably do that (they have pretty fast adcs iirc). Of cause its only suitable for this particular case but it may e the smallest effort.

just use some comparators instead of doing it via the MCU. You still need to connect the MCU pins to the mosfet gates, but as inputs to know which range you're measuring. any cheap comparator can switch withing a few uS, let alone mS. fast ones can switch over in 2 or 3 nS if you want insanely high switching speed
 

Offline AmperTopic starter

  • Frequent Contributor
  • **
  • Posts: 290
  • Country: 00
Re: Measuring wide range current draw of micropower applications
« Reply #8 on: October 30, 2019, 10:17:57 pm »
Yes, the sensing and logic is pretty straight forward. I just never realized that i could drive the fets this way just having the source vary by shunt voltage. I guess thats because i always use them in power electronics where i want the best ground path i can get...
 

Offline Brutte

  • Frequent Contributor
  • **
  • Posts: 614
Re: Measuring wide range current draw of micropower applications
« Reply #9 on: October 30, 2019, 10:35:08 pm »
You could use a bipolar current mirror. The Vbe is a logarithm of current. So the bjt transistor becomes a shunt. With 0.4V you get 1uA, with 0.5V you get 10uA, 0.6V with 100uA, 0.7V with 1mA etc. (just to show the idea). These are < 0.1$ a piece, typically available in SOT23-4.
 

Offline ogden

  • Super Contributor
  • ***
  • Posts: 3731
  • Country: lv
Re: Measuring wide range current draw of micropower applications
« Reply #10 on: October 30, 2019, 10:43:06 pm »
Sadly no, the pulses are the variable. They depend on all sorts of factors like humidity, temperature, supply voltage, discharge rate of the geiger and so on.
I see. Then perhaps 10$ solution is to buy MSP‑EXP430FR2433 which is cheapest ready to use wide dynamic range MCU power measurement tool one can buy known to me. Those who will jump-in with "but msp430 is not Tiny13" can cool down because standalone tool work w/o connection to msp430 as well.
 

Offline OM222O

  • Frequent Contributor
  • **
  • Posts: 768
  • Country: gb
Re: Measuring wide range current draw of micropower applications
« Reply #11 on: October 30, 2019, 10:50:15 pm »
Yes, the sensing and logic is pretty straight forward. I just never realized that i could drive the fets this way just having the source vary by shunt voltage. I guess thats because i always use them in power electronics where i want the best ground path i can get...

Those specific fets are logic level fets. if you drive them with 5V, the source can be as high as 2V and the fets are still fully on! However I would worry about more important things if you have 2V across your shunt  :-DD
 

Offline AmperTopic starter

  • Frequent Contributor
  • **
  • Posts: 290
  • Country: 00
Re: Measuring wide range current draw of micropower applications
« Reply #12 on: October 30, 2019, 11:02:33 pm »
The ti board looks really nice, if it can do this it will be worth it just for this meter function on its own...
 

Offline jbb

  • Super Contributor
  • ***
  • Posts: 1265
  • Country: nz
Re: Measuring wide range current draw of micropower applications
« Reply #13 on: October 30, 2019, 11:17:44 pm »
Yes, wide dynamic range measurements are a problem. I’m grappling with it at work...

I see three options:
  • Spend lots of money on really expensive kit. Keysight would be very happy to help you spend some tens of thousands. Joulescope might be workable.
  • Arrange your measurement to work on the ‘active’ current only, and just assume the ‘low’ current is 6uA. You could also calculate an expected ‘sleep’ current using data sheet values.
  • Split the current into 2 channels: one for the boost converter input and the other for everything else. This would divide up the big dynamic range problem into two easier problems.[\li]
 


Offline AmperTopic starter

  • Frequent Contributor
  • **
  • Posts: 290
  • Country: 00
Re: Measuring wide range current draw of micropower applications
« Reply #15 on: October 31, 2019, 07:51:04 am »
Well thats embarrassing, usually i search before posting...
Thank you for the links however, some of the stuff is very interesting.
 

Online magic

  • Super Contributor
  • ***
  • Posts: 7453
  • Country: pl
Re: Measuring wide range current draw of micropower applications
« Reply #16 on: October 31, 2019, 08:29:11 am »
Without reading those other threads I would say:

Use a few ohm shunt to maintain reasonably low burden voltage at full load and provide as many parallel amplifier-ADC paths with different gains as you need. That's probably going to be 2, and only the low gain one needs to be fast and only the high gain one needs µV precision, which isn't even the worst situation it could be.

Say, ATtiny13 + trimmed OP07 + dunno, maybe even NE5534?, whacked together on a perfboard.
« Last Edit: October 31, 2019, 08:33:17 am by magic »
 

Offline AmperTopic starter

  • Frequent Contributor
  • **
  • Posts: 290
  • Country: 00
Re: Measuring wide range current draw of micropower applications
« Reply #17 on: October 31, 2019, 08:49:30 am »
Yes, thats one of the considerations ^^
Having 1V drop@ 20mA would give me a 50Ohm shunt, .3mV@ 6uA. Not really any problem but in this case building the auto ranging shunt would not be so much more of a work.
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 15797
  • Country: fr
Re: Measuring wide range current draw of micropower applications
« Reply #18 on: October 31, 2019, 05:40:03 pm »
Well thats embarrassing, usually i search before posting...
Thank you for the links however, some of the stuff is very interesting.

There are probably yet others. But no problem, that happens to everyone. This is actually a recurring topic, as it's a very serious need these days, and not many solutions out there, especially if you can't afford expensive lab stuff.

One question would be: over how long a period of time do you need to average the current draw? Obviously, many options will fall short for long periods as they will accumulate error over time.
 

Offline AmperTopic starter

  • Frequent Contributor
  • **
  • Posts: 290
  • Country: 00
Re: Measuring wide range current draw of micropower applications
« Reply #19 on: October 31, 2019, 08:28:58 pm »
Yes, all this micro power stuff is an entire rabbit hole on its own. The more you try the more problems you discover and the solutions are sometimes unconventional or just plain ridiculous.

For now i guess a full log of 5-10h would be nice since every period will take up to an hour (heavily depending on tube and capacitor choice). So 10h should give me roughly 10% accuracy if i miss one charge cycle. Though from there on it would be pretty simple to just add another layer of averaging. Since im only interested in the average its no problem to throw away all the measurements and just log a single value every hour or so. That should also give opportunity to log changes due to environmental changes like slow humidity or temperature change.
 

Offline splin

  • Frequent Contributor
  • **
  • Posts: 999
  • Country: gb
Re: Measuring wide range current draw of micropower applications
« Reply #20 on: October 31, 2019, 11:36:48 pm »
Use a few ohm shunt to maintain reasonably low burden voltage at full load and provide as many parallel amplifier-ADC paths with different gains as you need. That's probably going to be 2, and only the low gain one needs to be fast and only the high gain one needs µV precision, which isn't even the worst situation it could be.

But make sure you clamp the high gain amp to prevent it saturating if the overdrive recovery time could seriously impact the accuracy. ([EDIT 3] For example, the 2MHz auto-zero MCP6V26 has a recovery time of around 50us). How big a problem that is depends on the threshold level where the high gain range becomes active and the frequency that the range changes. In cases, such as IOT applications, where an MCU spends much of its time, op-amp saturation wouldn't be much of a problem as the recovery time is insignificant compared to the total time spent in sleep mode.

This single shunt / multiple amp scheme works well for capturing rapidly rising current levels however. Ultimately the dynamic range will be limited by the maximum shunt voltage that can be tolerated and the noise performance of the highest gain amplifier. Assuming 100mV max shunt voltage and a very low noise amp, LT1028, is used. Further, assume a measurement bandwidth of 20kHz for which the amp noise is around 700nV peak to peak. The dynamic range is 100mV/700nV = 143,000:1 giving a resolution of 7uA for a 1A max current range.

Of course you can drastically reduce the noise bandwidth if the measured current remains in the low range for relatively long periods by using dynamic filtering in the MCU. The limit then would be the amp's flicker noise - 35nVpp for a single LT1028 0.1 to 10Hz, or 350nV resolution for 1A max. Further improvement could be achieved by paralleling op-amps or using very low noise bipolar transistors such as the ZTX951. Fortunately, the relatively high current noise of bipolar amps isn't a problem in this application with the very low source resistance of the shunt.

[EDIT] Thermal EMFs of the shunt and the connections to the amplifier, probably of the order of a few uV/C, are more likely to be the main limitation to dynamic range unless you have some way of calibrating or offsetting them out which is tricky, if not impossible.

[EDIT 2] Self heating of the shunt can be a significant additional error source depending on how long the current spends at higher levels, but at least you have the option of arbitrarily increasing the thermal performance of the shunt and selecting a shunt with very low temperature coefficient.
« Last Edit: November 01, 2019, 12:08:34 am by splin »
 

Offline NiHaoMike

  • Super Contributor
  • ***
  • Posts: 9321
  • Country: us
  • "Don't turn it on - Take it apart!"
    • Facebook Page
Re: Measuring wide range current draw of micropower applications
« Reply #21 on: November 01, 2019, 01:15:21 am »
An active IV converter with multiple ranges (lower current ranges bypassed with diodes) will work nicely. Digitize all ranges at once and then use a simple sensor fusion algorithm (if low range out of range, use higher range) to merge the data together.
Cryptocurrency has taught me to love math and at the same time be baffled by it.

Cryptocurrency lesson 0: Altcoins and Bitcoin are not the same thing.
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 15797
  • Country: fr
Re: Measuring wide range current draw of micropower applications
« Reply #22 on: November 01, 2019, 03:41:58 pm »
For now i guess a full log of 5-10h would be nice since every period will take up to an hour (heavily depending on tube and capacitor choice). So 10h should give me roughly 10% accuracy if i miss one charge cycle. Though from there on it would be pretty simple to just add another layer of averaging. Since im only interested in the average its no problem to throw away all the measurements and just log a single value every hour or so. That should also give opportunity to log changes due to environmental changes like slow humidity or temperature change.

One question to ask yourself is, what exactly are you expecting from all those measurements?

1. If you're after a realistic average power draw in "typical" conditions over a significant period of time, one of the simplest approaches, not extremely accurate, but closer to what you'd expect to get out of it, would be to let your device run on a given battery, the capacity of which you have first assessed with a simple setup. Then let it run on the battery fully charged until its voltage gets down to the cut-off voltage you've used to assess its capacity. Done. You can rinse an repeat several times to get a realistic average figure and most of all verify that you get reproducible results.

2. If you additionally want to know the max current peak, you could use a simple setup with a small shunt and an oscilloscope/acquisition board that would trigger on the rising edge of the current draw with a threshold significantly above the idle current. Enable statistics on the given channel, and you'll get your min/max/average. This won't be very accurate, but good enough IMO to get stats on the peak values. Knowing about the peak values would further help you select an appropriate battery.

 

Offline AmperTopic starter

  • Frequent Contributor
  • **
  • Posts: 290
  • Country: 00
Re: Measuring wide range current draw of micropower applications
« Reply #23 on: November 01, 2019, 07:53:17 pm »
Sadly that will not work, as said previously the drain of these batteries depends heavily on current draw and outside influences, so its not really possible to carry results from a small battery to a bigger one. As im aiming for a run time of more than a decade and even on a cr2032 it should last for more than a year i have a limited number of tries in my lifetime...
 

Offline GeorgeOfTheJungle

  • Super Contributor
  • ***
  • !
  • Posts: 2699
  • Country: tr
Re: Measuring wide range current draw of micropower applications
« Reply #24 on: November 01, 2019, 08:48:34 pm »
To measure the sleep mode energy more accurately you can always put 10 or 20 or 50 devices in parallel and divide. Patch the software so that it won't trigger any high current spikes.

To measure the current spikes, the software could set a gpio to trigger the logger device in advance so that it can sample and integrate as fast as it can but only when it's needed.

Or perhaps, use a gpio to signal what shunt to use, because the software knows what it's doing/going to do next => what's the best suited shunt.
The further a society drifts from truth, the more it will hate those who speak it.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf