Shop OBEX P1 Docs P2 Docs Learn Events
How to save battery power? — Parallax Forums

How to save battery power?

ManAtWorkManAtWork Posts: 2,176
edited 2015-01-28 09:47 in Propeller 1
I think I'm quite familiar with propeller programming, but now I have to do my first battery powered project. The application requires that I frequently poll a sensor (once a second or so). This should require as little power as possible. It would be nice if I could survive a year from a 18650 Li cell. In the case activity is detected I have to wake up and perform some actions which require two or three cogs to run at full speed. The "active" time is only around one minute per day, so I think most effort should be put in keeping the standby power low.

I plan to keep the propeller always on but shutdown all cogs except for one and run in RC slow clock mode. What takes less power, WAITCNT or charging an external capacitor and WAITPNE for it to discharge? Precise timing is not required, I just must not miss a trigger event. In active mode I'd switch to XTAL clock mode for better performance.

What voltage regulator would you recommend? When fully charged the Li cell can have up to 4.2V, too much for the propeller. The TS1117 regulator I normally use has too much voltage drop and too much leakage current.

Comments

  • evanhevanh Posts: 15,921
    edited 2014-12-02 00:45
    Could switching to RCFAST suffice instead of having a crystal at all? The PLL power consumption chart looks pretty hungry compared to how low the Prop1 can run.

    5 MHz crystal + 80 MHz PLL looks to be 1 mA before any Cogs are running. Admittedly, that's only about 1% of a full-on 8 Cog burn but how much of that PLL time is full burn?
  • ManAtWorkManAtWork Posts: 2,176
    edited 2014-12-02 02:21
    While active I have to control several actuators or a display that consumes around 100mA average current. So I don't care about 1mA. RCFAST would require calibration and temperature compensation to have predictable timing because the device must operate outdoors at temperatures in the range of -20 to +40°C. A crystal is only 20ct and would help to keep the software simpler.

    A 18650 cell has >2Ah. This would allow for 20h active operation @100mA or one year of standby if consumption is <200µA.
  • max72max72 Posts: 1,155
    edited 2014-12-02 05:10
    If you can run low mode using RC slow there is a great battery saving.
    It could be argued if the other cogs really need be switched off, while the unused pins have to be set.
    Check the forum, there are a lot of threads about that.
    I asked a similar question here:
    http://forums.parallax.com/showthread.php/142124-Low-power-guidelines
    With RCslow and nothing else running you can be in the uA comsuption range.

    Besides the lithium + mcp1700 you can also try using a LiFePO4 battery (nominal voltage 3.3V...)

    Another couple of ideas:
    If you need accurate timing consider a RTC.
    You can the use the 1pps from the RTC to correct the frequency of the prop using RCfast (lonesock made a serial object using on the flight clock change to exploit this very opportunity..).

    Would it be possible to recharge the battery using energy harvesting (solar, vibration, ..)?

    Massimo
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-12-02 07:11
    If you really must operate at -20 degrees centigrade, Lithium batteries are not always the most optimal.

    Consider comparing sub-zero battery operation with various chemistries. And even then, many devices are actually buried in snow in order to raise the operating temperature.

    http://batteryuniversity.com/learn/article/discharging_at_high_and_low_temperatures

    http://www.quora.com/What-is-the-best-battery-technology-for-deep-freezing-temperatures-up-to-minus-30-degree-Celsius

    Consider all the details. Also, you can get 250 to 300 ma voltage regulators that have uA quiescent current. The 1 amp regulators have a much higher quiescent current demand. It is even better to avoid low dropout regulators as the current quiescent currents goes way up in the low dropout region.

    Outdoor cameramen are well aware of Lithium cell failures in snowy frozen conditions. You might see what they prefer to do to solve the problems.
  • ManAtWorkManAtWork Posts: 2,176
    edited 2014-12-02 09:10
    Thanks for the link to the "Low power guidelines" thread. This seems to cover all important issues.

    Energy harvesting is no option here as everything providing more than 10µA charging curent is too big, too expensive or too brittle. I need maintenance once or twice a year anyway so I can change batteries if required.

    I need predictable timing only for communication (serial or servo signal, for example) in active mode. An RTC for exact long term timing is not required.

    I've choosen the 18650 cell because it fits the container (a water tight tube) very well. The one I have is rated to operate down to -20°. I know that capacity decreases and resistance increases at low temperatures. As I don't need peak currents above 0.5A I expect it to be no big problem. If I'm wrong I have to choose a different battery. I plan to run only the propeller on a regulator and connect the higher power loads directly to the battery with a MOSFET switch.

    Startup time is also no issue. So I think there's nothing wrong with cogstop-ing all cogs except one and run it in RCSLOW mode. Some applications will simply wait for a passive (mechanical) switch for wakeup. Some other will require a sensor drawing power. For those I have to wakeup frequently (say once a second), power up the sensor and poll it and go to sleep again. Only when I detect a trigger signal I'll switch to XTAL+PLL mode and startup the other cogs. This only happens once or twice a day so I don't care about the extra mA for the oscillator and PLL.
  • ElectrodudeElectrodude Posts: 1,658
    edited 2014-12-02 09:27
    Does constantly starting and stopping a cog use more power than just letting it sit in a WAITPNE? If it does, you probably don't want to be constantly restarting cogs.
  • Don MDon M Posts: 1,652
    edited 2014-12-02 09:34
    You might consider this as part of your power supply- http://www.pololu.com/product/2122
  • LawsonLawson Posts: 870
    edited 2014-12-02 11:18
    Using an RC circuit on a pin with WAITNE will use 50-100uA as the signal crosses the input threshold. (this is a general property of CMOS inputs) WAITCNT will use much less power.

    Active cogs only use around 1uA at RC slow. I wouldn't bother shutting them down until you're chasing the last few uA of standby current. Another couple of uA can be saved by disabling the internal brownout detector, and using an external TC54 instead.

    I've tested the Micrel MIC5231 and MIC5232 LDO regulators. They do not increase ground current when the input voltage drops below the regulation set-point. If you have many other 3.3v loads, I'd put them on a separate LDO that has a shutdown pin.

    I'd also recommend building a circuit that can measure uA currents and conduct the full load current with minimal resistance. (Google has a few)

    Marty
  • evanhevanh Posts: 15,921
    edited 2014-12-02 11:58
    Hehe, might be a tad bulky but, here's one that's rated for 80% capacity at -45°C - http://en.winston-battery.com/index.php/products/power-battery/item/wb-lyp40aha?category_id=182
  • ManAtWorkManAtWork Posts: 2,176
    edited 2014-12-02 23:33
    Marty, good point. I'll use WAITCNT, then. My battery has an internal protection circuit against deep discharge. It cut's the current when voltage drops below 3.0V so I don't need a brown-out detector.

    Rare earth (Yttrium) batteries? Nobody wants to pay that except military, I think.
  • evanhevanh Posts: 15,921
    edited 2014-12-03 00:59
    Those particular LYP's are actually not too bad price wise, maybe 80% more than same capacity deep cycle lead-acid, which effectively makes them cheaper just on cycle depth alone. They are a China brand so probably don't have the extortion tax applied to the raw materials.

    But, yeah, they are targeted as installation scale batteries. Solar/Wind installs are good examples. Certainly not for portable use.

    They are popular for electric mod'ing of cars, particularly for competition racing. Rip out the petrol engine and fuel tank and shoe-horn in electric motor and battery pack.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-12-03 01:02
    Actually, it seems that generic NiCad can behave better down to -40 degrees. Of course, the energy density is 50% or less than Lithium, so the package would be much bigger. Also, I don't think a NiCad can hold a charge over a year.

    It seems just about everyone starts out select a battery size they like and hopes it will do the job. It is blind luck when it does as most of us just want the project to be very small.

    Why bother with rechargeable secondary batteries at all? Even with lithium chemistries, one-time primary cells have greater power densities?
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2014-12-03 09:11
    For low temperatures I prefer primary LiFeS2 cells. Here from the excellent Energizer app note:
    http://data.energizer.com/PDFs/lithiuml91l92_appman.pdf
    Screen shot 2014-10-15 at 2.32.29 PM.png

    Note that the capacity (~3Ah for AA size) is hardly affected at -40°C, so long as the current is in the neighborhood 25mA or less. Two cells in series can operate a Prop without a regulator, better with a lower brownout setting. And the chemistry is safe, much more so than primary LiSOCL2 (http://www.greenergy-battery.com/Product-2.html).

    In any system like this, no matter what the battery, add lots of capacitance in parallel. The battery impedance increases greatly at low temperatures and that is one of the main limiting factors on performance. If you can store the energy needed for pulses of operation on a capacitor, the battery will perform longer and at much lower temperatures than it would on its own, and it will deliver much more of its rated capacity.
  • LawsonLawson Posts: 870
    edited 2014-12-03 11:09
    Is there any light where your sensor is going? Under natural lighting, http://www.digikey.com/product-detail/en/KXOB22-01X8L/KXOB22-01X8L-ND/4840081 should easily meet your energy needs. In bright high efficency lighting http://www.digikey.com/product-detail/en/AM-1819CA/869-1006-ND/2165191 will work better. Both are pretty small, and will be quite tough if glued to the casing of your sensor.

    Marty
  • JohnR2010JohnR2010 Posts: 431
    edited 2014-12-03 14:04
    Lawson, I'm curious how would you integrate the power from those small solar panels? Are you going to regulate the power? Are you going to use it to charge the battery? Just curious?
  • LawsonLawson Posts: 870
    edited 2014-12-04 16:28
    At these power levels, it's pointless to get fancy. I'd start with just hooking the solar cells to a battery through a diode. (the diode prevents the solar cell from discharging the battery at night, and may not be needed) That's enough for NiCd, NiMH, and probably lead acid batteries. For lithium cells, you'd need some circuit to prevent over-charging and another circuit to cut the load if the battery discharges too much. (Depending on the chip, the lithium ion BMS might already do all this.) Super-capacitors are also an option, but they're 5-10x larger than a battery with comparable energy storage. Super-caps then just need a circuit to prevent over-voltage.

    Marty
  • edited 2014-12-05 00:19
    Here's a crazy idea that might work. Have a look at the CSS555C timer from Custom Silicone solutions. Use that to reset the prop at specific intervals. After rest the prop switches to high speed, does its thing and then stops activity and switches to RCSLOW.

    A variation would be for the prop to run in RCSLOW and wait for a high on a pin. When it senses the high it switches to high speed, loads cogs, does its thing and then reverts to RCSLOW until the next trigger.

    RCSLOW frequency can vary but using the CS555C would give you fairly precise timing.

    Sandy
  • ManAtWorkManAtWork Posts: 2,176
    edited 2015-01-28 09:47
    I have just finished the PCB and my application is up and running. I found out that...

    CLKSET (RCSLOW, 20000) somehow doesn't work. I have to set the clockmode with a literal number, eg. CLKSET (%000_00_001, 20000)

    The first time I measured standby current draw it was 0.2mA. Not bad, but it would limit battery life to less than one year. Then I found out that I had a bug in my code causing it not to tie all unused pins to a defined level. After fixing that current draw was an amazing 8µA. :) Brownout detector is still enabled.

    I use the following code to switch the clock speeds:
    PUB ClockFast
      CLKSET (%011_01_001, slowfrq)
      WaitMs (10) 
      CLKSET (%011_01_101, pllfrq)  ' XTAL1 + PLL4x
    
    PUB ClockSlow 
      CLKSET (%000_00_001, slowfrq) 
    

    I had to modify my wait function because 10ms would be less than 384 clocks in RCSLOW mode
    PRI WaitMs (t)
      t*= clkfreq/1000
      t#>= 400
      waitcnt (t + CNT)
    

    BTW, I have decided to use a 3V CR123 battery instead of a rechargable cell. It eliminates the need of a voltage regulator and I think that more devices get damaged or stolen before the higher cost of the rechargable battery gets a chance to be profitable.
Sign In or Register to comment.