This is Leo, my first attempt at a motorized platform. It uses a Basic Stamp for a brain, and two stepper motors for drive wheels. It has a photocell sensor and looks for light, and a basic microswitch bumper. I owe this basic design to Karl Lunt, from an article in Nuts & Volts magazine.
When I first wrote the software for this robot, I had trouble coming up with a smooth speed-ramping algorithm for the stepper motors. I finally found a good method for doing this in PBASIC. My source code is here.
The program I finally arrived at did the following: Spin
slowly, 360 degrees, and record the location of the brightest light. Then,
turn quickly to that location and go forward.
When I finally got the software debugged and the bumper switch working, I was surprised at its behavior. The most impressive behavior is obstacle avoidance, without using the bumper! Since it's going toward light, obstacles in its way naturally cast shadows in its path. It sees this darkness and maneuvers around it, usually without bumping into anything. It can also find its way out of a dark room, providing there's a door open to a lighter area.
Here you can see the underside - showing the drive train and stepper motor controllers. I used Bill Bailey's chopper motor driver for the steppers. The circuit schematic, parts list, and kits are available from Kevin Ross's web site. I found the steppers at HSC, a surplus electronics store in town, for $15 each.