The basic Zippy-Bot model from Chapter 11 of The ULMN Inventor’s Guide allows you to create a number of unique robots by adding on different subassemblies. I included two robots in the book—Bumper-Bot and Claw-Bot—based on Zippy-Bot, but I had wanted to include a third: a simple line-follower. Well, I’ve finally created that line-follower and named it Line-Bot. The robot uses one additional subassembly, the Light Sensor subassembly, and an extremely simple NXT-G program.
You can build Line-Bot by downloading the LEGO Digital Designer (LDD) file of the Light Sensor subassembly. (If you haven’t downloaded the LDD software yet, you can do so at http://ldd.lego.com/.) Once you’ve opened my file, clicking the Building Guide Mode button or hitting F7 on your keyboard takes you to the building instruction for the model. Follow the instructions to build the subassembly, and then attach it to Zippy-Bot by pushing its bushed friction pegs into the angled beams on the front as shown in the image below. Use a small or medium size cable to connect the light sensor to input port 1 on the NXT.
After construction, download the NXT-G program Line-Bot.rbt, and after you’ve loaded the program into Line-Bot, place the robot on the outside of the black line on the NXT test pad. Run the program, and that’s it! Line-Bot steers left when it detects the black line, steers right when it detects the white surface, and goes straight when it reads an “in between” value. Note that, depending on the lighting in your room, you may need to modify the trigger values used by the two Switch blocks in the program. In addition, depending on the NXT’s current battery level, you may need to adjust Line-Bot’s speed (if the robot goes too fast, it’ll “get lost”).
Feel free to experiment with the program and the robot’s design, and let me know what you can come up with!