High dynamic range current vs. time measurement at low cost - Page 1
Forum section: electronics / testgear

author: setu
author_rank: Newbie
timestamp: May 14, 2017, 07:15:51 am
content: Hello, I am in the embedded microcontroller space and would like some test equipment to measure current vs. time, where the current can vary from 0.5 uA to ~10 mA levels quickly as the microcontroller goes to sleep and then wakes up.What is the best way to do this nicely at a relatively low cost? I am aware of the resistor in series with the supply and using an oscilloscope, but am looking for something better than that to get the dynamic range.The Agilent N2820A probe is too expensive, and the uCurrent Gold is not applicable (since it does not autorange for this measurement range of interest).Using a log amp based solution seems interesting - does anyone have experience with this?https://www.ee-quipment.com/products/real-time-current-monitor-with-usbAre there any other options?

author: coppice
author_rank: Super Contributor
timestamp: May 14, 2017, 07:46:52 am
content: Measuring the true energy consumption of a ULP design can be a real pain in the rectum. A lot of designs have gone to market with the designers thinking, in good faith, that they had properly assessed the battery life, only to find batteries dying after 3 or 4 years instead of the 10 they expected. As you said, the dynamic range, combined with the burstiness of typical ULP loads, is the problem. Probes like the N2820A don't really help. I don't know about the device atwww.ee-equipment.com, but it looks similar to several things l've seen which also don't help. They can't maintain enough accuracy over enough dynamic range, with enough time resolution, to do the job well.The best efforts I have seen approach the problem in a different way. Its really hard to measure the current drawn from a battery well over a massive dynamic range, so eliminate the battery, and use a special power supply. You put energy measurement inside that supply. You build a supply that always pushes equal sized shots of energy into its final filtering stage, on demand. Now you have reduced the energy measurement problem to measuring the rate at which you are pumping those shots of energy into the output filter to sustain the output voltage. You can't see the exact timing of the changes in load current with this design, as the output stage of the supply is a big low pass filter, but you get a good measurement of the overall energy drawn. The main downside is you are not measuring the energy consumption with the real product's energy source. You always have to make sure you properly account for the long term internal impedance of the battery when you assess how long it will last, but not running your design without the real voltage droops associated with a high source impedance makes true assessment of battery life that much harderIf you look at recent tools from TI, they work in this way. I think other ULP device vendors are going in the same direction.

author: Rerouter
author_rank: Super Contributor
timestamp: May 14, 2017, 08:11:44 am
content: I would say this is actually not that difficult as long as your ok with some limitations, 0.5uA to 10mA is not that wide of a dynamic range, its only a scale of 20000 steps, so within the stepping of a 15-16 bit ADC,On the cheaper units, you will be fighting some error terms, but some of these can be calibrated out, as long as you have a meter you trust to compare against.Ok so step 1, your currents are tiny so you pick an op amp with low offset and low bias current, these can be found for less than $5 a pop. you may need a higher bandwidth one, so lets say $10 top,You have the op amp acting as a transimpedance amplifier to power supply ground, the burden voltage is as low as the op amps offset voltage. essentially the op amp is generating a voltage to cancel out any voltage due to the current its sinking,You then throw that voltage into your ADC, and sample with the precision and rate your after, lets say $8 for a decent one with low error terms,Then pick your favorite flavour of micro to read out of the ADC as much as you care for.I see no reason why you could not build such a setup for less than $35, able to measure to +-2uA accuracy.

author: coppice
author_rank: Super Contributor
timestamp: May 14, 2017, 08:22:44 am
content: Quote from: Rerouter on May 14, 2017, 08:11:44 amIf a 16 bit ADC reaches clipping at 10mA, it reads about 3 or 4 when the load is 0.5uA, assuming you have precisely compensated for INL, and other issues. That horrible resolution is the heart of the problem, and why it becomes difficult to measure accurate energy consumption in typical ULP applications. They typically spend a high percentage of their time in the 0.5uA consumption state, so it integrates up to be a substantial part of the total energy consumption. If you can't measure it to reasonable accuracy you can't get more than a vague idea of total energy consumption. Your chances of being able to tell if changes you make cause the energy consumption rise or fall are pretty much zero.

