How to: power consumption of intermittent, spikey projects

Go To Last Post
60 posts / 0 new

Pages

Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Seriously, how do y'all work out power consumption of interrmittent, spikey projects? I generally use one of two methods:

a) Measure the running current by disabling the sleep, measure the sleep by disabling the run, doing the math(s) according to the real run/sleep ratio.

b) Use my PC scope to record the voltage across a shunt, then using the RMS(IIRC) function.

 

Neither of these are ideal. Is there some specialist IC or circuit that does this sort of thing? Some sort of fast integrator or similar?

 

 

Four legs good, two legs bad, three legs stable.

Last Edited: Wed. Dec 6, 2017 - 11:49 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

John_A_Brown wrote:
Seriously, how do y'all work out power consumption of interrmittent, spikey projects?

That's a very good question which deserves splitting-out to General Electronics for a proper discussion ...

 

EDIT

 

Now split; it was originally here: https://www.avrfreaks.net/comment...

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Wed. Dec 6, 2017 - 11:59 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

John_A_Brown wrote:

Seriously, how do y'all work out power consumption of interrmittent, spikey projects?

 

You buy a starter kit with on-board energy monitor and use it to monitor an off-board device...

 

https://www.silabs.com/community...

#1 This forum helps those that help themselves

#2 All grounds are not created equal

#3 How have you proved that your chip is running at xxMHz?

#4 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand." - Heater's ex-boss

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Brian Fairchild wrote:

John_A_Brown wrote:

Seriously, how do y'all work out power consumption of interrmittent, spikey projects?

 

You buy a starter kit with on-board energy monitor and use it to monitor an off-board device...

 

https://www.silabs.com/community...

Which appears to be doing pretty much the same thing as my PC scope method, but with a slower sampling rate, unless you know otherwise.

 

Four legs good, two legs bad, three legs stable.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

As Brian says, many dev boards now include power measuring facilities.

 

I also tend to use the scope-and-shunt method - although I find that a current-sense amplifier is useful to get a cleaner signal for the scope.

 

This came from a thread about Dave Jones - he has a little unit:

 

µCurrent GOLD

https://www.eevblog.com/projects...

 

If you have £50k to spend, you could get one of these:

DC Power Analyzer Image

https://www.keysight.com/en/pc-1...

 

I don't have that sort of money, but have worked for a client who had one - it really is the Proper Way to do this!!

 

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I wrote:
many dev boards now include power measuring facilities

and it's not just the dev boards - they often include support in their IDE.

 

Keil is jumping on the bandwagon: http://www2.keil.com/mdk5/ulink/...

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

what is your spike?

is it just in <run> or <sleep> or are there other levels?

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Here's a fairly typical one:

 

That's a LoRa node

 

 

This one is GSM:

 

It's not simple!

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have the Dave Jones current sense, thanks.

It's integrating the power consumption that interests me. I can't help feeling there's some analog way of doing it, but go ogling(as my smartphone writes it) says no.

 

Four legs good, two legs bad, three legs stable.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I upload the data from the scope (as CSV), and do it in Excel, or a Python script; eg,

 

 

This is the kind of thing that the tools I mentioned earlier do for you ...

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

  I can't help feeling there's some analog way of doing it

For a fast way to get an idea of the power use I have used a big capacitor as a battery, and then see how long it takes for the voltage drop from let's say 5V to 4.5. And then scale it up. (make sure that the cap. can give the power for the high spikes).  

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Edison once asked one of his engineers to provide him with the volume of one of his light bulb envelopes, after watching him wrestle with the calculations of the odd shaped bulb for several minutes, Edison grabbed the bulb, filled it with water, then poured the water into a beaker and read the volume from the scale.....

 

Perhaps you could use one of the coulomb counting ic's and have it measure the current consumed over a fixed time interval.....

 

https://learn.sparkfun.com/tutor...

 

Jim

 

 

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes,  I've toyed with that as an idea - must try it some day!

 

But it doesn't help in analysing the power "profile" to see where it's going - and, thus, where to focus optimisation ...

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:

Yes,  I've toyed with that as an idea - must try it some day!

Yea, me too! So much to do, so little time!

 

awneil wrote:

But it doesn't help in analysing the power "profile" to see where it's going - and, thus, where to focus optimisation ...

Your correct, I wasnot thinking of optimization of functions (not sure what I was thinking!)

Time for more caffeine!

 

