PDA

View Full Version : basic stamp 2 about auto off program



HKfans
03-16-2010, 01:19 AM
i am use basic stamp 2 for my project
the project i have use
Parallax 2x16 Serial LCD (Non-Backlit)
PING))) Ultrasonic Sensor
BASIC Stamp 2 Module
Memsic 2125 Dual-axis Accelerometer

i want to ask auto-off program

When I pressed the ON, not by ANY button after a few minutes, it will AUTOOFF
HOW TO WIRTE THE PROGRAM TO DO THAT?
THANK YOU FOR HELP

Franklin
03-16-2010, 01:48 AM
Show us the code you have and perhaps we can give you some advice.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen

HKfans
03-16-2010, 01:55 AM
do you have any code is about auto off?

HKfans
03-16-2010, 01:56 AM
Franklin said...
Show us the code you have and perhaps we can give you some advice.


i only follow paralax doc to write the program

Mike Green
03-16-2010, 02:12 AM
There is no "auto-off" program. How you would write one depends on your existing program.

You will need to build some additional hardware to turn off the power to the display and the sensors. There is no "ready made" hardware. It's not difficult. It mostly consists of a PNP switching transistor like a 2N3906, a few resistors, and a capacitor. The Stamp uses a SLEEP statement to drop into a low power state (read the chapter on the SLEEP and NAP statements in the BASIC Stamp Syntax and Reference Manual).

It might be possible to provide power for the Accelerometer from a Stamp I/O pin, but the PING and the display require a little more than the Stamp could control directly. The limit is around 20mA.

Post Edited (Mike Green) : 3/15/2010 7:18:19 PM GMT

HKfans
03-16-2010, 02:34 AM
THANK YOU MIKE GREEN

Post Edited (HKfans) : 3/15/2010 7:41:40 PM GMT

HKfans
03-16-2010, 02:40 AM
IS THAT http://www.parallax.com/dl/docs/prod/stamps/BasicStampMan.pdf?

HKfans
03-16-2010, 02:43 AM
' {$STAMP BS2}
' {$PBASIC 2.5}
Main:
LOW 0 ' turn LED on
STOP ' stop program

THAT'S MEAN ALL SENSOR AND LCD DISPLAY OFF?

erco
03-16-2010, 02:50 AM
One way is have an SCR and a NC relay in series providing power to everything. Your "on" pushbutton simply triggers the SCR gate, and everything stays on afterward (must maintain minimum current flow through SCR). To turn off, trigger the relay to open up, which will interrupt the current flow temporarily, then the SCR will keep it off.

Alternatively, if you only have a NO relay (like a reed relay), put that across your SCR (anode & cathode). To turn off the SCR, temporarily turn that NO relay on to short the SCR and it will stay off afterward.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"If you build it, they will come."