Introduction: Robot Bumpers Instructable
I have decided to create an instructable that demonstrates how to create the Robot Bumpers and how to place them on the Battery-Controlled Robot. Firstly, you want to ensure that you have the wires connected in the right places. The circuit will not work otherwise. Secondly, you want to ensure that you have one of the wires connected to the VDD (positive) and the other wires connected to the VSS (negative). Lastly, you want to ensure that you connect both of these wires to the tin foil. The very last step that you have to do is ensure that the tin foil is connected to the bumpers.
Supplies
The supplies that were used to create this Instructable were the following:
- Two Sticks
- Tin foil
- 3 Wires
Step 1: Placing the Foil on the Sticks
Place the two sticks on the back of the bumper, ensuring that both sticks are covered with tin foil. The best option to ensure that both sticks stay on the back of the robot would be applying a small piece of adhesive tape.
Step 2: Connecting the Wires
In order for your circuit to work, you need to be able to connect the three wires from the VDD and VSS to the tin foil-covered sticks.
Step 3: Connecting All the Wires Into One
Lastly, in order to get all of the wires onto the bumper to start working, wrap them with tin foil and press them onto the foil-covered sticks. When pressed, the current from the wires caused the robot to move.
Step 4: Watch It Go!
When you press all three wires to the bumpers, the car should start moving. The next step displays the code that was required for this to work. The program that was used for this process is called "Basic Stamp Editor".
Step 5: The Code for Programming the Robot
In order for this robot to move, it needs to have the following code:
' {$STAMP BS2}
' {$PBASIC 2.5}
LBump PIN 11
RBump PIN 10
LMOTOR PIN 15
RMOTOR PIN 14
RFast CON 650
LFast CON 850
RSlow CON 700
LSLOW CON 800
MStop CON 750
RFastRev CON 850
LFastRev CON 650
RSlowRev CON 800
LSlowRev CON 700
MLoopC VAR Word 'For..Next Variable up to approximately 65000
DO
GOSUB Forwardfast 'go forward
IF IN10 = 0 THEN ' if the two wires in input 10 are pressed then turn left
GOSUB TurnLeft90
ELSEIF IN11 = 0 THEN 'If two wires in input 11 are pressed, then turn right
GOSUB TurnRight90
ENDIF
LOOP
TurnRight90:
' Subprocedure to Turn 90deg Right
'**********************************************************
HIGH 1
LOW 0
FOR MLoopC = 1 TO 22
PULSOUT LMOTOR, LfastRev 'move forward one pulse
PULSOUT RMOTOR, Rfast ' using pins and constants
PAUSE 20
' 20mS allows robot to move ' before NEXT pulse
NEXT
RETURN
'*********************************************************
TurnLeft90:
' Subprocedure to Turn 90deg Right
'********************************************************
HIGH 0
LOW 1
FOR MLoopC = 1 TO 22
PULSOUT LMOTOR, Lfast 'move forward one pulse
PULSOUT RMOTOR, RfastRev ' using pins and constants
PAUSE 20 ' 20mS allows robot to move ' before NEXT pulse
NEXT
RETURN
'***********************************************************
ForwardFast:
' Subprocedure to move the robot forward one square fast
'**********************************************************
FOR MLoopC = 1 TO 70
PULSOUT LMOTOR,
LFast 'PULSOUT
RMOTOR = RFast
PAUSE 20
NEXT
RETURN
This should allow the robot to move when pressed :)