
Warehouse Picker Robot
Follow a line to a shelf, pick up a box and bring it back
What you'll build
In big warehouses, robots fetch boxes from the shelves by themselves, following lines or markers on the floor. In this project MIEO becomes one of them: a forklift with two lifting forks on a servo. Press L and it follows the line to the shelf, slides its forks under a box, lifts it, turns round and follows the line home, where it puts the box down and gets ready for the next order.
What you'll learn
- Joining line following and a servo into one job
- Using a black bar across the line as a place marker
- Repeating the same steps for the trip out and the trip home
- Using a flag variable to finish a “repeat until”
You'll need
- Mieo board
- Two N20 motors and their wheels
- Battery
- 3D-printed mountings
- Caster wheel
- Screws and screwdriver
- A servo motor, from the MIEO kit
- Forklift parts, from the Mieo Pro kit
- Line follower chart and black tape
- A small light box, such as an empty matchbox
- A USB cable, or Bluetooth on your computer
- The Robolab app (free)
Stay safe
- Ask an adult to help with the small screws.
- Lift MIEO's wheels off the table before you upload a driving program, so it can't drive off the edge.
- Plug extra parts only into the connector this page names. Wiring a part to the wrong connector can damage it for good.
Build it
- Build the forklift from your Mieo Pro kit, with both N20 motors, their wheels, the caster wheel and the battery, as the Mieo Pro build guide shows.
- With MIEO switched off, plug the forks' servo into connector S1, the right way round.
- Upload the program once before fitting the forks: the servo turns to 20. Then fit the forks lying flat, just above the floor.
- On a straight part of the line, stick two strips of black tape across it, about 60 cm apart: the home bar and the shelf bar. Put the box just past the shelf bar.
- Put MIEO on the line just in front of the home bar, facing the shelf, and connect it to your computer.
Code it
- Open Robolab, choose Mieo, connect and set the switch at the top right to Upload. Make a variable called arrived.
- Start with “when mieo starts up”, “set line follower speed 40 % left threshold 1700 right threshold 2200”, “set servo on Servo 1 to 20 angle” and “show think”. Add a “forever” loop with “wait until is button L pressed?” and “show happy” inside.
- Go to the shelf: “set arrived to 0”, then “repeat until arrived = 1” with “do line following” inside. In the gap of “do line following”, which runs at a black bar, add “stop robot” and “set arrived to 1”.
- Pick up: “go forward at 30 % speed for 0.4 seconds” to slide under the box, “set servo on Servo 1 to 80 angle” and “wait 0.5 seconds”. Then back off past the bar with “go backward at 30 % speed for 0.8 seconds” and turn round with “go right at 50 % speed for 1.2 seconds”.
- Come home: the same “set arrived to 0” and “repeat until” with “do line following” as before.
- Put down: “set servo on Servo 1 to 20 angle”, “wait 0.5 seconds” and “play sound win until done”. Then “go backward at 30 % speed for 0.4 seconds” to get off the bar, turn round again, and “show think”.
- Lift the wheels and upload, then press L.
Upload mode: Robolab turns your blocks into MicroPython and sends them to MIEO over USB or Bluetooth. MIEO then runs the program by itself, even after you unplug it.

when mieo starts up
set line follower speed (40) % left threshold (1700) right threshold (2200)
set servo on Servo [1 v] to (20) angle
show [think v]
forever
wait until <is button [L v] pressed?>
show [happy v]
set [arrived v] to (0)
repeat until <(arrived) = (1)>
do line following
stop robot
set [arrived v] to (1)
end
end
go [forward v] at (30) % speed for (0.4) seconds
set servo on Servo [1 v] to (80) angle
wait (0.5) seconds
go [backward v] at (30) % speed for (0.8) seconds
go [right v] at (50) % speed for (1.2) seconds
set [arrived v] to (0)
repeat until <(arrived) = (1)>
do line following
stop robot
set [arrived v] to (1)
end
end
set servo on Servo [1 v] to (20) angle
wait (0.5) seconds
play sound [win v] until done
go [backward v] at (30) % speed for (0.4) seconds
go [right v] at (50) % speed for (1.2) seconds
show [think v]
endSee the MicroPython
# generated by Robolab
import mieo
arrived = 0
mieo.initializelinefollower(1700, 2200, speed=40)
mieo.setservo('S1', 20)
mieo.showemotion('think')
while True:
while not mieo.button('L'):
pass
mieo.showemotion('happy')
arrived = 0
while not arrived == 1:
mieo.followlinestep()
if mieo.atlinecross():
mieo.stoprobot()
arrived = 1
mieo.run('forward', 30)
mieo.sleep(0.4 * 1000)
mieo.stoprobot()
mieo.setservo('S1', 80)
mieo.sleep(0.5 * 1000)
mieo.run('backward', 30)
mieo.sleep(0.8 * 1000)
mieo.stoprobot()
mieo.run('right', 50)
mieo.sleep(1.2 * 1000)
mieo.stoprobot()
arrived = 0
while not arrived == 1:
mieo.followlinestep()
if mieo.atlinecross():
mieo.stoprobot()
arrived = 1
mieo.setservo('S1', 20)
mieo.sleep(0.5 * 1000)
mieo.playsounduntildone('win')
mieo.run('backward', 30)
mieo.sleep(0.4 * 1000)
mieo.stoprobot()
mieo.run('right', 50)
mieo.sleep(1.2 * 1000)
mieo.stoprobot()
mieo.showemotion('think')
Test it
Press L: MIEO smiles and follows the line to the shelf bar, where it stops. It creeps forward, its forks slide under the box and lift it, then it backs off, turns round and follows the line home. At the home bar it lowers the box, plays its win sound, backs off and turns round to face the shelf again, ready for the next press.
If it doesn't work
- MIEO stops as soon as you press L, or never leaves the shelf? It's sitting on a bar when it starts to follow the line. Start it just in front of the home bar, and back off further from the shelf if you need to.
- The forks push the box away instead of sliding under it? The forks must lie flat at 20; change the 0.4 seconds of creeping a little at a time.
- It loses the line after turning round? Make the turn a little shorter or longer, so MIEO ends up facing straight along the line.
Make it your own
- Easy: make MIEO celebrate differently when the box arrives home, with a face and a pattern.
- Medium: add a third bar between home and the shelf where MIEO stops for a second to “scan” the box with a beep.
- Hard: put two boxes at the shelf and make MIEO fetch them one after another, counting the trips with a variable.
What to build next
Robot arms
Automated Pick-and-Place System
Grab an object automatically when the sensor sees it
Robot arms
Remote-Controlled Robotic Arm
Work an arm and gripper with two servos from your keyboard
AI
Voice Controlled Car
Say go, stop, left or right to steer MIEO