Skip to content
Cart

Make a robot from the 10th Anniversary micro:bit GO Bundle Box!

Update on 11/11/2026: The BoxBot will be available as a Limited Edition Kit by November 20, 2026! Assembly and programming instructions are below. 

Dear Community,

I showed up today and didn't really feel like "working" although I had plenty to do. Our payroll system had double-paid one of us, a workers' compensation renewal needed attention, and the HVAC system was freezing some people while overheating others. Since it wasn't looking like a day I'd remember, I decided to make it one I wouldn't forget!

I grabbed a micro:bit 10th Anniversary Limited Edition GO Kit, a couple of micro servos and wheels, an I/O Edge Adapter for micro:bit, a box cutter, and some double-sided tape. No 3D printer, no CNC, no drawings — just an idea to make something fun with the micro:bit. I really like the GO Bundle's black box and the creative silkscreen on the module, too. This is about as simple of a robot as you can build, but it has potential for so much more with the wireless link, sensors, and sound built right into the micro:bit. 

Simply building something reminded me of what I enjoyed most in school: metal shop, sandblasting glass, RadioShack after school, programming a Timex Sinclair computer, and music. Those were opportunities to make decisions, experiment, and create something of my own. Agency sticks, and you've heard the next part from me many times: these experiences can lead to productive and rewarding careers. 

It had been a while since I'd worked in MakeCode, but I was really impressed by the additional blocks! I was able to code the LaserPing sensor and servos in just a few minutes, all from an iPad! Floating-point math, background processing, and calculations are easy in MakeCode. MakeCode's Bluetooth downloader with an iPad is really smooth, and especially useful when you're working on a project that wants to roll away every time you download new code.  

My micro:bit BoxBot is basically these item, which will be available in a Limited Edition Kit around Thanksgiving:

You can now build this on your own with the instructions below, or get the parts in a box from Parallax! 

Sincerely,

Ken Gracey
CEO

Build and Program Your BoxBot

What began as a quick experiment with a micro:bit GO bundle box is now a hands-on robot project. First build the robot using the same simple approach shown in the original BoxBot story and video. Then try five tested programming activities in either MakeCode or MicroPython.

Part 1: Build the Robot

Watch the original build: micro:bit 10th Anniversary Box Robot Quick Build (video). The video and original parts links above are the visual reference for assembly.

Gather the parts

  • 10th Anniversary micro:bit GO Bundle box and micro:bit
  • Parallax micro:bit Edge I/O Adapter
  • Two continuous-rotation micro servos and two wheels
  • Parallax LaserPing distance sensor
  • Two phototransistors for left and right light sensing
  • Small breadboard, jumper wires, 220 Ω series resistors, and 2 kΩ pull-down resistors for the sensor circuits
  • Power supply appropriate for the servos and adapter, double-sided tape, and a cutting tool handled by an adult

Assemble the BoxBot

  1. Plan the layout. Set the two servos along opposite sides of the box, with their wheels outside. Place the Edge I/O Adapter where the micro:bit and wires will be accessible. Before cutting, check that the box can close or fold as intended.
  2. Make openings for the wheels. With adult help, cut only the clearance needed for each servo shaft or wheel. Keep the cutting tool away from all electronics and the battery pack.
  3. Mount the servos and wheels. Use double-sided tape to hold the servos securely. Install the wheels, check that they turn freely, and make sure the wheels touch the floor evenly. Add a simple skid or support if needed so the box does not drag.
  4. Install the controller and power. Fit the micro:bit into the Edge I/O Adapter, mount the adapter, and route the wires neatly. Connect the servo supply according to the adapter and servo ratings, sharing a common ground with the micro:bit. Switch power off while rewiring.
  5. Add the LaserPing. Mount the sensor facing forward with an unobstructed view. Connect its signal to P8 through the 220 Ω series resistor, then connect sensor power and ground as required by the sensor.
  6. Add the light sensors. Point one phototransistor slightly left and one slightly right. Connect left light sensing to P10 and right to P4, using the tested 2 kΩ pull-down and series-resistor circuits. Avoid covering the sensors with tape.
  7. Check your work. Confirm polarity, ground connections, and signal pins before applying power. Begin with Project 1 to check wheel directions, then test each sensor separately.

Safety: Have an adult make the cuts. Test driving on a clear floor, not on a tabletop or near stairs. Disconnect power before moving wires.

BoxBot Connection Reference

Part micro:bit pin Use
Left continuous-rotation servo P1 Motor signal
Right continuous-rotation servo P0 Motor signal
LaserPing P8 Distance measurement
Left phototransistor P10 Analog light level
Right phototransistor P4 Analog light level

Light-sensor note: P4 and P10 also connect to the micro:bit LED matrix. The light-sensing programs turn the matrix off before making analog readings.

BoxBot assembled robot with micro:bit, breadboard, wiring, and phototransistors

Part 2: Program the Robot

Start at Project 1 and work your way through all five. For MakeCode, use the blue Open in MakeCode button to open the complete tested program directly in the editor. For MicroPython, use Copy Code to paste the complete program into the micro:bit Python Editor, or use Download Code to get the .py file. Run one project on the micro:bit at a time.

