Shop OBEX P1 Docs P2 Docs Learn Events
Sleep mode for Basic Stamp2 — Parallax Forums

Sleep mode for Basic Stamp2

EoinEoin Posts: 1
edited 2006-11-09 06:58 in BASIC Stamp
Hello,
I am using a Basic Stamp 2 for a college project. Is it possible to put the stamp into sleep mode to conserve power. The stamp will be used as part of a wireless temperature sensor powered by an energy harvesting device. Any help would be much appreciated.

Eoin.

Comments

  • allanlane5allanlane5 Posts: 3,815
    edited 2006-10-18 20:27
    Yes and no.

    You can put the stamp into a "PAUSE" mode, where it will 'wake up' every 2.5 seconds, do a quick check, and PAUSE some more. It takes very little current when in "PAUSE", I believe.

    But there is no 'interrupt' pin (as other processors have) which would let you 'sleep' the processor until a signal happens on that pin.

    So, if the 'pause' is good enough for you, then you're in business.
  • Beau SchwabeBeau Schwabe Posts: 6,559
    edited 2006-10-18 20:52
    Eoin,

    Here is a low current standby circuit for the Basic Stamp that consumes less than 3nA (nano-Amps).
    Originally I built this for my daughters "play house" equipped with a door-bell.· A rechargeable 9V
    battery (7.2V) would last about 8 months.· As long as you can generate a positive external trigger
    to the base of the 2n3094, this circuit should work for you.

    http://forums.parallax.com/attachment.php?attachmentid=38912









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

    IC Layout Engineer
    Parallax, Inc.
  • allanlane5allanlane5 Posts: 3,815
    edited 2006-10-18 20:58
    Brilliant, Beau, thanks for the link. I just hate telling people that stuff...
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-10-18 21:16
    Eoin,
    ·
    ·· Please check the BASIC Stamp Manual or Help File for the SLEEP command.· This will put the Stamp into low-power mode where it draws only 50 uA of current.· This is typically used in data logging applications where the Stamp Module needs to run off from battery power for an extended length of time.· You can specify an interval where the BASIC Stamp can wake up and take a sample, log it, then go back to sleep.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • CraigLCraigL Posts: 8
    edited 2006-11-07 07:06
    I too am killing batteries with a program that counts door openings on my BOE. I used SLEEP in the most judicious way and calculated that the 9V should last about 100 days (or 50 days if a 9V is only good for half of its 560 mAh.) My Ohm meter shows that when the program & circuit is active it uses about 12 to 15 mA and only sligtly less when sleeping. At that rate I'm only good for less than 2 days if I get 100% of the 560 mAh. So I removed the circuit and the current didn't drop at all. I tried another program that only SLEEPs and I still have about 15 mA draw. I'd like the device to be battery operated.

    What am I doing wrong?
  • Martin HebelMartin Hebel Posts: 1,239
    edited 2006-11-07 07:20
    What else is on the board? An LED? Anything? The current draw is in the range of a well-lit LED, it's why I ask. Is this a normal BOE (as I re-read)?. The BOE is not optimized for long battery life (such as the LED on there, resistors, the voltage regulator takes 1-2mA, etc.

    -Martin

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Martin Hebel
    StampPlot - Graphical Data Acquisition and Control
    AppBee -·2.4GHz Wireless Adapters & transceivers·for the BASIC Stamp & Other controllers·
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2006-11-07 07:51
    Craig -

    It sounds to me like it's never reaching the SLEEP statement for some reason, or it'snot sleeping for as long as you expect it to. A copy of the program would probably be helpful at this point. During sleep the (assumed) BS-2 should only be drawing 50 uA.

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    <!--StartFragment -->
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-11-07 16:16
    Craig,
    ·
    ·· SLEEP is better suited to situations where you need to wake up at an interval and take a reading, then go back to sleep.· In your case, where you need to constantly monitor for the door open/close state it may not work the way you want.· Also, if your switches have pull-ups then they’ll draw some current too, regardless of the current drawn by the BASIC Stamp.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • CraigLCraigL Posts: 8
    edited 2006-11-08 07:05
    Thanks Chris, Bruce and Martin. Yes, it is a BS2. My Switch is NC reed type switch, but I only check for continuity every 4.6 seconds to take advantage of sleeping. I use a 100 KOhm pull up resistor. I put the thing asleep to save on the running current draw in the program. In the circuit, I need a NO switch, I realize. But when I remove the circuit from the BOE I still have the draw. A dedicated 'sleep' program also draws 15mA.

    I think the answer is that the BOE dedicates current to the regulator and other equipment. Thanks for the help. I'd add the code if I could figure out how.
  • Tracy AllenTracy Allen Posts: 6,662
    edited 2006-11-09 03:25
    The BOE does draw a lot of current to power the regulator and the LED on board. To take advantage of SLEEP, you will have to move the Stamp onto its own circuit board or breadboard. If your system does not require much power overall, the onboard 5 volt regulator is very efficient, so the SLEEP current can be around 50 microamps. To make it a minimum, drive the pullup resistor(s) from an output pin, and only turn on the pullup at the required intervals. That is only important if it is possible for the switch to rest in a normally closed state so that the pullup resistor is sourcing currrent. If you use a BS2pe, POLLWAIT command can be used to let the Stamp sleep until a transition occurs at an input.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • CraigLCraigL Posts: 8
    edited 2006-11-09 06:58
    Thanks Tracy - Excellent! I have ordered a parallax carrier board and will build a stand-alone circuit with a pin driven voltage source prior to checking for continuity. This is a HUGE help.

    CraigL
Sign In or Register to comment.