|
Back to ARobot Projects Page
This application note in PDF format
An emergency stop button can save the life of your robot.
This is an easy to reach, easy to push button used to
immediately stop the robot. Often times the robot can run
mad and head right for the edge of the table, head right for
the lawnmower, or head right for the poor deaf/blind cat.
In these instances its nice to have a quick and easy STOP button.
This application note explains how to connect one of these life
saving devices to your ARobot.
There is some soldering required in this application note.
Some mechanical engineering is also required for this application
(bolting brackets together, drilling, etc).
|       Parts List |
Go and pick out a nice push button at Radio Shack or
other electronic supply store.
They have many sizes and colors.
Get one that makes contact easily.
The wire can be any wire that is not tied down in the house.
The aluminum brackets are used to mount the button up off the robot
within easy reach of a jogging operator.
Parts
-----------------------------------------------------------------
Momentary Normally open push button, SPST (single pole, single throw)
wire
Aluminum L brackets
2 pin connector Radio Shack #11929726 or 40 pin expansion cable.
Various screws, nuts, spacers
|
|
A cable should be made that will connect one side of the push button to an
input pin on the Basic Stamp and the other side to ground.
Pushing the button will cause the pin to become low.
Wiring can be made through the expansion connector or by
attaching a cable directly to one of the jumper connectors.
Input # 12 is used in our example program but you can use
another unused pin if you want.
|
|       Mounting |
|
|
Determine how your button will be attached to the ARobot (mechanical engineering). Drill appropriate holes. Before mounting the hardware to the ARobot body, attach the button to the hardware (brackets). Then solder one wire to each lead on the button. Be sure that contact is not made between these two wires. Then attach the 2 pin connector to the other end of the wires. It does not matter which wire attaches where. Next, mount the brackets to the ARobot body. Bolt it down tight so that it does not come loose. Then wrap the extra wire around the bracket and plug in the connector to the ARobot board as shown in the picture.
|
|       Software |
The following example program uses the E-Stop switch to stop
ARobot movement. You can incorporate this function into
almost any program you wish.
You can download this program here.
'estop.bs2 www.robotics.com
'This routine demonstrates how to use an emergency stop button. The idea
'behind the estop button is to have a button that stops the robot before it can
'fall down stairs, into the fireplace, or run over the cat.
charn var byte 'get chars from coprocessor.
red con 10
net con 8 'coprocessor network pin.
baud con 396 'coprocessor network baud rate.
speaker con 9 'speaker pin.
low speaker 'turn off speaker.
main
gosub motor1 'start motor.
main1 'start of main loop.
if in12 = 0 then estop 'check estop button.
goto main1 'end of main loop.
'------------------------------------------------------------------
'signal that the estop button has been pushed.
'
estop
gosub stopmtr
gosub honk 'honk a couple of times.
gosub honk
gosub honk
gosub honk
gosub honk
estop1
low red 'flash red led and honk.
gosub honk
pause 500
high red
pause 500
goto estop1
'------------------------------------------------------------------
'turn motor 1 on.
'
motor1 'drive motor.
serout net,baud,["!1M111FFFF"] 'mtr 1,fwd,spd,dis.
serin net,baud,[charn] 'get acknowledge char.
if charn<>"A" then motor1 'keep trying if no good.
return
'------------------------------------------------------------------
'turn motor 1 on.
'
stopmtr 'drive motor.
serout net,baud,["!1M110FFFF"] 'mtr 1,fwd,spd,dis.
serin net,baud,[charn] 'get acknowledge char.
if charn<>"A" then motor1 'keep trying if no good.
return
'------------------------------------------------------------------
'beep beep honk honk.
'
honk
freqout speaker,200,1500
low speaker
return
Here's are some useful sources for parts:
|