Robotics with the Boe-Bot
Student Guide
VERSION 3.0
WARRANTY
Parallax warrants its products against defects in materials and workmanship for a period of 90 days from receipt of
product. If you discover a defect, Parallax will, at its option, repair or replace the merchandise, or refund the
purchase price. Before returning the product to Parallax, call for a Return Merchandise Authorization (RMA)
number. Write the RMA number on the outside of the box used to return the merchandise to Parallax. Please enclose
the following along with the returned merchandise: your name, telephone number, shipping address, and a description
of the problem. Parallax will return your product or its replacement using the same shipping method used to ship the
product to Parallax.
14-DAY MONEY BACK GUARANTEE
If, within 14 days of having received your product, you find that it does not suit your needs, you may return it for a
full refund. Parallax will refund the purchase price of the product, excluding shipping/handling costs. This guarantee
is void if the product has been altered or damaged. See the Warranty section above for instructions on returning a
product to Parallax.
COPYRIGHTS AND TRADEMARKS
This documentation is Copyright 2003-2010 by Parallax Inc. By downloading or obtaining a printed copy of this
documentation or software you agree that it is to be used exclusively with Parallax microcontrollers and products.
Any other uses are not permitted and may represent a violation of Parallax copyrights, legally punishable according
to Federal copyright or intellectual property laws. Any duplication of this documentation for commercial uses is
expressly prohibited by Parallax Inc. Duplication for educational use, in whole or in part, is permitted subject to the
following conditions: the material is to be used solely in conjunction with Parallax microcontrollers and products, and
the user may recover from the student only the cost of duplication. Check with Parallax for approval prior to
duplicating any of our documentation in part or whole for any other use.
BASIC Stamp, Board of Education, Boe-Bot, Stamps in Class, and SumoBot are registered trademarks of Parallax
Inc. HomeWork Board, PING))), Parallax, the Parallax logo, Propeller, and Spin are trademarks of Parallax Inc. If
you decide to use any of these words on your electronic or printed material, you must state that “(trademark) is a
(registered) trademark of Parallax Inc.” upon the first use of the trademark name. Other brand and product names
herein are trademarks or registered trademarks of their respective holders.
ISBN 9781928982531
3.0.0-10.11.10-HKTP
DISCLAIMER OF LIABILITY
Parallax Inc. is not responsible for special, incidental, or consequential damages resulting from any breach of
warranty, or under any legal theory, including lost profits, downtime, goodwill, damage to or replacement of
equipment or property, or any costs of recovering, reprogramming, or reproducing any data stored in or used with
Parallax products. Parallax is also not responsible for any personal damage, including that to life and health, resulting
from use of any of our products. You take full responsibility for your BASIC Stamp application, no matter how life-
threatening it may be.
ERRATA
While great effort is made to assure the accuracy of our texts, errors may still exist. Occasionally an errata sheet with
a list of known errors and corrections for a given text will be posted on the related product page at
www.parallax.com. If you find an error, please send an email to editor@parallax.com.
Table of Contents
Preface.........................................................................................................................5
About Version 3.0 ...........................................................................................................6
Audience .........................................................................................................................6
Support Forums ..............................................................................................................7
Resources for Educators ................................................................................................8
Foreign Translations .......................................................................................................9
About the Author .............................................................................................................9
Special Contributors .......................................................................................................9
Chapter 1 : Your Boe-Bot’s Brain ...........................................................................11
Hardware and Software ................................................................................................12
Activity #1 : Getting the Software..................................................................................12
Activity #2 : Using the Help File for Hardware Setup ....................................................17
Summary ......................................................................................................................19
Chapter 2 : Your Boe-Bot’s Servo Motors .............................................................23
Introducing the Continuous Rotation Servo ..................................................................23
Activity #1 : Building and Testing the LED Circuit.........................................................24
Activity #2 : Tracking Time and Repeating Actions with a Circuit .................................27
Activity #3 : Connecting the Servo Motors ....................................................................40
Activity #4 : Centering the Servos.................................................................................49
Activity #5 : How To Store Values and Count ...............................................................53
Activity #6 : Testing the Servos ....................................................................................58
Summary ......................................................................................................................67
Chapter 3 : Assemble and Test Your Boe-Bot.......................................................73
Activity #1 : Assembling the Boe-Bot Robot .................................................................73
Activity #2 : Re-Test the Servos ...................................................................................82
Activity #3 : Start/Reset Indicator Circuit and Program.................................................86
Activity #4 : Testing Speed Control with the Debug Terminal.......................................92
Summary ......................................................................................................................98
Chapter 4 : Boe-Bot Navigation ............................................................................103
Activity #1 : Basic Boe-Bot Maneuvers .......................................................................103
Activity #2 : Tuning the Basic Maneuvers ...................................................................109
Activity #3 : Calculating Distances ..............................................................................112
Activity #4 : Maneuvers—Ramping.............................................................................117
Activity #5 : Simplify Navigation with Subroutines ......................................................120
Activity #6 : Advanced Topic—Building Complex Maneuvers in EEPROM ................126
Summary ....................................................................................................................136
Chapter 5 : Tactile Navigation with Whiskers ..................................................... 143
Tactile Navigation .......................................................................................................143
Activity #1 : Building and Testing the Whiskers ..........................................................144
Activity #2 : Field Testing the Whiskers ......................................................................152
Activity #3 : Navigation with Whiskers ........................................................................155
Activity #4 : Artificial Intelligence and Deciding When You’re Stuck...........................160
Summary ....................................................................................................................165
Chapter 6 : Light-Sensitive Navigation with Phototransistors.......................... 169
Introducing the Phototransistor...................................................................................169
Activity #1 : A Simple Binary Light Sensor .................................................................171
Activity #2 : Measure Light Levels with Phototransistors............................................179
Activity #3 : Light Sensitivity Adjustment ....................................................................189
Activity #4 : Light Measurements for Roaming ...........................................................194
Activity #5 : Routine for Roaming Toward Light .........................................................203
Activity #6 : Test Navigation Routine with the Boe-Bot...............................................212
Summary ....................................................................................................................216
Chapter 7 : Navigating with Infrared Headlights................................................. 221
Infrared Light ..............................................................................................................221
Activity #1 : Building and Testing the IR Object Detectors .........................................223
Activity #2 : Field Testing for Object Detection and Infrared Interference ..................230
Activity #3 : Infrared Detection Range Adjustments ...................................................234
Activity #4 : Object Detection and Avoidance .............................................................237
Activity #5 : High-Performance IR Navigation ............................................................239
Activity #6 : The Drop-Off Detector.............................................................................242
Summary ....................................................................................................................248
Chapter 8 : Robot Control with Distance Detection ........................................... 255
Determining Distance with the Same IR LED/Detector Circuit ...................................255
Activity #1 : Testing the Frequency Sweep ................................................................255
Activity #2 : Boe-Bot Shadow Vehicle ........................................................................262
Activity #3 : Following a Stripe....................................................................................271
Activity #4 : More Boe-Bot Activities and Projects Online...........................................278
Summary ....................................................................................................................280
Appendix A : Parts List and Kit Options.............................................................. 289
Appendix B : Resistor Color Codes and Breadboarding Rules ........................ 293
Appendix C : Boe-Bot Navigation Contests ........................................................ 299
Index ........................................................................................................................ 303
Preface ·
Page 5
Preface
Robots are used in the auto, medical, and manufacturing industries, in all manner of
exploration vehicles, and, of course, in many science fiction films. The word "robot" first
appeared in a Czechoslovakian satirical play, Rossum's Universal Robots, by Karel
Capek in 1920. Robots in this play tended to be human-like. From this point onward, it
seemed that many science fiction stories involved these robots trying to fit into society
and make sense out of human emotions. This changed when General Motors installed the
first robots in its manufacturing plant in 1961. These automated machines presented an
entirely different image from the “human form” robots of science fiction.
Building and programming a robot is a combination of mechanics, electronics, and
problem solving. What you're about to learn while doing the activities and projects in
this text will be relevant to real-world applications that use robotic control, the only
differences being the size and sophistication. The mechanical principles, example
program listings, and circuits you will use are very similar to, and sometimes the same as,
industrial applications developed by engineers.
The goal of this text is to get students interested in and excited about the fields of
engineering, mechatronics, and software development as they design, construct, and
program an autonomous robot. This series of hands-on activities and projects will
introduce students to basic robotic concepts using the Parallax Boe-Bot
®
robot, called the
"Boe-Bot." Its name comes from the Board of Education
®
carrier board that is mounted
on its wheeled chassis. An example of a Boe-Bot with an infrared obstacle detection
circuit built on the Board of Education solderless prototyping area is shown below in
Figure P-1.
Figure P-1
Parallax Inc.’s
Boe-Bot
®
Robot
The activities and projects in this text begin with an introduction to your Boe-Bot’s brain,
the Parallax BASIC Stamp
®
2 microcontroller, and then move on to construction, testing,