author: Rerouter
author_rank: Super Contributor
timestamp: May 14, 2017, 08:41:02 am
content: Ok, time to bring out the engineering stick, you can have your cake and eat it. this approach is a driven low impedance voltage, it means you can drive an ADC directly, or chain on a number of amplifiers stages feeding multiple ADC's without much issue.easiest to work within the limitations of the op amp is this x4.7 and x470 measured by 2 ADC's. likely single channel ones being triggered at the same time, the low range integrates the uA, as the op amp specs should not be the source of your error by any significant margin, the high range is for when the low range saturates, and by then your accuracy per step is still +- a few uA,Attached is how i would approach it, note that any current added or subtracted to the right of that 100 ohm resistor is not influencing the output voltage.

author: nctnico
author_rank: Super Contributor
timestamp: May 14, 2017, 11:40:04 am
content: An Agilent 66311B could be a good tool. It has the ability to record current consumption based on a trigger. I never tried it myself but someone on this forum has written software to control it remotely and setup the trigger & read the data. Either way a 66311B is a neat tool if you are into battery powered devices.

author: coppice
author_rank: Super Contributor
timestamp: May 14, 2017, 03:38:39 pm
content: Quote from: Rerouter on May 14, 2017, 08:41:02 amMultiple gain stage are an obvious strategy, but you'll need more sophistication than in your circuit to get good results. DC offsets and the recovery time as your high gain op-amp comes out of saturation will spoil performance with such a simple design. When measuring 100nA, you need to be careful about the circuitry used to sense from the shunt, too. I've seen a prototype which self calibrates offsets at intervals, but it was kind of messy, and wasn't taken forward to any kind of product.

author: David Hess
author_rank: Super Contributor
timestamp: May 14, 2017, 09:09:16 pm
content: Translinear log circuits have a frequency response which varies with current. I actually like this method and would use it if it was just necessary make a very wide dynamic range measurement of a constant current.Measuring the current is one way but as coppice points out, resolution and accuracy at low currents is a problem. But what is really needed is a measurement of energy or power which is energy per second and not integrated current. So I would use a charge pump; then the frequency of operation is proportional to the charge (energy) delivered per second or power.As a recall, Texas Instruments implemented an inductive based charge pump and I am pretty sure I remember prior art from 10+ years ago on this but I would implement a capacitor base charge pump. I might even use two or more capacitors for coarse and fine ranges; the total energy is just the sum from the two capacitors. Accuracy might only be 5% but it should be good over the entire operating range.

author: Kleinstein
author_rank: Super Contributor
timestamp: May 15, 2017, 07:33:34 pm
content: The dynamic range from 10 mA to 0.5 µA is not really large. It somewhat depends on the time resolution needed. However any capacitor at circuit will already slow down the response. So there is limited use of very fast readings.My solution would also be a trans-impedance amplifier to get a low burden and still no problems with to small a voltage. 10 mA is still in the range what an OP can deliver. If it is only for the average current and thus charge used, one can already have a filter cap at the TIA stage and thus reduce the speed needed for the OP. There are a lot of cheap 24 Bit ADCs that can do a continuous sampling, thus are not missing any spikes. Lowest cost might be something like MCP3911 (or similar).A log amplifier can have trouble with fast changing currents, so it would need filtering before the log stage. In addition the log stages tend to be temperature dependent and compensation for this is usually not that perfect. So accuracy will not be very high.

author: setu
author_rank: Newbie
timestamp: May 15, 2017, 09:20:03 pm
content: Thank you all for your responses. Much to consider for me.In general, I would like to get an off the shelf solution rather than build something, assuming the price of the off-the-shelf solution is in the < $500 range. I am not 100% confident that I can stay within 10 mA, in some cases it seems about 22 mA active current would be needed for the application.I agree the decoupling capacitance on board will filter fast changes. The "time resolution" I am looking for is in the 100 us range, with a nice to have of 10 us. The issue is the total measurement interval can be quite long (e.g. 100 ms). The accuracy requirement is on the order of 1%, though worse accuracy (even 10%) is acceptable at very low currents, e.g. 0.5 uA. The reason is that we can have a separate test mode firmware that can typically put the MCU into deep sleep (or hibernate or snooze or whatever the low power mode nomenclature specific to that MCU) and then I can use a standard uA range capable multimeter to measure that current.I found this website that contains a list of such equipment at the website below (list starting "Tools that monitor power and/or current:")http://www.ganssle.com/tools.htm#logicanalAny other feedback will be appreciated. I will also add more thoughts about suggestions above later.

author: f5r5e5d
author_rank: Frequent Contributor
timestamp: May 15, 2017, 11:31:13 pm
content: https://moosh.im/mooshimeter/- although it looks like 8 ks/s