Loading... Please wait...

Our Newsletter


SoccerSapien1

I have finally started the dream hack for a Robosapien. The goal is to get two of these guys playing a friendly game of soccer. I am going to use the IR soccer ball that is used for some of the robocup events. I have decided to start this transformation by building three IR sensors and attaching them to the feet. (to be described shortly) The other thing I quickly learned is those silly foot switches need to be disconnected. Otherwise the silly bot goes "Oops" or "Ugh" and shuts down when it kicks the ball!Disconnecting foot switches:
Remove the back of the Robosapien as you have done before. Locate the two cable connectors and the wires as shown.
Carefully un-plug one of the connetors.
With great care, bend back the small plastic lock that hold the connector in place. Gently pull back on the wire to remove it from the wire hood.
Repeat for both sides untill you have removed all 4 foot switch wires.
     
Wrap the loose ends up with electrical tape and shove it back inside the sapien.
     
IR Sensor construction:BTW these suckers work great for flame detectors in fire fighting robots.
Locate a IR photo-transistor, 30-39K resistor, some crimps, a hood and some wire.
Wrap the resistor around the shorter wire (flat side) of the IR transistor.
Now wrap the stripped orange (white) wire around the twisted pair.
Place a dab of solder on the wires.
Twist the Brown (or Black) wire around the long wire of the photo transistor.
Place a dab of solder on that joint as well.
Now bend back and twist the red wire around the remaining free end of the resistor.
Solder that sucker up.
Now move to the other end of the wire and strip off a couple of millimeters from each wire.
Carefully crimp on one of the metal connectors
With great care, solder just a tiny bit in the connector.
Repeat for the remaining two wires.
 
Slide and lock the hood over the connectors.
Cover the exsposed wires with something. I use heat glue. Anything non-conductive will work.
This is optional, but to avoid scorn from your peers, cover up your messy wires with heat shrink or something.
 
 
For this bot, I used just three sensors. You could have up to eight without adding any kind of multiplexer.
Front veiw showing the tape shrouded left side and the open center sensor.
Note that I connected the sensors to pins 18,19 and 20. Labled 13 14 and 15 on the RAMB.
 

Example code below:

Option Explicit
Public Const LowBit as single = 0.000833 'Time it takes for the low bit
Public Const StartBit as single = 0.006664 'Time it takes for the start bit
Public Const HighBit as single = 0.003332 'Time it takes for the highbit
Public Const ClockBit as single = 0.000833 'Clock bit time
Public Const Sapien As Byte = 12   
'Robosapien is connected to pin 12 on the BX-24
'That is labled pin 8 on the motherboard
'IR Pin
Const CenterIRPin As Byte = 13 
'The sharp Sensor is connected to pin 13 on the BX-24
'That is labled pin 9 on the motherboard
Const VDB1 As Byte = 14 
Const R_Ball_Sen As Byte = 18 
Const L_Ball_Sen As Byte = 19 
Const C_Ball_Sen As Byte = 20 
Dim R_Sen_Value as Integer 
Dim L_Sen_Value as Integer 
Dim C_Sen_Value as Integer 
'***********************************************
' These are the subroutines available for call. 
' So if you want to make your Robosapien
' give a high five just Call High5.
' I figured out many of these using my storage scope. However, 
' I got bored with that and
' got the rest from http://www.aibohack.com/robosap/ir_codes.htm
Sub Main()
Call Putpin(Sapien,1)
Call Delay(2.0) ' 2 second start delay
Call LArmDown
Call Delay(0.5)
Call LArmIn
Call Delay(0.5)
Call RArmDown
Call Delay(0.5)
Call RArmIn
Call Delay(0.5)
Call WalkForward
Do
R_Sen_Value = GetADC(R_Ball_Sen)
L_Sen_Value = GetADC(L_Ball_Sen)
C_Sen_Value = GetADC(C_Ball_Sen)
C_Sen_Value = C_Sen_Value - 50 'Bias the front sensor
If R_Sen_Value < C_Sen_Value Then
Call BackStep
Call Delay(2.0) 
Call TurnRight
Call Delay(3.0)
Call WalkForward
End If
If L_Sen_Value < C_Sen_Value Then
Call BackStep
Call Delay(2.0) 
Call TurnLeft
Call Delay(3.0)
Call WalkForward
End If
Call Delay(0.5)
Loop
End Sub
'*********************'*********************
Sub TurnRight()'Turn Right
'10000000
Call Pulseout(Sapien,startbit,0)
Call Pulseout(Sapien,HighBit,1)
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1)
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1)
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1)
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1)
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1)
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1)
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1)
Call Pulseout(Sapien,Clockbit,0)
End Sub
'*********************
Sub RArmDown()'Right Arm Down
'10000100
Call Pulseout(Sapien,startbit,0)
Call Pulseout(Sapien,HighBit,1) '7 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1) '6 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1) '5 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1) '4 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1) '3 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,HighBit,1) '2 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1) '1 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1) '0 bit
Call Pulseout(Sapien,Clockbit,0)
End Sub
'*********************
Sub RArmIn()'Right Arm In
'10000101
Call Pulseout(Sapien,startbit,0)
Call Pulseout(Sapien,HighBit,1) '7 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1) '6 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1) '5 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1) '4 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1) '3 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,HighBit,1) '2 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1) '1 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,HighBit,1) '0 bit
Call Pulseout(Sapien,Clockbit,0)
End Sub
'*********************
Sub WalkForward()'Walk Forward
'10000110
Call Pulseout(Sapien,startbit,0)
Call Pulseout(Sapien,HighBit,1) '7 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1) '6 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1) '5 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1) '4 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1) '3 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,HighBit,1) '2 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,HighBit,1) '1 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1) '0 bit
Call Pulseout(Sapien,Clockbit,0)
End Sub
'*********************
Sub WalkBack()'Walk Backwards
'10000110
Call Pulseout(Sapien,startbit,0)
Call Pulseout(Sapien,HighBit,1) '7 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1) '6 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1) '5 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1) '4 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1) '3 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,HighBit,1) '2 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,HighBit,1) '1 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,HighBit,1) '0 bit
Call Pulseout(Sapien,Clockbit,0)
End Sub
'*********************
Sub TurnLeft()'Turn Left
'10001000
Call Pulseout(Sapien,startbit,0)
Call Pulseout(Sapien,HighBit,1) '7 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1) '6 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1) '5 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1) '4 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,HighBit,1) '3 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1) '2 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1) '1 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1) '0 bit
Call Pulseout(Sapien,Clockbit,0)
End Sub
'*********************
Sub LArmDown()'Left Arm Down
'10001100
Call Pulseout(Sapien,startbit,0)
Call Pulseout(Sapien,HighBit,1) '7 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1) '6 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1) '5 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1) '4 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,HighBit,1) '3 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,HighBit,1) '2 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1) '1 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1) '0 bit
Call Pulseout(Sapien,Clockbit,0)
End Sub
'*********************
Sub LArmIn()'Left Arm In
'10001101
Call Pulseout(Sapien,startbit,0)
Call Pulseout(Sapien,HighBit,1) '7 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1) '6 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1) '5 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1) '4 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,HighBit,1) '3 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,HighBit,1) '2 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1) '1 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,HighBit,1) '0 bit
Call Pulseout(Sapien,Clockbit,0)
End Sub
'*********************
Sub RTurnStep()'Right Turn Step
'10100000
Call Pulseout(Sapien,startbit,0)
Call Pulseout(Sapien,HighBit,1) '7 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1) '6 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,HighBit,1) '5 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1) '4 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1) '3 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1) '2 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1) '1 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1) '0 bit
Call Pulseout(Sapien,Clockbit,0)
End Sub
'*********************
Sub SleepIt()'Sleep
'10100011
Call Pulseout(Sapien,startbit,0)
Call Pulseout(Sapien,HighBit,1) '7 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1) '6 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,HighBit,1) '5 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1) '4 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1) '3 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1) '2 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,HighBit,1) '1 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,HighBit,1) '0 bit
Call Pulseout(Sapien,Clockbit,0)
End Sub
'*********************
Sub ForwardStep()'Forward Step
'10100110
Call Pulseout(Sapien,startbit,0)
Call Pulseout(Sapien,HighBit,1) '7 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1) '6 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,HighBit,1) '5 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1) '4 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1) '3 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,HighBit,1) '2 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,HighBit,1) '1 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1) '0 bit
Call Pulseout(Sapien,Clockbit,0)
End Sub
'*********************
Sub BackStep()'Backward Step
'10100111
Call Pulseout(Sapien,startbit,0)
Call Pulseout(Sapien,HighBit,1) '7 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1) '6 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,HighBit,1) '5 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1) '4 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1) '3 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,HighBit,1) '2 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,HighBit,1) '1 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,HighBit,1) '0 bit
Call Pulseout(Sapien,Clockbit,0)
End Sub
'*********************
Sub LTurnStep()'Left Turn Step
'10101000
Call Pulseout(Sapien,startbit,0)
Call Pulseout(Sapien,HighBit,1) '7 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1) '6 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,HighBit,1) '5 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1) '4 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,HighBit,1) '3 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1) '2 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1) '1 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1) '0 bit
Call Pulseout(Sapien,Clockbit,0)
End Sub
'*********************
Sub ResetIt()'Reset
'10101110
Call Pulseout(Sapien,startbit,0)
Call Pulseout(Sapien,HighBit,1) '7 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1) '6 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,HighBit,1) '5 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1) '4 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,HighBit,1) '3 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,HighBit,1) '2 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,HighBit,1) '1 bit
Call Pulseout(Sapien,Clockbit,0)
Call Pulseout(Sapien,LowBit,1) '0 bit
Call Pulseout(Sapien,Clockbit,0)
End Sub
    There are no products in this category.