How to: power consumption of intermittent, spikey projects

Go To Last Post
60 posts / 0 new

Pages

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

In one project we used a supercap as a backup power source in case of a line power loss.

In that project we used a series diode and a current limiting resistor to prevent a full discharged SC from overloading the 5v power supply.  YMMV

the LOP alarm (555 and piezo buzzer) would chirp for many hours.

Jim

 

 

 

 

 

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

Just thinking out aloud...

 

10uA to 100mA range. So 10,000:1. If we go for 1uA resolution we need 100,000:1 dynamic range and it's around 17 bits; trim that to 65536:1 and we have 16 bits. 16 bit ADCs are in audio territory and can be cheaply had with 48kHz sampling aka 21us.

 

So a current sense resistor strapped across the differential inputs of an audio ADC and we have an output datastream representing our current. Feed that into an AVR and we now have a serial ascii stream of our current. Feed that into Excel via an FTDI chip and you have all the graphing and integration you need.

#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

There's an interrupt at 5S 10mS, 5S 10mS...

Am I reading this  correctly, you have a 10 mSec duration ISR running every 5 Seconds?

 

Does that ISR use the 100+ mA, vs the fractions of a uA in between?

 

With such a huge dynamic range just looking at the duty cycle for the high current operations will likely give you a good lower estimate of the current usage, (battery drain).

(This measurement omits the low current mode usage.)

 

Then, using an over simplification, just add in the current drain for the low power mode as if it was continuous, the entire time, (an overestimate), (i.e. assume no high current mode).

Add that to the high current calculations. and you have a good upper limit of the current usage, (battery drain.).

 

Actually subtracting out the high current usage time from the low current usage time as if it were continuous is likely to be a small number, and besides you are getting upper and lower bounds for the device by using the above technique.

 

Given that you want "hard numbers", and that I've not used the cap method to measure current/power/energy/whatever, a few thoughts still came to mind.

 

You will likely want to hook up your Supercap to a resistor and use your O'scope to measure the RC discharge curve (time). 

The reason to do that is because the 5 F supercap has a wide variation in its actual capacitance.

You can measure your resistor's "exact" resistance, (or use a 1% part, etc.), which is far more accurate that the "5 F" rating.

With a known R, and a nice RC discharge curve, you can calculate the actual capacitance of your cap, (to within the accuracy of the R, V and O'scope measurements).

 

You will, if I understand the overall approach, need that "exact" cap value, to make your energy usage calculations.

 

Your question of how to charge the cap seemed odd.

Am I missing something?

I'd attach it to a power supply with a series resistor.

The series resistor will limit the (essentially a short circuit) inrush current as the cap begins to charge.

How big?

Don't know, I don't have a napkin at hand to do some calc's… (smirk).

Start with a big R and your O'scope  and your power supply.

Who care if it takes 5 minutes to charge the cap, you mentioned a 6 hour discharge interval for your test.

(In rush current = V/R, as one assumes the cap is 0 ohms, so easy to decide how much current you want.)

Then use the RC time constant to estimate how long it will take to charge up to 99.whatever % of the Vsupply voltage.

 

You can use a SPDT manual switch or a relay, to disconnect the power supply and its resistor from the cap, and connect the cap to the device under test.

Flip the switch and start your timer.

 

I can make any project more complex...

So I'd use a micro with a display and have the display show me the time and the voltage on the cap, (and control the relay).

(If the micro has the ADC resolution needed for the Cap voltage measurement then this is trivial, otherwise you need to add an external 12 Bit, 14 bit, 16 bit … ADC)

 

With a few more lines of code the micro can capture and display the time when the cap hit your desired threshold voltage, as well as show real-time (sampled) measurements of the voltage as it decays, and of course show you the initial voltage.)

 

Since it seems that you want some pretty "good" data involving low current (low energy) measurements, you will also want to make a list of errors in the measurement process.

Some that come to mind are the accuracy of:

 

Supercap capacitance measurement

Cap voltage measurements, (initial voltage, trip threshold, etc.)

Cap self discharge rate, (with no load attached)

Energy used by the ADC to make its measurements, (obviously varies with how frequently you take a measurement)

The actual current, baseline and peaks, of the device under test, as a function of the variable Vcc, (as the Supercap discharges)

 

Each one of these factors can be individually accounted for.

For example with this setup you could take some current measurements near the Vcc = 4.whatever, and again at the Vcc = 3.whatever voltage, to see how they compare, and then estimate its impact on your overall measurement accuracy.

Then run the test over the full discharge voltage range, for a longer time and better "averaging" etc.

 

Sounds like a weekend project! wink

 

JC

 

Edit: Typos

Last Edited: Tue. Feb 4, 2020 - 08:02 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

DocJC wrote:

There's an interrupt at 5S 10mS, 5S 10mS...

Am I reading this  correctly, you have a 10 mSec duration ISR running every 5 Seconds?

 

I sometimes have an LED that I flash for 10mS every 5 seconds.

 

 

Does that ISR use the 100+ mA, vs the fractions of a uA in between?

No. It uses about 16mA.

 

With such a huge dynamic range just looking at the duty cycle for the high current operations will likely give you a good lower estimate of the current usage, (battery drain).

(This measurement omits the low current mode usage.)

 

Then, using an over simplification, just add in the current drain for the low power mode as if it was continuous, the entire time, (an overestimate), (i.e. assume no high current mode).

Add that to the high current calculations. and you have a good upper limit of the current usage, (battery drain.).

 

Actually subtracting out the high current usage time from the low current usage time as if it were continuous is likely to be a small number, and besides you are getting upper and lower bounds for the device by using the above technique.

 

