EmbeddedRelated.com
Forums
The 2026 Embedded Online Conference

measuring current consumption in uC with very low power modes

Started by blisca November 4, 2014
Hi to all,

often i have to measure the current absorbed by small circuits,in 
battery appplications
Normally i deal with consumptions big as 20mA in run mode and 2uA in 
sleep mode.

One method that sometimes i use is to desconnect the battery,leaving the 
circuit feeded only by a 10,000 uF capacitor,seldom and quickly measured 
by an high impedence multimeter,(of course not a 10 Mohm oscilloscope 
probe).Measuring the difference in voltage at a specified times i can 
calculate the consumption.The cap was previously measured,to avoid 
tolerance error.

More often i need a more immediate measurement,so i feed the circuit by 
a commutator switch,in parallel to 1,10 and 100 ohm shunt resistors.
The latter is constantly inserted so that the circuit is not completely 
relying on itself during commutations.
When the uc goes to sleep and i need to have an hopefully realistic 
rading of few uA i switch on the 100 ohm shunt,the voltage drop between 
battery and circuit is below the mV,therefore irrelevant.
The voltage is read by a 6 and half digit DMM via a 60cm(2 ft)twisted wire.

Is this a good method or others can be better?

Is there any advantage using an instrumentation op amp as buffer or 
amplifier, wired very closely to the shunt?

Many thanks for your attention

Diego


On 2014-11-04, blisca <blisca@tiscali.it> wrote:
> > Is there any advantage using an instrumentation op amp as buffer or > amplifier, wired very closely to the shunt?
Have you considered an op-amp voltage follower around your sense resistor, e.g. http://andrews.freeshell.org/news/20141104.cae.pdf Since the op-amp compensates for the voltage drop the resistor and that drop can be a lot greater and easier to measure accurately. -- Andrew Smallshaw andrews@sdf.lonestar.org
On Tue, 04 Nov 2014 17:38:01 +0100, blisca wrote:

> Hi to all, > > often i have to measure the current absorbed by small circuits,in > battery appplications Normally i deal with consumptions big as 20mA in > run mode and 2uA in sleep mode. > > One method that sometimes i use is to desconnect the battery,leaving the > circuit feeded only by a 10,000 uF capacitor,seldom and quickly measured > by an high impedence multimeter,(of course not a 10 Mohm oscilloscope > probe).Measuring the difference in voltage at a specified times i can > calculate the consumption.The cap was previously measured,to avoid > tolerance error. > > More often i need a more immediate measurement,so i feed the circuit by > a commutator switch,in parallel to 1,10 and 100 ohm shunt resistors. > The latter is constantly inserted so that the circuit is not completely > relying on itself during commutations. > When the uc goes to sleep and i need to have an hopefully realistic > rading of few uA i switch on the 100 ohm shunt,the voltage drop between > battery and circuit is below the mV,therefore irrelevant. > The voltage is read by a 6 and half digit DMM via a 60cm(2 ft)twisted > wire. > > Is this a good method or others can be better? > > Is there any advantage using an instrumentation op amp as buffer or > amplifier, wired very closely to the shunt? > > Many thanks for your attention > > Diego
I'm taking the liberty of cross-posting this to sci.electronics.design, because this is really an electronics question, not an embedded question. I think you'll get more answers from there, and many of them will even be good ones. I think your commutation idea will suffer in accuracy if the load is fairly stiff in voltage -- like if you're driving a capacitor. In that case the current with the low resistance switched in will be higher than without. If the circuit is otherwise isolated, the best way to do the measurement may be to put your 100 ohm resistor between the circuit ground and the negative terminal of the battery, then amplify its voltage by 10 or 100 using a chopper-stabilized op-amp. Then you can just read the voltage and scale it appropriately to current. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
blisca wrote:

> Hi to all, > > often i have to measure the current absorbed by small circuits,in > battery appplications > Normally i deal with consumptions big as 20mA in run mode and 2uA in > sleep mode. > > One method that sometimes i use is to desconnect the battery,leaving the > circuit feeded only by a 10,000 uF capacitor,seldom and quickly measured > by an high impedence multimeter,(of course not a 10 Mohm oscilloscope > probe).Measuring the difference in voltage at a specified times i can > calculate the consumption.The cap was previously measured,to avoid > tolerance error. > > More often i need a more immediate measurement,so i feed the circuit by > a commutator switch,in parallel to 1,10 and 100 ohm shunt resistors. > The latter is constantly inserted so that the circuit is not completely > relying on itself during commutations. > When the uc goes to sleep and i need to have an hopefully realistic > rading of few uA i switch on the 100 ohm shunt,the voltage drop between > battery and circuit is below the mV,therefore irrelevant. > The voltage is read by a 6 and half digit DMM via a 60cm(2 ft)twisted > wire. > > Is this a good method or others can be better? > > Is there any advantage using an instrumentation op amp as buffer or > amplifier, wired very closely to the shunt? > > Many thanks for your attention > > Diego
Have a browse around on Jack Ganssle's web-site at <http://www.ganssle.com/> as I know Jack has had an article or two about microprocessor current measurements (even for the lowest power ones). There is certainly a reference to the article in one of his Muses. -- ******************************************************************** Paul E. Bennett IEng MIET.....<email://Paul_E.Bennett@topmail.co.uk> Forth based HIDECS Consultancy.............<http://www.hidecs.co.uk> Mob: +44 (0)7811-639972 Tel: +44 (0)1235-510979 Going Forth Safely ..... EBA. www.electric-boat-association.org.uk.. ********************************************************************
Il 04/11/2014 23:25, Paul E Bennett ha scritto:
> blisca wrote: > >> Hi to all, >> >> often i have to measure the current absorbed by small circuits,in >> battery appplications >> Normally i deal with consumptions big as 20mA in run mode and 2uA in >> sleep mode. >>.....
>> >> Is this a good method or others can be better? >> >> Is there any advantage using an instrumentation op amp as buffer or >> amplifier, wired very closely to the shunt? >> >> Many thanks for your attention >> >> Diego > > Have a browse around on Jack Ganssle's web-site at <http://www.ganssle.com/> > as I know Jack has had an article or two about microprocessor current > measurements (even for the lowest power ones). There is certainly a > reference to the article in one of his Muses. >
Thank you for all the good immediate hints,as the one of the compensating buffer and for the suggested links . Sadly in last years i'm spending so much time working head down that i have few or no time to learn from useful sites,but once more it looks like it's worth it Forgive me if the topic is not strictly inherent to the group, thanks for crossposting. Diego
In article <m3cqoq$24l$1@speranza.aioe.org>, blisca@tiscali.it says...
> > Il 04/11/2014 23:25, Paul E Bennett ha scritto: > > blisca wrote: > > > >> Hi to all, > >> > >> often i have to measure the current absorbed by small circuits,in > >> battery appplications > >> Normally i deal with consumptions big as 20mA in run mode and 2uA in > >> sleep mode. > >>..... > > >> > >> Is this a good method or others can be better? > >> > >> Is there any advantage using an instrumentation op amp as buffer or > >> amplifier, wired very closely to the shunt? > >> > >> Many thanks for your attention > >> > >> Diego > > > > Have a browse around on Jack Ganssle's web-site at <http://www.ganssle.com/> > > as I know Jack has had an article or two about microprocessor current > > measurements (even for the lowest power ones). There is certainly a > > reference to the article in one of his Muses. > > > > Thank you for all the good immediate hints,as the one of the > compensating buffer and for the suggested links . > > Sadly in last years i'm spending so much time working head down that i > have few or no time to learn from useful sites,but once more it looks > like it's worth it > > Forgive me if the topic is not strictly inherent to the group, > thanks for crossposting.
Well I have designed various current sensors even just using resistive depending on requirements of accuracy for several embedded projects. Power run ground shunts can be a pain with having a real ground and majority that has to be elevated some micro to milli volts and keeping them isolated. At micro amp ranges a finger bridge the ground and pseudo ground can affect results in some circumstances. For supply monitoring I use all sorts but if I have a small negative rail available I tend to use AD628 for this especially if you need high common mode isolation. I have found shunt 3 resistors and 1 cap it works well. Easy to scale for ADC input as two difference amplifier. -- Paul Carpenter | paul@pcserviceselectronics.co.uk <http://www.pcserviceselectronics.co.uk/> PC Services <http://www.pcserviceselectronics.co.uk/pi/> Raspberry Pi Add-ons <http://www.pcserviceselectronics.co.uk/fonts/> Timing Diagram Font <http://www.badweb.org.uk/> For those web sites you hate
On 11/5/2014 4:31 AM, blisca wrote:
> Il 04/11/2014 23:25, Paul E Bennett ha scritto: >> blisca wrote: >> >>> Hi to all, >>> >>> often i have to measure the current absorbed by small circuits,in >>> battery appplications >>> Normally i deal with consumptions big as 20mA in run mode and 2uA in >>> sleep mode. >>> ..... > >>> >>> Is this a good method or others can be better? >>> >>> Is there any advantage using an instrumentation op amp as buffer or >>> amplifier, wired very closely to the shunt? >>> >>> Many thanks for your attention >>> >>> Diego >> >> Have a browse around on Jack Ganssle's web-site at >> <http://www.ganssle.com/> >> as I know Jack has had an article or two about microprocessor current >> measurements (even for the lowest power ones). There is certainly a >> reference to the article in one of his Muses. >> > > Thank you for all the good immediate hints,as the one of the > compensating buffer and for the suggested links . > > Sadly in last years i'm spending so much time working head down that i > have few or no time to learn from useful sites,but once more it looks > like it's worth it > > Forgive me if the topic is not strictly inherent to the group, > thanks for crossposting.
Just in case you didn't realize, the replies in s.e.d didn't get cross posted to this group. So you will need to look in s.e.d to read them. -- Rick
On Tue, 04 Nov 2014 13:24:15 -0600, Tim Wescott
<seemywebsite@myfooter.really> wrote:

