I've built an IOT device using the Electric Imp. It gathers some environment data (temperature, humidity, pressure), and sends it off to the internet every couple of hours. It runs off a small 1000mAh lipo battery, and I hope to achieve a runtime of at least 6, but hopefully something closer to 12 months between charges.
Now I have some guesstimations of that runtime based on the current consumption values in the datasheets, but since those are a bit vague on occasion (particularly the imp's datasheet is rather sparse) I'd like to measure it. The difficulty is that during sleep, the consumption is about 60uA-ish, while taking measurements it's 1mA-ish, and while connected to the network I see values between 15mA and 120mA, with the imp's datasheet describing a worst case of 400mA for short intervals a couple of ms long. This large dynamic range makes things difficult.
What I want to know is the average current consumption of this device. Btw, the battery gives me between 3.7V 4.0V depending on charge state, and my Vdd is set to 2.8V. I have a switching regulator, so I can accept a burden voltage of up to 0.9V, although because it is a switching regulator, I have to subtract the power wasted in the meter from the overall measurement to get accurate results.
Given my somewhat limited equipment I've tried the following:
- using an Agilent U1241B in the 100mA range, which gives me 10uA resolution, and averaging. Problems: not really precise enough to measure the sleep current accurately, which skews the long term average, and measurements during wifi communication are clipped to 100mA.
- using an UT61E. Doesn't work, because the burden voltage is so high the board browns out as soon as the wifi module switches on.
- using the uCurrent in mA range. Works, but again doesn't give me the resolution to measure sleep currents accurately.
- using the uCurrent in uA range. Doesn't work, again because the burden voltage is too high when wifi is enabled.
- See how long it takes for the battery to be emptied. Would work well I suppose, but I'm hoping that there is another good method where it doesn't take me months to get a data point
What I can do is some clever calculations, e.g. measure the sleep current with the uCurrent's uA range, then measure overall consumption in mA mode and replace all sleep data points with the previously measured sleep current, something like that.
Measuring sleep current is a bid fiddly as well. Since when cold booting, the Electric Imp always switches on Wifi, the burden voltage of any device in uA range will cause a brown-out. I used a jumper, connected the meter to the jumper posts then pulled the jumper while the device was up and sleeping.
So I'd like to ask the experts, what's a good way to measure average current in such a situation? Is there a device where I can do a single connection and a single long-term measurement and it gives me accurate results? If so, does it fit into a hobby budget? I feel that with IOT becoming more popular, someone has to have figured out a good method for this...