Given that you want "hard numbers", and that I've not used the cap method to measure current/power/energy/whatever, a few thoughts still came to mind.

 

You will likely want to hook up your Supercap to a resistor and use your O'scope to measure the RC discharge curve (time). 

Planning on doing that.

The reason to do that is because the 5 F supercap has a wide variation in its actual capacitance.

You can measure your resistor's "exact" resistance, (or use a 1% part, etc.), which is far more accurate that the "5 F" rating.

With a known R, and a nice RC discharge curve, you can calculate the actual capacitance of your cap, (to within the accuracy of the R, V and O'scope measurements).

 

You will, if I understand the overall approach, need that "exact" cap value, to make your energy usage calculations.

 

Your question of how to charge the cap seemed odd.

Am I missing something?

I'd attach it to a power supply with a series resistor.

That's what I was planning on doing, seems fairly safe to charge a 5.5V cap from 5V via a resistor. Constant current would likely need a higher voltage to be viable.

The series resistor will limit the (essentially a short circuit) inrush current as the cap begins to charge.

How big?

Don't know, I don't have a napkin at hand to do some calc's… (smirk).

Start with a big R and your O'scope  and your power supply.

Who care if it takes 5 minutes to charge the cap, you mentioned a 6 hour discharge interval for your test.

(In rush current = V/R, as one assumes the cap is 0 ohms, so easy to decide how much current you want.)

Then use the RC time constant to estimate how long it will take to charge up to 99.whatever % of the Vsupply voltage.

 

You can use a SPDT manual switch or a relay, to disconnect the power supply and its resistor from the cap, and connect the cap to the device under test.

Flip the switch and start your timer.

I was planning on using an N FET to switch the charging.

 

I can make any project more complex...

So I'd use a micro with a display and have the display show me the time and the voltage on the cap, (and control the relay).

(If the micro has the ADC resolution needed for the Cap voltage measurement then this is trivial, otherwise you need to add an external 12 Bit, 14 bit, 16 bit … ADC)

 

With a few more lines of code the micro can capture and display the time when the cap hit your desired threshold voltage, as well as show real-time (sampled) measurements of the voltage as it decays, and of course show you the initial voltage.)

 

Since it seems that you want some pretty "good" data involving low current (low energy) measurements, you will also want to make a list of errors in the measurement process.

Some that come to mind are the accuracy of:

 

Supercap capacitance measurement

Cap voltage measurements, (initial voltage, trip threshold, etc.)

Cap self discharge rate, (with no load attached)

Energy used by the ADC to make its measurements, (obviously varies with how frequently you take a measurement)

The actual current, baseline and peaks, of the device under test, as a function of the variable Vcc, (as the Supercap discharges)

 

Each one of these factors can be individually accounted for.

For example with this setup you could take some current measurements near the Vcc = 4.whatever, and again at the Vcc = 3.whatever voltage, to see how they compare, and then estimate its impact on your overall measurement accuracy.

Then run the test over the full discharge voltage range, for a longer time and better "averaging" etc.

 

Sounds like a weekend project! wink

 

JC

 

Edit: Typos

Thanks for the thoughts.

I am really just hoping to validate the readings I made with the coulomb counter. Since this thing is supposed to last for over a year with a 3AH battery, I am just seeking reassurance that my calculations/measurements are in the ballpark. I don't have a year to wait to check this out.

 

 

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

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

Am I reading this  correctly, you have a 10 mSec duration ISR running every 5 Seconds?

 

I sometimes have an LED that I flash for 10mS every 5 seconds.

 

To clarify, the ISR takes very little time(LED off/on, set timer for next IRQ). But once woken, the chip takes some time to go back to sleep.

 

 

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

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

I plan on using an ESP8266 module to read the voltage periodically,

Make sure your voltage dividers, ADC inputs, etc don't add micromps of loading, or it will throw off measuring your actual microamp DUT load profile. 

If your monitoring burden can't be reduced, at least you can account for it in the results.

 

You didn't state exactly what you hope to measure...total joules consumed? Avg current? Peak Current?  

Are you doing this to try to estimate battery life?  Of course, applying an actual battery at some point is always recommended (at least for sanity check).

 

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

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

avrcandies wrote:

I plan on using an ESP8266 module to read the voltage periodically,

Make sure your voltage dividers, ADC inputs, etc don't add micromps of loading, or it will throw off measuring your actual microamp DUT load profile. 

If your monitoring burden can't be reduced, at least you can account for it in the results.

Yes. Will either account for it, or use another FET switch.

You didn't state exactly what you hope to measure...total joules consumed? Avg current? Peak Current?  

Are you doing this to try to estimate battery life?  Of course, applying an actual battery at some point is always recommended (at least for sanity check).

I have run on a battery(1000mAH) for several days at a time, but this tells me very little, as I'm looking for over a year on 3AH.

 

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

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

 but this tells me very little, as I'm looking for over a year on 3AH.

Be careful, or self-discharge will tell you very much bad news.  For example, NI-MH discharges about 20% per month (if I recall correctly).  Make sure you analyze & account for this factor into any long-term predictions.

 

You can also hook up 10 units together to help speed up testing,taking into account all of the relevant factors (usually reducing current by 10x gives more than a 10x life improvement, neglecting self-discharge).

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

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

The battery will be a primary cell, probably Lithium Thionyl Chloride. I'm not over concerned about self discharge.
Ten units? I have two. The client has the third, and more modules will come from China, which has its own problems right now.

Thanks again for all the suggestions.

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

Pages