>On Tue, 04 Nov 2014 17:38:01 +0100, blisca wrote: > >> Hi to all, >> >> often i have to measure the current absorbed by small circuits,in >> battery appplications Normally i deal with consumptions big as 20mA in >> run mode and 2uA in sleep mode. >> >> One method that sometimes i use is to desconnect the battery,leaving the >> circuit feeded only by a 10,000 uF capacitor,seldom and quickly measured >> by an high impedence multimeter,(of course not a 10 Mohm oscilloscope >> probe).Measuring the difference in voltage at a specified times i can >> calculate the consumption.The cap was previously measured,to avoid >> tolerance error. >> >> More often i need a more immediate measurement,so i feed the circuit by >> a commutator switch,in parallel to 1,10 and 100 ohm shunt resistors. >> The latter is constantly inserted so that the circuit is not completely >> relying on itself during commutations. >> When the uc goes to sleep and i need to have an hopefully realistic >> rading of few uA i switch on the 100 ohm shunt,the voltage drop between >> battery and circuit is below the mV,therefore irrelevant. >> The voltage is read by a 6 and half digit DMM via a 60cm(2 ft)twisted >> wire. >> >> Is this a good method or others can be better? >> >> Is there any advantage using an instrumentation op amp as buffer or >> amplifier, wired very closely to the shunt? >> >> Many thanks for your attention >> >> Diego > >I'm taking the liberty of cross-posting this to sci.electronics.design, >because this is really an electronics question, not an embedded question. >I think you'll get more answers from there, and many of them will even be >good ones. > >I think your commutation idea will suffer in accuracy if the load is >fairly stiff in voltage -- like if you're driving a capacitor. In that >case the current with the low resistance switched in will be higher than >without. > >If the circuit is otherwise isolated, the best way to do the measurement >may be to put your 100 ohm resistor between the circuit ground and the >negative terminal of the battery, then amplify its voltage by 10 or 100 >using a chopper-stabilized op-amp. Then you can just read the voltage and >scale it appropriately to current.
OPs method makes a lot of sense where the average current is a lot lower than the maximum current. Many low power uPs have sleep modes where they only run about 1 percent of the time; the rest of the time only timers and such run. Greatly reducing average power and making measurement much more difficult. ?-)
On Tuesday, November 4, 2014 11:38:08 AM UTC-5, blisca wrote:
> Hi to all, > > often i have to measure the current absorbed by small circuits,in > battery appplications > Normally i deal with consumptions big as 20mA in run mode and 2uA in > sleep mode. > > One method that sometimes i use is to desconnect the battery,leaving the > circuit feeded only by a 10,000 uF capacitor,seldom and quickly measured > by an high impedence multimeter,(of course not a 10 Mohm oscilloscope > probe).Measuring the difference in voltage at a specified times i can > calculate the consumption.The cap was previously measured,to avoid > tolerance error. > > More often i need a more immediate measurement,so i feed the circuit by > a commutator switch,in parallel to 1,10 and 100 ohm shunt resistors. > The latter is constantly inserted so that the circuit is not completely > relying on itself during commutations. > When the uc goes to sleep and i need to have an hopefully realistic > rading of few uA i switch on the 100 ohm shunt,the voltage drop between > battery and circuit is below the mV,therefore irrelevant. > The voltage is read by a 6 and half digit DMM via a 60cm(2 ft)twisted wire. > > Is this a good method or others can be better? > > Is there any advantage using an instrumentation op amp as buffer or > amplifier, wired very closely to the shunt? > > Many thanks for your attention > > Diego
Hi Diego - See STMicro's AN3413 for some ideas: http://www.st.com/web/en/resource/technical/document/application_note/DM00031738.pdf The STM discovery board for the STM32L0 very-low-power ARM M0 includes this circuit. Uses a switchable shunt and measurement on the high side, controlled by the micro. It starts a measurement, sleeps for a while, wakes up and measures a cap... Hope that helps! Best Regards, Dave
On 11/10/2014 11:30 AM, Dave Nadler wrote:
> On Tuesday, November 4, 2014 11:38:08 AM UTC-5, blisca wrote: >> Hi to all, >> >> often i have to measure the current absorbed by small circuits,in >> battery appplications >> Normally i deal with consumptions big as 20mA in run mode and 2uA in >> sleep mode. >> >> One method that sometimes i use is to desconnect the battery,leaving the >> circuit feeded only by a 10,000 uF capacitor,seldom and quickly measured >> by an high impedence multimeter,(of course not a 10 Mohm oscilloscope >> probe).Measuring the difference in voltage at a specified times i can >> calculate the consumption.The cap was previously measured,to avoid >> tolerance error. >> >> More often i need a more immediate measurement,so i feed the circuit by >> a commutator switch,in parallel to 1,10 and 100 ohm shunt resistors. >> The latter is constantly inserted so that the circuit is not completely >> relying on itself during commutations. >> When the uc goes to sleep and i need to have an hopefully realistic >> rading of few uA i switch on the 100 ohm shunt,the voltage drop between >> battery and circuit is below the mV,therefore irrelevant. >> The voltage is read by a 6 and half digit DMM via a 60cm(2 ft)twisted wire. >> >> Is this a good method or others can be better? >> >> Is there any advantage using an instrumentation op amp as buffer or >> amplifier, wired very closely to the shunt? >> >> Many thanks for your attention >> >> Diego > > Hi Diego - See STMicro's AN3413 for some ideas: > http://www.st.com/web/en/resource/technical/document/application_note/DM00031738.pdf > > The STM discovery board for the STM32L0 very-low-power > ARM M0 includes this circuit. Uses a switchable shunt > and measurement on the high side, controlled by the micro. > It starts a measurement, sleeps for a while, wakes up > and measures a cap...
Interesting approach. I'm not sure what the point of this is as opposed to the user measuring the shunt voltage with a meter. -- Rick
The 2026 Embedded Online Conference