Shop OBEX P1 Docs P2 Docs Learn Events
Low Power Mode.... — Parallax Forums

Low Power Mode....

willthiswork89willthiswork89 Posts: 359
edited 2006-07-30 20:29 in BASIC Stamp
im wanting the stamp to go into low power mode until the switch is turned on... i tried stop but you have to reset the program if you use that... how can i make it go into low power mode until the statement becomes true?

Comments

  • Bruce BatesBruce Bates Posts: 3,045
    edited 2006-07-30 07:51
    kevin -

    Both the PBASIC Reference Manual and the PBASIC Help file hold the answer to your question. Have you perused either of them yet?

    You will need to put your program in a loop which checks the switch status, and if it's not ON, then use one of the power saving commands to wait a short or long period of time. Each of the commands permits you to set the duration of the waiting period.

    One of the commands begins with the letter "N" and the other begins with the letter "S".

    Regards,

    Bruce Bates

    Post Edited (Bruce Bates) : 7/30/2006 8:09:30 AM GMT
  • GadgetmanGadgetman Posts: 2,436
    edited 2006-07-30 07:54
    And if he has a BS2p/pe/px there's a third command, beginning with the letter "P"...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Don't visit my new website...
  • willthiswork89willthiswork89 Posts: 359
    edited 2006-07-30 08:07
    i did look after i posted this, i notices there is a Pollin Pollmode and Pollwait but i have the Bs2 then i looked at sleep but its in seconds... will it really sae me much power if im sleeping and checking again in 1 second? i was hoping to be able to use poll which is perfect but i cant!
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2006-07-30 08:11
    kevin -

    Did you look at the "N" commands yet?

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    <!--StartFragment -->
  • willthiswork89willthiswork89 Posts: 359
    edited 2006-07-30 08:43
    what the nap function? yes but will it save me that much current... how much time will it add to the life of my nine volt?

    heres the code im using

    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    powersw VAR Bit
    DO
    powersw = IN15
    IF(powersw = 1) THEN
    DO
    NAP 3
    powersw = IN15
    DEBUG HOME, "Powered Down"
    LOOP UNTIL(powersw = 0)
    ENDIF
    DEBUG CLS
    DO
    powersw = IN15
    DEBUG HOME, "Powered UP!"
    LOOP UNTIL(powersw = 1)
    LOOP

    i was planning on making the thing so i didnt have to remove the battery and i could put the cars case back on. I was wondering if there is a way to make a template for the editor or save my prefrences from when it starts up it already knows i am using BS2 and .2.5 unless noted otherwise.. and can you change that background color of the editor its self? not just the highlight part of it?

    Post Edited (willthiswork89) : 7/30/2006 8:48:37 AM GMT
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2006-07-30 08:55
    kevin -

    Only YOU can answer that question of savings. The longer you NAP or SLEEP, the more power you will conserve. It's as simple as that.

    Here are the two figures of interest to you for the BS-2 Stamp:

    ·Mode·· Current
    ··
    Active··· 3 mA
    Sleep··· 50 uA

    Regards,

    Bruce Bates
  • willthiswork89willthiswork89 Posts: 359
    edited 2006-07-30 09:03
    well i know that there are 1000 microamperes in a milliapere is that the current draw an hour,minute,day? thats a considerable ammount less then running,,, around 60 percent less if im correct...
  • ForrestForrest Posts: 1,341
    edited 2006-07-30 10:10
    Time to change the batteries in the calculator - Sleep uses 60 times less power than Active mode!
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2006-07-30 12:57
    Kevin -

    Yes, there is·significant power savings in SLEEP or NAP mode.

    As to your other question. amperes have no time component in and of themselves. Thus, the figures I offered are instantaneous current.

    A unit of measure which includes amperes and time is the ampere-hour or amp-hour for short. That would be written as (say) 50 mAH. Battery capacity is often quoted in terms of mAH or AH.

    By way of example, if you say - I have a battery which will deliver 2000 mAH, how long will it power a 50 mA load? The answer to that question is:

    2000 mAH / 50 mA = 40.0 Hours or 2400 minutes

    Perhaps a better way to see it is via the infamous "line equation", thusly:

    2000· mA*H·········40 H
    =···
    ·· 50· mA··············1

    where the mA units cancel one another out and you're left with hours.

    Regards,

    Bruce Bates
  • FranklinFranklin Posts: 4,747
    edited 2006-07-30 17:30
    Will, why not just turn the power off when you are not using it?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • Beau SchwabeBeau Schwabe Posts: 6,559
    edited 2006-07-30 19:06
    willthiswork89,



    Depending on the type of "switch" configuration you have going to the STAMP, there is a hardware solution that
    might work for you consuming less than 3 nA (nano Amps!). I used this circuit for a doorbell in my daughter's
    playhouse which lasted more than 6 months on a nine-volt battery ( <-- most of that was due to the shelf life of
    the rechargeable battery itself)



    Note: This circuit will work as a touch switch (i.e. the doorbell application) , but a regular contact closure switch
    will work just fine.

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

    IC Layout Engineer
    Parallax, Inc.

    Post Edited (Beau Schwabe (Parallax)) : 7/30/2006 8:31:32 PM GMT
    881 x 627 - 46K
  • willthiswork89willthiswork89 Posts: 359
    edited 2006-07-30 20:23
    alright so it will know when that switch it turned on/off and i can consume almost no power until th switch is on?
  • Beau SchwabeBeau Schwabe Posts: 6,559
    edited 2006-07-30 20:29
    willthiswork89,

    Depending on the type of switch configuration you have in your circuit, that being a regular contact closure switch, yes.

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

    IC Layout Engineer
    Parallax, Inc.
Sign In or Register to comment.