Jim

 

 

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Wow, I like that Keysight instrument!

 

John, your two methods sound fine, but obviously each has trade offs.

You ought, I think, check the sampling rate on your O'scope's RMS function to see if it is sampling fast enough to catch the spikes your system generates.

If it is sampling too slowing and you miss a large portion of the spikes, then your reading will be in error on the low side, meaning you will over-estimate your battery life, (generally not a good thing).

 

The "problem" with the other method, of course, is evident when looking at the sample LoRa and GSM graphs.

You have to be able to accurately estimate the duty cycle for the various sub-systems.

 

Another option, with its own inaccuracies, is to build your own Keysight instrument with a couple of op-amps, (cost $5 vs $50K, with performance to match!).

Use the micro-current amplifier to feed an op-amp circuit set up as a voltage integrator.

The output voltage is then proportional to the current drawn, (and directly calculateable, although one would more likely just calibrate it for compensate for real world conditions).

 

Note that in practice you would need a good op-amp, rail-to-rail, with a bi-polar supply for good linear operation near the 0 V input range, and an op-amp with a very low input offset voltage spec.

The higher the signal from your current amp, the less the small errors in the op-amp matter.

 

One would usually use a micro to set the "gate interval", the "on time" during which the instrument is measuring the current flow, and then using an I/O pin to turn on an NFet to short out the cap to zero the system and start the next measurement interval.

 

An Atmel Butterfly, (micro, display, joystick, etc.); a breadboard, and a couple of op-amps and you're golden!

 

JC

 

Edit: Typo

 

Last Edited: Wed. Dec 6, 2017 - 04:11 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

DocJC wrote:

Wow, I like that Keysight instrument!

 

John, your two methods sound fine, but obviously each has trade offs.

You ought, I think, check the sampling rate on your O'scope's RMS function to see if it is sampling fast enough to catch the spikes your system generates.

If it is sampling too slowing and you miss a large portion of the spikes, then your reading will be in error on the low side, meaning you will over-estimate your battery life, (generally not a good thing).

 

The "problem" with the other method, of course, is evident when looking at the sample LoRa and GSM graphs.

You have to be able to accurately estimate the duty cycle for the various sub-systems.

 

Another option, with its own inaccuracies, is to build your own Keysight instrument with a couple of op-amps, (cost $5 vs $50K, with performance to match!).

Use the micro-current amplifier to feed an op-amp circuit set up as a voltage integrator.

The output voltage is then proportional to the current drawn, (and directly calculateable, although one would more likely just calibrate it for compensate for real world conditions).

 

Note that in practice you would need a good op-amp, rail-to-rail, with a bi-polar supply for good linear operation near the 0 V input range, and an op-amp with a very low input offset voltage spec.

The higher the signal from your current amp, the less the small errors in the op-amp matter.

 

One would usually use a micro to set the "gate interval", the "on time" during which the instrument is measuring the current flow, and then using an I/O pin to turn on an NFet to short out the cap to zero the system and start the next measurement interval.

 

An Atmel Butterfly, (micro, display, joystick, etc.); a breadboard, and a couple of op-amps and you're golden!

 

JC

 

Edit: Typo

 

I'm fairly sure the sampling rate is not high enough, but, as always, there is a trade-off. If I set the sampling rate to be high, the period over which I can monitor gets shorter.

I was thinking of an op-amp as integrator. What put me off was not being able to find any examples of such for this purpose on the web. That led me to believe the idea was flawed.

Maybe I'll do a bit of research.

 

 

@Jim, I looked at the coulomb counter. The device itself seems to take more current than the sort of device I'm wanting to test. I skimmed the datasheet in vain to look for a clue as to the sensitivity, i.e. the lowest current that would register. I usually find I need to factor in sub microamp currents.

 

 

Four legs good, two legs bad, three legs stable.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

In addition to the Silabs kit that was already mentioned, Nordic Semi also has an inexpensive Power Profiler Kit. It is intended to support development with their Bluetooth chips, so the sampling rate is high enough for such spiky consumption. IIRC it has three shunt resistors and a fast enough 'auto-scaling' to cover a <1uA - ~50mA range.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I just read your comment in the other thread about an 'accumulated power mode'. I'm using the Nordic PPK for this kind of battery life estimation.

 

The kit sends the measured values to a PC over USB, where a Nordic-provided display application makes a graph out of it. You can get short term averages directly from the display app, but for longer times the amount of data gets too large quickly.

