How to measure energy consumption on a IoT sensor? - Page 1
Forum section: electronics / testgear

author: mogul
author_rank: Newbie
timestamp: February 24, 2019, 09:44:36 am
content: 'Aloha Friends!I am in the market for a device to measure how much energy a small IoT sensor drain from a battery.Most of the time the sensor is in sleep mode consuming only an uA or so, but then it wakes up and draws perhaps 10mA.I need a device to measure and average this over say 24 hours.Being a mostly software guy I'm not sure what exactly I am looking for. I googled a bit and read a lot, but still..Eg. I came across Siglent SDM3045X and read that it does some statistical functions, but will it be good for my use case?Is it overkill or not enough? Alternative suggestions?Both cost and ease of use are parameters along with the obvious, the reliability of the result. But the later might perhaps a bit less important, after all batteries have some quite big tolerances in their stated capacity./mogul

author: beanflying
author_rank: Super Contributor
timestamp: February 24, 2019, 09:53:18 am
content: In case you haven't found it yet in your search. Depending on the sleep to operation time will determine the speed you need to acquire the data at to get a 'real' figure.https://youtu.be/HmXfyLyN38cIt may be a quality guesstimate based on leaving it on and transmitting data and measure voltage and current and then measure the time of your 'normal' cycle and then put it into sleep and measure. It won't be perfect by any means but it could be done with lower spec gear.

author: ogden
author_rank: Super Contributor
timestamp: February 24, 2019, 10:46:49 am
content: Quote from: mogul on February 24, 2019, 09:44:36 amYou can get away without any specific device - if you can modify sensor firmware for continuous transmissions. Sleep current measurement is easy, you already stated it as well. Next you measure how long time it takes to transmit let's say 1000 or 10000 times, what's average current. After that all you need is calculator to calculate consumption over any period.

author: mogul
author_rank: Newbie
timestamp: February 24, 2019, 11:06:12 am
content: Quote from: beanflying on February 24, 2019, 09:53:18 amOhh, cool. Thanks man, I now realize that the problem is much harder than I initially expected. Really good video you linked, should have found that myself.

author: mogul
author_rank: Newbie
timestamp: February 24, 2019, 11:08:25 am
content: Quote from: ogden on February 24, 2019, 10:46:49 amI cannot run the test with different firmware than the one used for production, at least I cannot claim it to be the same, which I would very much prefer.

author: nctnico
author_rank: Super Contributor
timestamp: February 24, 2019, 11:11:58 am
content: I've seen a device being mentioned in another thread which is made by a forum member...Found it:https://www.kickstarter.com/projects/jetperch/joulescope-precision-dc-energy-analyzerUnfortunately it is still in a Kickstarter phase. It would have been nicer if the designer just started production and go from there.

author: mogul
author_rank: Newbie
timestamp: February 24, 2019, 11:16:24 am
content: Quote from: mogul on February 24, 2019, 09:44:36 amSo it appears the problem is two fold. One problem is to get the voltage drop low enough over the ammeter while still be able to measure the small currents while sleeping. The other is how to accumulate the measurements over time.Since I know DUT when sleeping is doing so for minutes at the time I guess I can start by measuring the current there using a regular uA meter. (when I know DUT is sleeping)Next I need an energy logger that can sum up the currents used in the 20mA range.Lastly I guess I can get a pretty fair result by simply adding the two numbers.Does this make sense?

author: mliberty
author_rank: Contributor
timestamp: February 26, 2019, 10:13:56 pm
content: You are on the right track - I call this the time consuming, tedious, and the error-prone way (and one that I have done far too many times). I have posted a couple of blog articles that may help:Challenges measuring energy consumption with a multimeterHow to measure currentIf you are interested in Joulescope but can't wait for the Kickstarter delivery, please send me a direct message.

author: HalFET
author_rank: Frequent Contributor
timestamp: February 26, 2019, 11:28:28 pm
content: This is quite a tricky one indeed, you can mess around with a scope and a current probe if you're feeling very brave. But that does sort of work if you need to get an initial idea of what's happening, but it's very impractical for long-term measurements due to obvious reasons. A more practical approach is to use a source meter, but the usefulness of that one depends on the rate at which you'll have to sample. You also have a few battery emulators which would probably do a decent job at this, they occasionally show up on eBay.But if you want to do it properly you'll need a DC power analyser like Keysight nicely described here:But this is a rather specialised piece of kit, if I were you I'd rent one if I really needed it.

author: DaJMasta
author_rank: Super Contributor
timestamp: February 27, 2019, 04:14:47 am
content: Do you actually need to measure the pulses and the sleep currents, or are you only concerned with average consumption? Just getting an average over a long time is a much simpler task...

author: stmdude
author_rank: Frequent Contributor
timestamp: February 27, 2019, 09:12:42 am
content: If you're working with Nordics stuff, I'd recommend their power-profiler. Very cheap, accurate enough for estimating battery-life, quick enough to catch tx bursts on BLE.