Project 1: Basic Movement — Servo Control

Make BoxBot drive forward, backward, turn left and right, and stop.

How it works

BoxBot drives forward for two seconds, stops, reverses for two seconds, then turns left and right. A pause separates each movement.

MicroPython

Download Code ↓

from microbit import *

pin1.set_analog_period(20)
pin0.set_analog_period(20)

def pulse(us):
    return round(us * 1023 / 20000)

def drive(left, right):
    pin1.write_analog(pulse(left))
    pin0.write_analog(pulse(right))

def stop():
    drive(1500, 1500)

def forward():
    drive(1700, 1300)

def backward():
    drive(1300, 1700)

def turn_left():
    drive(1300, 1300)

def turn_right():
    drive(1700, 1700)

sleep(1000)
forward()
sleep(2000)
stop()
sleep(1000)
backward()
sleep(2000)
stop()
sleep(1000)
turn_left()
sleep(800)
stop()
sleep(1000)
turn_right()
sleep(800)
stop()

Try it: Place BoxBot on the floor or raise the wheels off the ground while checking directions. Run the sequence and watch both wheels.

Experiment: Change the forward driving time from 2 seconds to 1 second. How much less distance does BoxBot travel?

Project 2: LaserPing Test

Measure distance in millimeters with the LaserPing sensor connected to P8.

How it works

LaserPing measures distance in millimeters. Valid readings appear on the micro:bit display and in the serial monitor. Invalid readings display ERR.

MicroPython

Download Code ↓

from microbit import *
from machine import time_pulse_us
from utime import sleep_us

def distance_mm():
    pin8.write_digital(0)
    sleep_us(5)
    pin8.write_digital(1)
    sleep_us(5)
    pin8.write_digital(0)
    pin8.read_digital()
    duration = time_pulse_us(pin8, 1, 20000)
    if duration < 115 or duration >= 13000:
        return -1
    return round(duration * 0.1715)

while True:
    mm = distance_mm()
    if mm < 0:
        display.scroll("ERR")
    else:
        print("Distance:", mm, "mm")
        display.scroll(str(mm))
    sleep(100)

Try it: Connect the micro:bit by USB. Move a book or hand toward and away from LaserPing. Watch the measurements on the screen or serial monitor.

Experiment: Measure how far away your hand is when the reading first reaches 200 mm. Does it agree with a ruler?

Project 3: Roaming with LaserPing

Let BoxBot roam, back away from obstacles, and turn to find another route.

How it works

BoxBot drives forward until the LaserPing detects an obstacle within 20 cm. It stops, reverses, turns, and continues driving. Invalid distance readings cause it to stop.

MicroPython

Download Code ↓

from microbit import *
from machine import time_pulse_us
from utime import sleep_us

pin0.set_analog_period(20)
pin1.set_analog_period(20)

def drive(left, right):
    pin1.write_analog(round(left * 1023 / 20000))
    pin0.write_analog(round(right * 1023 / 20000))

def distance_mm():
    pin8.write_digital(0)
    sleep_us(5)
    pin8.write_digital(1)
    sleep_us(5)
    pin8.write_digital(0)
    pin8.read_digital()
    t = time_pulse_us(pin8, 1, 20000)
    if t < 115 or t >= 13000:
        return -1
    return round(t * 0.1715)

while True:
    distance = distance_mm()
    if distance < 0:
        drive(1500, 1500)
        sleep(200)
    elif distance < 200:
        drive(1500, 1500)
        sleep(200)
        drive(1300, 1700)
        sleep(500)
        drive(1700, 1700)
        sleep(700)
    else:
        drive(1700, 1300)
        sleep(100)

Try it: Set BoxBot on the floor in a clear test area. Place a box in front of it and watch it reverse and turn when the measured distance is less than 200 mm.

Experiment: Change the obstacle limit from 200 mm to 300 mm. Does BoxBot turn sooner?

Project 4: Phototransistor Test

Measure light intensity with two phototransistors: left on P10 and right on P4.

How it works

The program disables the LED matrix to free P10 and P4, then sends the left and right light readings to the serial monitor.

MicroPython

Download Code ↓

from microbit import *

display.off()

while True:
    left_light = pin10.read_analog()
    right_light = pin4.read_analog()
    print("Left:", left_light,
          "Right:", right_light)
    sleep(200)

Try it: Open the serial monitor, shine a flashlight onto each sensor separately, and cover each sensor to compare its readings. The LED matrix is disabled to free P4 and P10.

Experiment: Write down the two readings in daylight and in shade. Which sensor has the larger change?

Project 5: Roaming with Light Following

Make BoxBot steer toward a light source by slowing the wheel on the brighter side.

How it works

Press A to start and B to stop. BoxBot slows the wheel on the brighter side to steer toward light. In low light, it rotates to search.

Tune light following for your BoxBot

The starting values worked on our test robot. Your lighting, phototransistor placement, sensor differences, and wheel response may require different settings. Tune the program for your robot and the space where you use it; begin with the existing sensor circuit.