The app is written in python and source is available, so I modified it to log accumulated power. I can now leave a device running for hours in some typical use case, and get an average power figure. I intended to add a histogram as well to verify sleep/awake ratios, but I haven't gotten round to doing that yet.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

mrono wrote:
 Nordic Semi also has an inexpensive Power Profiler Kit.

Power Profiler Kit

https://www.nordicsemi.com/eng/Products/Power-Profiler-Kit

 

They've also been working with Sony Mobile Research and Incubation to turn it into a standalone instrument:

https://devzone.nordicsemi.com/blogs/1058/new-power-optimization-tool-called-otii-that-runs-/

https://www.qoitech.com/

 

and there's the Atmel Power Debugger:

http://www.atmel.com/tools/atpow...

 

That started off as part of the SAM L21 XPlained-Pro:

Atmel SAM L21 Xplained-Pro board

Xplained Pro Analog Module (XAM)

They gave me one to try a couple of years ago.

Sadly (but not untypically) they hadn't got the support for it at that point:

http://blog.antronics.co.uk/2015/04/23/new-tricks-for-lower-power-from-atmel/

 

 

There's Bay Libre's ACME:

http://baylibre.com/acme/

Although I also have doubts about the sampling rate of that for this kind of application.

The software was rather disappointing.

 

EDIT

 

ST have recently announced the X-NUCLEO-LPM01A  - STM32 Power shield, Nucleo expansion board for power consumption measurement:

http://www.st.com/content/st_com/en/products/evaluation-tools/product-evaluation-tools/stm32-nucleo-expansion-boards/x-nucleo-lpm01a.html

I don't know how tied-in that is to jut ST products ...

 

 

#PowerMeasurement

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Thu. Dec 7, 2017 - 08:58 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I think I might have a go at marrying up my Dave Jones uCurrent sense(that I have) with an LTC4150 coulomb counter. Looking at the datasheet, I can't see why this wouldn't work. Maybe I'll order one of the Sparkfun clones. I'm not sure how easy it will be to disconnect the Vdd from the current sense(which I think will be necessary). Depends on the PCB layout.

 

Actually, looks like it may be nigh impossible, I think the track is directly under the chip. Maybe I'll find a 10 pin MSOP breakout PCB instead.

Four legs good, two legs bad, three legs stable.

Last Edited: Thu. Dec 7, 2017 - 08:38 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Current controlled oscillator. Count the cycles

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:
Current controlled oscillator. Count the cycles

 

Isn't that pretty much what the coulomb counters do? Maybe you could enlarge on that idea?

Four legs good, two legs bad, three legs stable.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Probably. The ‘obvious’ method is to sample at a reasonable rate using an adc - but there’s the issue of dynamic range etc. Using a current controlled oscillator, hopefully the dynamic range is better than the average adc and you just count clocks which is dead easy on a micro. You might be able to use a 555!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:
there’s the issue of dynamic range etc.

Indeed there is.

 

Using a current controlled oscillator, hopefully the dynamic range is better than the average adc and you just count clocks

It would have to be a pretty fast oscillator in order to get a reasonable number of cycles to count during the brief current pulses typical of stuff like BT ...

 

And it would have to be able to change frequency very fast.

 

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:
Current controlled oscillator. Count the cycles

 

Interesting idea.

 

TI have an app note, AN-240, which has a number of circuits built around an LM331 V-F chip. FS is 200uA for one of the circuits shown and goes down to 20pA!

#1 This forum helps those that help themselves

#2 All grounds are not created equal

#3 How have you proved that your chip is running at xxMHz?

#4 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand." - Heater's ex-boss

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

I wonder what time resolution you really need. Is the battery going to ‘see’ microsecond pulses?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:
I wonder what time resolution you really need. Is the battery going to ‘see’ microsecond pulses?

 

I guess it depends a bit on the size of any bulk capacitance.

#1 This forum helps those that help themselves

#2 All grounds are not created equal

#3 How have you proved that your chip is running at xxMHz?

#4 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand." - Heater's ex-boss

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Kartman wrote:
I wonder what time resolution you really need. Is the battery going to ‘see’ microsecond pulses?

I would have thought so. If not, you've discovered over-unity energy...

 

Four legs good, two legs bad, three legs stable.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Brian Fairchild wrote:

Kartman wrote:
Current controlled oscillator. Count the cycles

 