author: mliberty
author_rank: Contributor
timestamp: February 27, 2019, 02:05:35 pm
content: Quote from: DaJMasta on February 27, 2019, 04:14:47 amLike many things, the answer is more complicated and depends upon what you are doing. If you are optimizing your software/firmware, you want to be able to see your changes. This requires greater bandwidth. I am happy to go into more detail on this if you would like!If you just care about estimating battery life, you still need to worry about burden voltage and sufficient dynamic range. If your current consumption range is within about 3 or 4 orders of magnitude, you may be able to get by with a single shunt resistor and µCurrent. Beyond that you, need to have a more adaptive ammeter, such as Joulescope's autoranging shunt ammeter. Any autoranging ammeter has to respond fast enough to not affect the target device. Current Ranger attempts to autorange fast enough, but really does not. Andreas Spiess has awith a good comparison. If you watch this video, Joulescope offers the performance of the "reference system" at a fraction of the price.How fast is fast enough for an autoranging shunt ammeter? Well, that depends on your system. You can approximate this as t = C * ΔV / ΔI (Larger changes need to use the exponential decay equation). Let’s take a typical example. The target system takes 3.3V and can tolerate a temporary 3% voltage glitch on a 1 amp change. If the system has 10 μF of capacitance, the required shunt resistor switching time needs to be:10 μF * 3.3 V * 0.03 / 1 A = 1 μsAnd that's why Joulescope is as fast as it isFrom the other perspective, how much bandwidth is enough? Any real-world setup has load capacitance and resistance/inductance between the supply and load. A shunt ammeter intentionally introduces resistance. This further reduces the possible bandwidth. The larger the load capacitance, the smaller the possible bandwidth. Ignoring all other parasitic effects (which do matter!), a 10 µF load capacitance and 0.01 Ω shunt resistor has a bandwidth of 1 / (2πRC) = 1591 kHz. I have attached a very simple LTSpice simulation to confirm. Since most systems have additional cabling resistance/inductance and larger load capacitance, this value is a nice upper bound for what is typically necessary. Cable inductance further limits bandwidth in an real-world system. I designed Joulescope to match or exceed the bandwidth of most real-world systems.Questions or comments?

author: DaJMasta
author_rank: Super Contributor
timestamp: February 28, 2019, 03:48:23 am
content: Not really what I was alluding to. If all you need is power measurement on the order of minutes, you can measure a discharge curve of a battery or supercap with a known load and then get your device's average consumption by watching the discharge curve over long time constants (minutes or hours) to get a very accurate picture of power consumption if you're concerned just with battery life.If you actually want to analyze and optimize specific events, then yes, the viable solution is much more complicated and requires good impulse response and high dynamic range.... but if it's just a long term average, which sometimes is the only concern, you could charge up a cap, measure leakage current, measure the time it takes to drop a volt with your device being tested, and do some basic math to get an accurate picture of average power consumption in the long term.

author: EE-digger
author_rank: Frequent Contributor
timestamp: February 28, 2019, 04:20:03 am
content: In the past, for BLE, I've use a very low value sense resistor and amplification where necessary, to feed a scope. If the scope has area measurements under a waveform, you can easily quantify the power consumed for each type of "event", in my case, for a number of Nordic designs.This cost per "event" is then multiplied by how many times that event occurs in a day, month, year or whatever your period of interest is. Very powerful tool.As we speak however, I'm running charts right now with a Keysight 34465A DMM displaying a trend chart. With the fastest acquisition rate, it catches the transmission bursts for my radio and acquisition system.The 34465A also has a DIGitize option which is only around $350 more or so. This lets you digitize at up to 50k samples/s using Benchvue to gather and view the data.Works very nicely and the 34465A resolves down to 1pA

author: mliberty
author_rank: Contributor
timestamp: February 28, 2019, 01:18:15 pm
content: Quote from: EE-digger on February 28, 2019, 04:20:03 amGreat to hear the 34465A is working out for you! That's a nice instrument. Even a retail priced Joulescope will be less than half the cost of the 34465A with digitizer and better suited for these measurements. Joulescope has lower burden voltage and higher accuracy for sleep currents than the 34465A. Why higher accuracy? If you are doing Bluetooth, I suspect you are using the 100 mA 34465A range which has ±0.004% full-scale accuracy = 0.1 A * ±0.00004 = ±4 µA. Sure, you can switch to a more sensitive range to make a more accurate measurement, but you'll brown out the device if it wakes up.

author: EEEnthusiast
author_rank: Frequent Contributor
timestamp: May 01, 2019, 05:28:35 am
content: You might want to consider a dedicated power profiler tool. Couple of them are available now.1. Quoitech OtiiThere is one made by qoitech which is quite good considering the features.https://www.qoitech.com/It has good dynamic range but very limited bandwidth to observe pulses.2. ZScircuits ZS-2102-AAnother option is the ZS-2102-A from ZSCircuits. This can plot current profiles for more than 20 minutes. It has both high dynamic range and bandwidth to account for IOT type profiles. more info atwww.anglercircuits.com3. R&S R&S®RT-ZVC02Needless to say it is accurate and feature rich but expensive as well. About 5K USD !!!

author: exe
author_rank: Unknown
timestamp: May 01, 2019, 09:15:27 pm
content: There was a similar thread, a proposed solution was to have two power supplies: one that provides power when the devices is in sleep mode, another one when active.Unfortunately, I don't remember details how seamless switch between devices was implemented. May be the first supply just had a slightly higher voltage, but could only provide a tiny bit of current. So, when DUT is active, the contribution of sleep-mode supply was negligible. Next, just connect an oscilloscope to both shunts, it will be obvious which power supply is active.If someone has a link to that discussion (and/or some schematics) please share.