Shop OBEX P1 Docs P2 Docs Learn Events
Battery Power Endurance — Parallax Forums

Battery Power Endurance

slamzeeslamzee Posts: 8
edited 2008-11-25 00:46 in BASIC Stamp
Is there any data on how long the BS2 can run on the 9V battery? I'm working on a stand alone humidity sensor for my cigar humidor, but it only seems to run two days before quitting. I'm wondering if the status led I am using is draining it too fast, or the SHT11 sensor is, or if the stamp just doesn't run that long on batteries.

Any hints?

Comments

  • Tracy AllenTracy Allen Posts: 6,662
    edited 2008-11-24 17:16
    The BS2 can run for much longer than 2 days on a 9V, provided you make good use of the SLEEP command and also eliminate other power hogs. The SHT11 itself is very low power, and the status LED should be a super-bright type only needs to blink occasionally, like 20 milliseconds out of every 10 seconds. You should be running this using the BS2 built-in voltage regulator on the Vin pin. Some (but not all) external voltage regulators are not as efficient as you need for micropower operation. You should be able to get at least 6 months, probably more, out of a good 9V battery.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • slamzeeslamzee Posts: 8
    edited 2008-11-24 17:21
    Thanks, great information here. I was running the LED off the Vss side, so I will switch this. I haven't heard of the SLEEP command, but I will dive into it. Thanks so much.
  • Beau SchwabeBeau Schwabe Posts: 6,563
    edited 2008-11-24 17:22
    slamzee,

    It depends on the capacity (mAh rating) of the battery, and how much current your BS2 plus external circuitry requires.

    I have seen 9V batteries with capacities ranging from 150mAh to 450mAh, and much higher with some of the newer LiFePO4 9V battery versions.


    First, you need to find out how much current the BS2 and any external circuitry requires. A simple way to get a ballpark value is to place a 10 Ohm or less resistor in series with the power supply to the BS2 and other electronics and measure the voltage across the series resistor.

    I = V / R

    So for example if you measured 0.7 Volts across a 10 Ohm resistor, the current would be about 70mA

    I = 0.7V / 10 = 0.07 or 70mA


    If your 9V battery is rated for 450mAh, then at 70mA you could expect about 6 and a half hours of use.

    450mAh / 70mA = 6.43 hours



    There are several things that you can do to conserve power. Aside from the design, one of the most effective is power management. For example, instead of your sensor reading 24/7 take a reading every 5 seconds, but go into a lower power mode in-between readings. Using this method, even if it takes 1 second to take the reading, you have 4 seconds of low power mode... or 20% of the time you are using high power as opposed to 100% ... that alone can increase your run time by a factor of almost 5 times.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • slamzeeslamzee Posts: 8
    edited 2008-11-24 17:31
    According the the component data sheets; The SHT11 draws 2-5 microwatts in sleep mode, and 3 when its measuring. They also mention 150 microwatts as an average, although that doesn't seem to make sense. The LED draws 20ma.

    The Duracell 9V Battery shows 550mAh.

    I have forgotten my old PIE formulas, so I'm not sure how all that adds up.
  • slamzeeslamzee Posts: 8
    edited 2008-11-24 17:58
    Sorry for the noob question, but how do I run the LED off the Vin? Vin is the supply straight from the battery right? So I'd need a connect a resistor to the positive leg, and then the other leg to something like P3?
  • Tracy AllenTracy Allen Posts: 6,662
    edited 2008-11-24 18:56
    Run the LED not from Vin but from a Stamp pin, with a resistor of around 300 ohms in series.
    Stamp pin p0  ---/\/\---->|-------- Vss
    


    Pin p0 shown for example. Then status is indicated by pulsing the pin. Flash the LED for 10 milliseconds, and with the 300 ohm resistor it will draw about 12 milliamps during the pulse, and zero otherwise. Suppose you flash the LED for 10 milliseconds once about every 2 seconds, in a loop something like this:
    DO
    HIGH 0 : PAUSE 10 : LOW 0   ' active at 20 milliamps for 10 milliseconds, flash LED
    NAP 7   ' sleeps 2.3 seconds at 50 microamps
    LOOP
    



    NAP puts the Stamp into its lowest power mode, where it will draw less than 50 microamps (see "NAP" the manual or the help screen). Then the total current drain is the average over time:
    When NAPping for 2300 milliseconds: 0.05 mA tops, assuming all other current drains have been quashed.
    When active for 10 milliseconds: 12 mA for the LED + 8 mA for the Stamp = 20 mA
    Then time average:
    (2300 * 0.05 + 10 * 20)/2310 = 0.136 mA
    On a 9V battery with a capacity of 300 mA-hr, the life then should be about
    300 / 0.136 = 2205 hours = 91 days.

    A lot depends on how often you need to flash that LED. Better even if you use a high efficiency LED that can be seen clearly at 5 mA.

    The Sensirion draws almost negligible current, only 0.5 mA when active and less than 0.001 mA when inactive. They use a time weighted average to come up with an average current, assuming you would only need to make a measurement once per second. The humidor probably doesn't need a measurement more than once per minute. That would be good, because it takes the Sensirion about 0.25 seconds to return a 14 bit reading, so you save power if you don't need to read it as often. The trick is to understand time averaged power.

    Are you running the Stamp by itself, or is it mounted on board such as the BOE? The Stamp itself has a very efficient, micropower 5 volt regulator., but the BOE does not.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • slamzeeslamzee Posts: 8
    edited 2008-11-24 19:09
    Got it. 91 days still seems a bit short. I wonder if 4 AA's would last longer? I can calculate this based on the math example you gave. Thanks!

    I am using the BOE to prototype the idea. I guess with this data, my next step it to order a BS2 and carrier board to wire up more of what the OEM board might be like.
  • Beau SchwabeBeau Schwabe Posts: 6,563
    edited 2008-11-24 20:03
    slamzee,

    4 AA's would last longer since you can get them in much higher mAh capacities (2500+ mAh), but be careful... 6V is very close to the input threshold requirement for a 5V regulator.· It would be better to used a 5th AA battery in this case.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • sylvie369sylvie369 Posts: 1,622
    edited 2008-11-24 20:31
    You might find this document of interest:

    http://www.duracell.com/oem/Pdf/others/ATB-full.pdf

    Page 8 has a table showing rated capacities of various sizes of the standard Duracell Alkaline batteries. AA cells are rated at 2850 mAH while the standard 9V battery is rated at 580 mAH. If you're willing to take up·considerably more space (and in your application, why not?), C or D cells should give you quite a bit more working life than the AA cells (though adding a 5th C or D cell is quite a bit more onerous than adding a 5th AA).

    Of course these are all just standard alkalines, and there are many more options in each battery size. I'm just starting to learn about this battery capacity stuff, and I was pretty surprised at how little capacity 9V batteries have in comparison with the other standard sizes.
  • Carl HayesCarl Hayes Posts: 841
    edited 2008-11-24 21:30
    Tracy Allen said...
    Run the LED not from Vin but from a Stamp pin, with a resistor of around 300 ohms in series.
    How bright do you need your flashes to be?· I typically use 1000 ohms in series with most LEDs.· Plenty bright for these old eyes.· But I would use a wall-wart supply for a project like this and not worry about batteries.

    Tracy's earlier remark about some regulators being more efficient than others is emphatically true.· I have recently built several identical devices, each with a Stamp and a 7805 regulator (among·other things like a clock and a display).· These boards are absolutely identical except that two of the 7805s came from Radio Shack and the other three came from Mouser.· The ones from Mouser (they're Fairchild devices) barely get warm to the touch, while the ones from Radio Shack will burn your fingers.· So the Radio Shack 7805s must be shunting a lot of waste current to ground.· This was a considerable surprise to me -- I thought all 7805s were the same.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    · -- Carl, nn5i@arrl.net
  • slamzeeslamzee Posts: 8
    edited 2008-11-24 21:47
    Thanks Tracy -

    I'm trying to make this a portable application, so wall transformers aren't going to work. The flashes question is what I am trying to sort out. For example, I was flashing once per 10% of humidity. But maybe I should flash once every 30 seconds when conditions are good, and every 3 seconds when you need to add moisture? All good choices, but I guess I need to think if battery life is more important than information.

    Seems like the smoke detector approach might be the best. Flashing fast to get attention.

    There are some nice 6 AA holders at Jameco - I think I'll try that with a more basic board. Since I'm getting such great help in this forum - what is the best board to attach my sht11 and led to easily and cheaply?

    Thanks tons to all!
  • Carl HayesCarl Hayes Posts: 841
    edited 2008-11-24 22:04
    slamzee said...
    According the the component data sheets; The SHT11 draws 2-5 microwatts in sleep mode, and 3 when its measuring. They also mention 150 microwatts as an average, although that doesn't seem to make sense. The LED draws 20ma.

    The Duracell 9V Battery shows 550mAh.

    I have forgotten my old PIE formulas, so I'm not sure how all that adds up.
    I just looked at a data sheet for SHT11, and it said 550 μΑ while measuring, 3-5 μΑ when not measuring.· You may assume the current drawn from the battery is of the same order, even though there's a regulator between the two.· Assume, also, that you're measuring about 1% of the time, and take 10μA as the average current for the SHT11.· The SHT11, then, will draw down a 500mAH battery in about 50,000 hours, or·a little less than 6 years.

    I think you can ignore the SHT11 in figuring your energy requirement.· Base it on the current for the Stamp, plus the current for the LED.

    If you're going to dedicate a Stamp anyway, why not use three LEDs on different outputs, and infrequent short flashes.· If all is OK, flash the green one.· If marginal, flash the yellow one.· If the darned thing is drying out, flash red.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    · -- Carl, nn5i@arrl.net
  • slamzeeslamzee Posts: 8
    edited 2008-11-24 22:15
    I actually have a tricolor led in the design now, with that in mind. you went with the stop light analogy, which is good. I have thought about a system with even more colors, but who can really remember all those. For example, who really knows the Federal Emergency level color code - and I think that has just five colors. lol Thanks for the input.

    I was also thinking of putting bluetooth on it to interface with your phone, or even wifi. but I think that is all over kill. This is more like a plant water reminder and should just "wave it's arms" when it needs help.
  • Carl HayesCarl Hayes Posts: 841
    edited 2008-11-24 22:24
    Incidentally, different Stamps have wildly different current requirements, too. For this project I'd choose a Stamp based on that, even if I didn't have that model and had to go buy it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    · -- Carl, nn5i@arrl.net
  • SRLMSRLM Posts: 5,045
    edited 2008-11-24 23:38
    I think the bluetooth would be more trouble then it's worth: if you're close enough to get the signal, you're probably right around the corner. Plus, the EmbeddedBlue module has the following current consumption:

    35 ma at 115.2 kbps
    25 ma at 9.6 kbps
    8 ma at idle
    3 ma at no connection


    If you want remote notification, seems like an email or text message would be the way to go.
  • Tracy AllenTracy Allen Posts: 6,662
    edited 2008-11-25 00:16
    I concur with Beau about having 5 AAs instead of 4 if you are going to go that route. Unless you use AA energizer lithiums ($), which hold up in voltage until the very end.

    If you have a tricolor LED, the stoplight method is not hard to understand green, yellow, red! If you can run them at lower average current and shorter pulses, so much the better. The yellow and red are the ones that require action, so they could be set to flash more often. Every month it seems like LEDs are brighter than they were the month before. If you are around in a room in the dark they will attract your attention!

    Would it be possible to run the LEDs only when someone presses a button to request a readout? That could be super low power, as there are means to shut off a Stamp completely between button presses. Or, maybe, couple it with a light sensor or or switch so it only flashes when someone lifts the lid to extract a smoke.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • Carl HayesCarl Hayes Posts: 841
    edited 2008-11-25 00:46
    Tracy Allen said...
    Every month it seems like LEDs are brighter than they were the month before.
    How very unlike citizens.· More specifically, how very unlike my across-the-street neighbors.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    · -- Carl, nn5i@arrl.net

    Post Edited (Carl Hayes) : 11/25/2008 1:30:53 AM GMT
Sign In or Register to comment.