Interesting idea.

 

TI have an app note, AN-240, which has a number of circuits built around an LM331 V-F chip. FS is 200uA for one of the circuits shown and goes down to 20pA!

Interesting app note.  20pA might be underkill...

 

Four legs good, two legs bad, three legs stable.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

John_A_Brown wrote:

Interesting app note.  20pA might be underkill...

 

Couple one of those with a small AVR, a couple of button and an LCD display and you'd have an interesting useful product.

#1 This forum helps those that help themselves

#2 All grounds are not created equal

#3 How have you proved that your chip is running at xxMHz?

#4 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand." - Heater's ex-boss

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:
 Is the battery going to ‘see’ microsecond pulses?

​Well of course it is - it's all energy consumption, and that energy has to come from the battery!

 

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Brian Fairchild wrote:
TI have an app note, AN-240

John_A_Brown wrote:
Interesting app note.  

Indeed: http://www.ti.com/lit/an/snoa594b/snoa594b.pdf

 

Only skimmed it, but did note that they make the point of having a high frequency.

 

cool

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:
and there's the Atmel Power Debugger:

Power Debugger

Analog Hardware

http://www.microchip.com/webdoc/GUID-EAD481FD-28E6-4CD5-87FB-5165E7687C12/index.html?GUID-F0E592FF-579E-4828-92FA-D5699D9F5F4F

62.5Ksps

An assumption is the samples from the XMEGA128A1U are stored in the UC3A3's attached SDRAM.

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

gchapman wrote:
An assumption is the samples from the XMEGA128A1U are stored in the UC3A3's attached SDRAM.

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Can anyone explain to me how the circuit in figure 2 on AN-240 works?  I'm guessing the opamp is working as an integrator, as it has that cap in the feedback loop, the diodes on the input clamp the voltage to near zero, and the diode on the output stops it from going negative. But if the inputs are near zero, where does the current for the DUT come from?

 

Excuse my ignorance, analog stuff is black magic to me.

 

Four legs good, two legs bad, three legs stable.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

John_A_Brown wrote:
Can anyone explain to me how the circuit in figure 2 on AN-240 works? 

maybe someone on a TI analogue forum ?

 

you might even find the author over there ...

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Thu. Dec 7, 2017 - 02:48 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

John_A_Brown wrote:

...where does the current for the DUT come from?

 

I think that it gets it externally from its power supply with the DUT ground lead feeding into the circuit in fig 2.

 

I think the circuit works like this...

 

the incoming current is integrated across Cf. At a certain voltage, fed into the LM331 on pin 7 a comparator will fire and the capacitor will be discharged via pin 1. Rinse and repeat. The frequency at which the discharge happens is proportional to the input current.

#1 This forum helps those that help themselves

#2 All grounds are not created equal

#3 How have you proved that your chip is running at xxMHz?

#4 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand." - Heater's ex-boss

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks, Brian. Makes a bit more sense to me now. Still not sure what part completes the current path to ground, the cap, the diode or the opamp?

 

Four legs good, two legs bad, three legs stable.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

At a quick look, pin 1of the lm331 is the current source. The other hint is the arrow.
Sounds like a good project for someone......

Last Edited: Thu. Dec 7, 2017 - 10:03 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Resurrecting an old thread here, but it's a problem I have recently encountered again with a LoraWan node that idles at tens of uA, but peaks at around 100mA. The Dave Jones uCurrent Gold doesn't have the dynamic range, and the Sparkfun coulomb counter(modified by replacing the sense resistor with a 0.2 to give a maximum current capability of 250mA, instead of the 1A as supplied), does not seem to be very accurate - even using it back-to-front, so that the chip's own current isn't included in the measurement.

So I'm looking at the supercap idea, as alluded to earlier in this thread by sparrow2.

 

I'm looking at using a 4F 5.5V supercap, and charging it to around 4.2V (same as a charged LiPo that it's replacing for the test), and then running the DUT until the cap drops to 3.5V or thereabouts.

I plan on using an ESP8266 module to read the voltage periodically, so that I can post the results to Google sheets.

If I'm using a 5V supply, can I just charge the cap through a resistor, or is there a better way(that doesn't involve to much faff)?

According to my rough measurements I've made so far, my device averages around 125uA worst case, so I estimate around 6 hours run time, which should be enough.

 

Any suggestions or insights gratefully received.

 

 

 

