Well, I am always starting new hobbies and this is my latest one: advanced robotics. I'm taking a break from the little solar powered B.E.A.M. robotics for a while and bought
THIS KIT. It is a kit designed to teach you how to program a STAMP2 microcontroller. You can control lights, servos, sounds, all kinds of stuff.
When I first got it I was going through the book and teaching myself the programming language, PBASIC. After a week or two though I got anxious to build a small robot base for it, so thats exactly what I did. I went to
parallax and ordered 2 of their continuously rotating servos for motors, and 2 wheels designed to be attatched directly to the servos. I had some Sintra (expanded pvc) I ordered from
SOLARBOTICS and used that to make the base.

Here you can see the initial mock-up of the lower plate and the servos/wheels. I ended up using smaller strips of the same plastic, which is highly moldable when warmed, to fabricate sturdy mounts for the servos. not pictured is the tail wheel that is also made from the same plastic, heated and folded over itself. The wheel itself is a pinch roller from an old tape player.

Here is pretty much how it sits at the moment. There is an identical plate as the bottom used as the top plate to mount the STAMP2 homework board to. The wheels are moved within the robots chassis and so the robot is a perfect 4.25" square.
Right now the robot is programmed to seek out the brightest lit area. It will also follow a flashlight beam. The same programming/hardware setup can also be used for following a line of tape on the ground. For the eyes I'm using 2 photodiodes from an old computer mouse. The STAMP2 takes the input and converts it to a number. Using some IF...THEN commands it compares the 2 light signals and tries to balance them. If one or both eyes see dark levels too low it will back up and head toward the direction one of the eyes deems brighter. I'll post the program later when I can get it off of the computer I used to program it.
The next step is to add some sort of obstacle detection so it can avoid walls and such. This can be accomplished using sonar or infrared beam pulsed at 38.5kHz and phototransistors. This will GREATLY improve the robots roaming capabilities without getting into trouble.
For more information go to
parallax's website. All their textbooks and documentation for their products is free for download as PDF files.
Here's the program:
' {$STAMP BS2}
' {$PBASIC 2.5}
lightleft VAR Word
lightright VAR Word
lightcenter VAR Word
rightservo CON 0 'assign right servo constant to pin 0
leftservo CON 15 'assign left servo constant to pin 15
counter VAR Word 'variable for time driving
average VAR Word
difference VAR Word
'PAUSE 7000
DO
HIGH 1
'HIGH 8
HIGH 14
RCTIME 1, 1, lightright
'RCTIME 8, 1, lightcenter
RCTIME 14, 1, lightleft
average = (lightleft + lightright)/2
difference = average / 6
IF lightright > 2600 THEN
GOSUB reverseleft
ELSEIF lightleft > 2600 THEN
GOSUB reverseright
ELSE
GOSUB normal
ENDIF
' DEBUG HOME, "left = ", DEC5 lightleft , CR,
' "right = ", DEC5 lightright, CR
'"center = ", DEC lightcenter
LOOP
normal:
IF lightright > lightleft + difference THEN
'FOR counter = 1 TO 50
PULSOUT rightservo, 700
PULSOUT leftservo, 750
'NEXT
ELSEIF lightleft > lightright + difference THEN
'FOR counter = 1 TO 50
PULSOUT rightservo, 750
PULSOUT leftservo, 800
'NEXT
ELSE
PULSOUT rightservo, 700
PULSOUT leftservo, 800
ENDIF
RETURN
reverseleft:
PAUSE 1000
FOR counter = 1 TO 100
PULSOUT leftservo, 750 - counter
PULSOUT rightservo, 750 + counter
NEXT
PAUSE 500
FOR counter = 1 TO 200
PULSOUT rightservo, 750 - counter
NEXT
PAUSE 500
RETURN
reverseright:
PAUSE 1000
FOR counter = 1 TO 100
PULSOUT leftservo, 750 - counter
PULSOUT rightservo, 750 + counter
NEXT
PAUSE 500
RETURN