Both the MakeCode and MicroPython examples use the same settings: DEADBAND = 40 and SENSITIVITY = 0.4. Open your own copy of the program, change one setting at a time, and download it again after each change.

Setting What it does How to tune it
DEADBAND
Starts at 40
Ignores a left/right sensor difference smaller than this number of analog counts. This helps prevent steering in response to small differences. If BoxBot keeps making small corrections with the light centered, try 60, then 80. If it ignores small movements of the light, try 30, then 20. A larger value creates a wider neutral zone; a smaller value makes small differences matter.
SENSITIVITY
Starts at 0.4
Sets how strongly BoxBot slows one wheel when the sensor difference is outside the deadband. The program limits the maximum correction. If turns are abrupt or BoxBot swings back and forth, try 0.3, then 0.2. If steering is too weak, try 0.5, then 0.6. These are trial values, not settings every robot needs.

Use the same test each time

  1. Run Project 4 first. With both sensors evenly lit, compare the left and right readings. Check that each reading increases when you shine light on that sensor. Aim the sensors consistently and remove shadows from wires or the box.
  2. Test Project 5 on a clear floor. Keep the flashlight at a consistent distance and height. Center it, then move it slowly left and right. Press A to start and B to stop.
  3. Adjust DEADBAND first to reduce unwanted corrections with the light centered. Then adjust SENSITIVITY for smooth, useful turns. Repeat the same test after each change.
  4. Record the values that work best, along with your lighting conditions. If a change makes performance worse, return to your previous values.

If it keeps searching: When both readings are below MIN_LIGHT (100 in the example), BoxBot rotates to search. Use brighter light or move the flashlight closer before judging the deadband and sensitivity.

If it consistently pulls to one side: Check sensor aim and unequal readings under even illumination, and check the wheel response. Deadband and sensitivity do not calibrate sensor imbalance or mismatched servos; avoid using a very large deadband to hide those problems.

MicroPython

Download Code ↓

from microbit import *

# BoxBot - Smooth Light Following
# Left servo P1; right servo P0
# Left light P10; right light P4
display.off()
pin1.set_analog_period(20)
pin0.set_analog_period(20)

BASE_SPEED = 200
SENSITIVITY = 0.4
DEADBAND = 40
MIN_LIGHT = 100
running = False

def pulse(us):
    return round(us * 1023 / 20000)

def drive(left, right):
    pin1.write_analog(pulse(left))
    pin0.write_analog(pulse(right))

def stop():
    drive(1500, 1500)

stop()
while True:
    if button_a.was_pressed():
        running = True
    if button_b.was_pressed():
        running = False
        stop()
    if running:
        left = pin10.read_analog()
        right = pin4.read_analog()
        difference = left - right
        if left < MIN_LIGHT and right < MIN_LIGHT:
            drive(1450, 1450)
        else:
            if abs(difference) < DEADBAND:
                difference = 0
            correction = min(
                BASE_SPEED - 40,
                abs(difference) * SENSITIVITY)
            left_speed = BASE_SPEED
            right_speed = BASE_SPEED
            if difference > 0:
                left_speed -= correction
            elif difference < 0:
                right_speed -= correction
            drive(1500 + left_speed,
                  1500 - right_speed)
        print("Left:", left,
              "Right:", right,
              "Difference:", difference)
    else:
        stop()
    sleep(100)

Try it: Press A to start, move a flashlight slowly to the left and right, and press B to stop. In low light, BoxBot rotates to search.

Experiment: Change SENSITIVITY from 0.4 to 0.2, then 0.8. How does the turning change?

Need help?

Try these checks first: are the signal wires on the correct pins? Is the battery connected? Do the motor wheels spin freely? Are you running only one program at a time? For light sensors on P4 and P10, make sure the LED display is disabled.

Want an AI explanation? A teacher or an eligible student can open ChatGPT and paste: “I'm building the Parallax BoxBot. My left servo is P1, right servo P0, LaserPing P8, left light sensor P10 and right light sensor P4. Help me understand Project [number] without changing the tested code unless I ask.”

 

Previous Post Next Post

2 Comments

Way cool Ken!

Whit Stodghill

This is exactly the kind of project that makes me excited about the possibilities of the micro:bit!

What strikes me most isn’t necessarily the robot itself (although, let’s be honest, making a robot out of a cardboard box is pretty fantastic). It’s the reminder that meaningful making doesn’t require elaborate equipment, extensive preparation, or even a fully formed plan. Sometimes all you need is an idea, a few components, and the freedom to experiment.

I especially appreciate your connection to student agency. Those opportunities to tinker, make decisions, troubleshoot, and create something of our own are often the experiences that stick with us long after we’ve forgotten the individual skills we learned along the way.

I can definitely see the appeal of packaging this as a kit for teachers who want everything ready to go. But I also love the idea of teachers looking at this project and thinking about what they already have on hand that could be repurposed. A cardboard box, a few odds and ends, and the I/O Edge for micro:bit could be the starting point for all sorts of creations!

I’ve already loaded up a Parallax shopping cart.

Now excuse me while I inventory the contents of my house and see what kind of robot I can build!

Linda Morgan

Leave A Comment