Four legs good, two legs bad, three legs stable.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

John_A_Brown wrote:
a LoraWan node that idles at tens of uA, but peaks at around 100mA.

Now that is a big peak!

 

surprise

 

A similar application here:  https://www.antronics.co.uk/portfolio/lora-eh

 

although, IIRC, the peak was "only" about 30mA

 

But still, getting the dynamic range to view the full current "span" is a challenge.

 

What I tend to do is just characterise the "idle" and "peak" currents separately.

 

I use my Rigol DSO and a Python script for the data capture:

 

  1. Start a sweep (maybe wait for trigger)
  2. Wait for sweep to finish
  3. Upload trace data
  4. rinse & repeat ...

 

 

EDIT

 

and, before the Rigol, I had an old Tektronix TDS200:

 

http://www.antronics.co.uk/downloads/M1306B_Current_Traces.pdf

 

 

EDIT 2

 

Should've re-read all the earlier posts - I think I'm mostly repeating myself here!

 

frown blush

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Tue. Feb 4, 2020 - 10:40 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have always used the same approach, i.e. measure the sleep current, measure the transmit current, do a bit of arithmetic.
This one's a bit busier, though. There's an interrupt at 5S 10mS, 5S 10mS...
An interrupt every 5 minutes.
Plus possible random interrupts from sensors.
The device in question, a Heltec Cubecell, seems to go back to sleep gradually, apparently full sleep is achieved after calling the sleep function 6 times!
All in all, it's a bit more complicated than the sort of low power stuff I'm used to dealing with. Hence the quest for a different approach.
If I had the budget, I'd look at the Otii offerings, but I'm mainly retired and time-rich cash-poor.

Four legs good, two legs bad, three legs stable.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

These are supposedly the bomb:

https://www.kickstarter.com/proj...

 

 

On a recent project, I had to measure consumption of a NB_IoT cellular module - these go from microamps to 100's of milliamps pretty quickly. I used a pac1934 chip from our friends at microchip to measure the data and a little micro (Ardubino) to read the device and output the data via serial to a python script that read the serial stream and put it into a file. Load the data into Excel, draw graph etc. Job Done. The PAC1934 has 15bit current resolution and 16 bit voltage resolution. I could've done with more dynamic range, but it was good enough to give me a better insight with the bits and pieces I had on hand.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

John_A_Brown wrote:
I'm mainly retired and time-rich cash-poor.

Do you have a digital scope that you could use for the data acquisition.

 

Failing that, how about making yourself a data acquisition system - maybe based on a Raspberry Pi or suchlike ?

 

I did try googling once for current sense amplifiers with a logarithmic output - ISTR there was a fair few ideas ...

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

All interesting, but any insight on charging my supercap?

 

Four legs good, two legs bad, three legs stable.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:
These are supposedly the bomb:

https://www.kickstarter.com/proj... 

Looks like that kickstarted has now finished.

 

Now order here:  https://www.joulescope.com/?r=ks - only $800; not clear if they're actually shipping yet, or if that's still just pre-orders ... ?

 

BTW, The Otii is $581 from Digikey:  https://www.digikey.com/product-detail/en/qoitech-ab/OTII-ARC-001/1916-1000-ND/8275323

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

John_A_Brown wrote:
any insight on charging my supercap?

isn't that a separate topic ... ?

 

wink

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

A Supercap isn't quite a replacement for a LiPo - internal resistance is quite different, so the Supercap might report your overall runtime a bit low. However, if the supercap in question is something like a Maxwell supercap, then things might be different as these have very low impedance.

 

If you charge your cap with a constant current source, then estimating the amount of charge you put in is a bit easier - linear slope vs exponential curve.

Last Edited: Tue. Feb 4, 2020 - 11:47 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes, I have a digital scope. I have used it before But it's a dynamic range problem again. Also, my digital scope won't let me sample at a fast enough speed for several hours.

 

$800, $581... I'm talking £25 solutions here.

 

 

Four legs good, two legs bad, three legs stable.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

John_A_Brown wrote:
my digital scope won't let me sample at a fast enough speed for several hours.

Hence the sweep - save - repeat suggestion.

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:
Do you have a digital scope that you could use for the data acquisition.
is what Paul operated :

Measuring Microamps & Milliamps at 3 MHz Bandwidth (PJRC)

 

"Dare to be naïve." - Buckminster Fuller

Pages