The [Dallas Personal Robotics Group] recently put together a set of tutorials for their members, including the build process of a table-top robot, they call the Tiny Wanderer. The bot can be constructed pretty easily, and is meant as an introduction to robot building.
The small servo-driven bot uses simple edge sensors to ensure that it doesn’t fall off a raised surface. The sensors were built using a small IR LED and photo transistor, which is partially isolated from the LED by a piece of shrink tubing. An ATiny micro-controller takes two measurements of the amount of IR light entering the photo transistor – one with the LED on, the other with the LED off. The difference of these measurements is compared to determine if the edge sensors are hanging off the side of the table. The logic used here is pretty simple – the difference will be high if the sensors are hovering over a surface, due to reflected light, and low if the sensors are hanging over open space.
The writeup contains templates for building the bot’s structure, as well as source code and schematics for all of the electronic bits.
Be sure to stick around to see a video of the robot in action.