Robotics, once the exclusive domain of university laboratories and industrial factories, has become increasingly accessible to enthusiasts, students, and hobbyists. Among the many platforms available for learning and experimentation, the Boe-Bot robot stands out as a classic and enduring choice. Developed by Parallax, Inc., the Boe-Bot offers a well-documented and robust entry point into the world of autonomous robotics, microcontrollers, and basic programming. This guide will take you through the essential steps to assemble and program your very own Boe-Bot, transforming a collection of components into a functional, intelligent machine.
Table of Contents
- Understanding the Boe-Bot Platform
- Essential Components of a Standard Boe-Bot Kit
- Step-by-Step Assembly Guide
- Programming the Boe-Bot: Your First Steps
- Expanding Your Boe-Bot’s Capabilities: Adding Sensors
- Calibration and Troubleshooting
- Conclusion
Understanding the Boe-Bot Platform
Before diving into assembly, it’s crucial to understand what makes the Boe-Bot tick. At its heart is the BASIC Stamp microcontroller, specifically the BASIC Stamp 2 (BS2). This chip acts as the robot’s “brain,” processing instructions and controlling its various components. The Boe-Bot kit typically includes a dedicated robot board that conveniently mounts the BS2, a breadboard for circuit prototyping, continuous rotation servo motors for propulsion, and an array of sensors to perceive its environment.
The beauty of the Boe-Bot lies in its modularity and the simplicity of its PBASIC programming language, which is similar to classic BASIC. This makes it an ideal platform for beginners to grasp fundamental concepts in electronics, mechanics, and programming without being overwhelmed by complex syntax or hardware.
Essential Components of a Standard Boe-Bot Kit
A typical Boe-Bot robot kit from Parallax, Inc. includes:
- BASIC Stamp 2 (BS2) Microcontroller: The programmable brain.
- Board of Education (BoE) Robot Board: A specialized circuit board that hosts the BS2, provides power regulation, and offers convenient connections for motors and sensors.
- Continuous Rotation Servo Motors (x2): These modified hobby servos rotate continuously in either direction, serving as the robot’s drive wheels.
- Wheels and Tires (x2): Mounted on the servo motors.
- Tail Wheel/Ball Caster: Provides stability and a third point of contact for the robot.
- Breadboard: For prototyping and connecting sensors and custom circuits.
- Battery Pack (typically 4xAA or 5xAA): Powers the robot’s electronics and motors.
- Screws, Stand-offs, and Mounting Hardware: For assembling the chassis.
- Sensors: Common basic kits include:
- Infrared (IR) Object Detectors: For obstacle avoidance.
- Phototransistors (Light Sensors): For light following or avoidance.
- Piezoelectric Speaker: For generating sounds.
- Resistors, Jumper Wires, and Small Electronic Components: For building circuits.
- USB A-to-Mini-B Cable: For connecting the BoE board to a computer for programming.
Step-by-Step Assembly Guide
Assembling the Boe-Bot is a straightforward process, primarily involving mechanical construction before moving on to wiring and programming.
Step 1: Prepare the Chassis
Most Boe-Bot kits feature a pre-drilled acrylic or metal chassis. * Attach Stand-offs: Securely screw three or four stand-offs into the designated holes on the chassis. These will elevate the Board of Education and provide space for wiring underneath. * Mount the Board of Education (BoE): Carefully align the BoE board with the stand-offs and secure it using screws. Ensure it’s firmly attached but avoid overtightening.
Step 2: Install the Motors
The continuous rotation servo motors are the robot’s primary means of locomotion. * Attach Servo Brackets (if applicable): Some kits may include mounting brackets for the servos. Attach these to the motors first according to the instructions. * Mount Servos to Chassis: Use the provided screws to secure the servo motors to the designated mounting points on either side of the chassis. Ensure they are oriented correctly so their output shafts (where the wheels attach) face outwards. * Attach Wheels: Press the wheels firmly onto the output shafts of the servo motors. They often have a D-shaped or splined shaft to ensure a snug fit.
Step 3: Install the Tail Wheel/Ball Caster
The tail wheel provides stability and allows the robot to pivot smoothly. * Mount: Secure the tail wheel or ball caster to the rear underside of the chassis using the provided screws. Ensure it can rotate freely.
Step 4: Secure the Breadboard
The breadboard is essential for prototyping and connecting sensors. * Peel Adhesive: Many breadboards come with an adhesive backing. Peel off the protective layer. * Attach to BoE Board: Carefully align and press the breadboard onto the designated area on the Board of Education. This area is usually marked and designed to hold a standard solderless breadboard.
Step 5: Connect Power
Proper power connection is vital for the robot’s operation. * Insert Batteries: Place the required number of AA batteries into the battery holder. * Plug into BoE: Connect the battery pack’s connector to the power input jack on the Board of Education. There is often a power switch on the BoE board; ensure it is in the “off” position during initial setup.
Step 6: Initial Motor Wiring
Wiring the servo motors is crucial for movement. * Identify Servo Wires: Each continuous rotation servo motor typically has three wires: * Red: Power (+5V) * Black/Brown: Ground (GND) * Yellow/White/Orange: Signal (SIG) * Connect to BoE Board: The BoE board has dedicated 3-pin headers for connection to the servo motors. Connect the wires from the left servo to the header labeled “P12” and the wires from the right servo to “P13” (or similar designations, confirm with your kit’s manual). Ensure the signal, power, and ground wires are connected to their corresponding pins on the header. Mis-wiring can damage the servos or the board.
Programming the Boe-Bot: Your First Steps
With the hardware assembled, it’s time to bring your Boe-Bot to life through programming. The BASIC Stamp uses PBASIC, programmed via the Parallax BASIC Stamp Editor software.
Step 1: Install Software and Drivers
- Download BASIC Stamp Editor: Visit the Parallax website and download the latest version of the BASIC Stamp Editor software for your operating system.
- Install Drivers: The installation package usually includes the necessary USB drivers for the Board of Education. Install these drivers to allow your computer to communicate with the BS2 microcontroller.
Step 2: Connect the Boe-Bot to Your Computer
- USB Cable: Use a USB A-to-Mini-B cable to connect the BoE board’s USB port to a USB port on your computer.
- Power Switch: Ensure the power switch on the BoE board is in the “2” (regulated) position if using battery power, or the “1” position if powering directly via USB (though direct USB power isn’t recommended for running motors).
Step 3: Configure the BASIC Stamp Editor
- Select COM Port: Open the BASIC Stamp Editor. Go to “Run” -> “Select PBASIC Microcontroller & Port.” Choose “BS2” and then select the correct COM port that your computer has assigned to the BoE board. If unsure, check your computer’s Device Manager (Windows) or System Information (macOS/Linux) to find the COM port associated with the USB Serial device.
Step 4: Write Your First Program (Test Servos)
Let’s write a simple program to test the motors. Continuous rotation servos are controlled by a pulse width modulation (PWM) signal. A 1.5ms pulse usually stops them, a shorter pulse (e.g., 1ms) makes them go one way, and a longer pulse (e.g., 2ms) makes them go the other.
“`pbasic ‘ {$STAMP BS2} ‘ {$PBASIC 2.5}
DEBUG “Boe-Bot Motor Test”
‘ Define servo pins LEFT_SERVO_PIN CON 12 ‘ P12 for left servo RIGHT_SERVO_PIN CON 13 ‘ P13 for right servo
PAUSE 1000 ‘ Wait 1 second for initialization
‘ Test forward movement SERVO LEFT_SERVO_PIN, 850 ‘ Shorter pulse (e.g., 850 for counter-clockwise or forward) SERVO RIGHT_SERVO_PIN, 650 ‘ Longer pulse (e.g., 650 for clockwise or forward) DEBUG “Moving Forward…” PAUSE 3000 ‘ Move forward for 3 seconds
‘ Stop robot SERVO LEFT_SERVO_PIN, 750 ‘ Pulse for stop (typically 750 or 7500 for PBASIC’s PULSOUT) SERVO RIGHT_SERVO_PIN, 750 ‘ Pulse for stop DEBUG “Stopping…” PAUSE 2000 ‘ Stop for 2 seconds
‘ Test backward movement SERVO LEFT_SERVO_PIN, 650 SERVO RIGHT_SERVO_PIN, 850 DEBUG “Moving Backward…” PAUSE 3000 ‘ Move backward for 3 seconds
‘ Final Stop SERVO LEFT_SERVO_PIN, 750 SERVO RIGHT_SERVO_PIN, 750 DEBUG “Finished Test. Robot stopped.” END “`
Note on SERVO
vs. PULSOUT
: The SERVO
command in PBASIC is a specialized command for controlling continuous rotation servos, where a value of 750
often corresponds to the stop position, 850
to full speed in one direction, and 650
to full speed in the opposite direction. These values can vary slightly between individual servos and may require calibration. The PULSOUT
command offers finer control over pulse width if needed for other applications. For Boe-Bot servos, SERVO
is usually sufficient.
Step 5: Download and Run the Program
- Save: Save your PBASIC code (e.g.,
motor_test.bs2
). - Download: With the Boe-Bot connected and the COM port selected, click the “Run” button (looks like a play symbol or “Run” in the menu) in the BASIC Stamp Editor. The software will compile the code and download it to the BS2 chip.
- Observe: The Boe-Bot should move forward, stop, move backward, and then stop as per your program. If it moves in the wrong direction, swap the
650
and850
values for the corresponding servo, or physically swap the motor wires (red for black, etc.) on one side to reverse its direction.
Expanding Your Boe-Bot’s Capabilities: Adding Sensors
The true power of a robot comes from its ability to interact with its environment. Let’s add some common sensors.
Infrared (IR) Object Detectors
IR sensors are common for obstacle avoidance. A typical setup involves an IR LED transmitting light and a phototransistor receiving reflected light.
- Wiring:
- IR LED: Connect the anode (longer lead) to a 220-ohm resistor, then to +5V (VCC). Connect the cathode (shorter lead) to a digital I/O pin (e.g., P0 for left, P1 for right).
- Phototransistor: Connect the collector to +5V (VCC). Connect the emitter to another digital I/O pin (e.g., P2 for left, P3 for right) AND to a 10k-ohm pull-down resistor connected to ground (GND).
Programming Concept:
- To detect an object: Briefly turn on the IR LED (set its pin HIGH), then quickly read the state of the phototransistor’s pin. If the phototransistor detects reflected light, its pin will go HIGH.
- Example: “`pbasic ‘ Assuming IR LED on P0, IR Receiver on P2 ‘ P0 = Output (for LED), P2 = Input (for Receiver) OUTPUT 0 INPUT 2
HIGH 0 ‘ Turn on IR LED PAUSE 1 ‘ Small delay for light to settle IF IN2 = 1 THEN DEBUG “Object Detected!” ELSE DEBUG “Clear Path.” ENDIF LOW 0 ‘ Turn off IR LED “`
Light Sensors (Phototransistors/Photoresistors)
Light sensors allow your Boe-Bot to seek light or avoid it.
- Wiring (Phototransistor): Similar to the IR receiver setup, but without an associated IR LED. Connect the collector to +5V, emitter to an analog input (e.g., P5) via a 10k-ohm resistor to GND. The BS2 doesn’t have true analog-to-digital converters (ADCs) but can approximate analog readings using a capacitor and timing its discharge (RC decay).
- Programming Concept (RC decay method):
- Charge a capacitor attached to the sensor pin to HIGH.
- Then, change the pin to an input and measure how long it takes for the pin to go LOW (discharge through the sensor and resistor).
- More light = lower resistance = faster discharge = lower
RCTIME
value. - Example:
pbasic ' Assuming Phototransistor on P5 with capacitor and resistor DEBUG "Light Sensor Reading: " RCTIME 5, 1, light_value ' Measure discharge time on P5, expecting HIGH (1) DEBUG DEC light_value PAUSE 100
Calibration and Troubleshooting
Building a robot is an iterative process. You’ll inevitably encounter situations where things don’t work as expected.
- Motor Calibration: Continuous rotation servos often require fine-tuning for their “stop” position. The
SERVO
command’s center value (e.g., 750) might need slight adjustment (e.g., 740 or 760) for each servo to ensure they truly stop and have balanced speeds. - Sensor Thresholds: Environmental light or surface reflectivity will affect sensor readings. You’ll need to calibrate the thresholds in your code (e.g.,
IF light_value < 500 THEN...
) based on actual readings in your environment. - Power Issues: Low battery voltage can lead to erratic behavior. Ensure your batteries are fresh.
- Loose Wires: A common culprit! Double-check all connections, especially on the breadboard.
- Logic Errors: Carefully review your code. Use
DEBUG
statements liberally to print variable values and track program flow. - Consult Documentation: The Parallax Boe-Bot manual and online forums are invaluable resources. They contain detailed wiring diagrams, code examples, and troubleshooting tips.
Conclusion
Building a Boe-Bot is more than just assembling components; it’s an immersive entry into the fundamental principles of robotics. From the satisfaction of seeing your code bring a machine to life to the challenge of debugging a stubborn sensor, each step in the process builds practical skills in electronics, mechanics, and programming. The Boe-Bot platform provides a stable and supportive environment for beginners to experiment, learn, and lay the groundwork for more advanced robotic endeavors. As you master obstacle avoidance and light following, you’ll unlock the potential to create increasingly sophisticated autonomous behaviors, truly taking your first step into the exciting world of robotics.