Build a robot vacuum lesson plan
Bumpers and cliff sensors, wheel encoders and a map, random bounce against spiral against rows, a five-layer behavior ladder, and a battery that sends it home to its dock.
Objectives and materials
By the end, students can
- Two bumpers and a cliff sensor, and the layers that decide which one wins.
- Encoders and dead reckoning, then three coverage patterns scored on a map.
- A five-layer behavior ladder, a battery read through a divider, and the trip home to the dock.
- Clean a whole room, survive the furniture and dock.
Materials for the whole unit
- Arduino Uno R3
- Battery: AA, coin cell, LiPo
- Limit switch, lever microswitch x 2
- Line sensor, TCRT5000
- Motor driver, DRV8833
- Obstacle sensor, FC-51
- Resistor x 2
- Robot car chassis, 2WD
Every part is already on the simulator’s bench, so there is nothing to buy or hand out. The counts are the most any one lesson uses, if you build it on real breadboards too.
Sensing the world
Two bumpers and a cliff sensor, and the layers that decide which one wins.
| Lesson | Time | What students do |
|---|---|---|
| Bump sensorsThe gallery’s robot vacuum: two lever microswitches on the front corners. Hit a wall on each side, watch it back up and turn away from the hit, and see why the turn is random. | 60 min |
|
| Cliff sensorsA TCRT5000 looking at the floor: infrared light that comes back means floor, none means a stair. Find the edge, see the cliff beat a bump, and meet the black rug every robot vacuum fears. | 50 min |
|
Materials
- Arduino Uno R3
- Limit switch, lever microswitch x 2
- Line sensor, TCRT5000
- Motor driver, DRV8833
- Robot car chassis, 2WD
Check for understanding
Each student finishes "Cliff sensors" on their own, without opening the hints. The simulator checks 4 of its 4 steps as they go.
Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Back up, then turn".
Covering a room
Encoders and dead reckoning, then three coverage patterns scored on a map.
| Lesson | Time | What students do |
|---|---|---|
| Where am I? EncodersThe vacuum grown up: wheel encoders, dead reckoning and a map of a room in 10 cm squares. Drive a meter, count the edges, turn on the spot, and calibrate the wheel size. | 60 min |
|
| Coverage patternsThree ways to clean the same room and a map that scores them: random bounce, a widening spiral, and rows back and forth (boustrophedon). Measure how much each covers, and tighten the rows. | 50 min |
|
Materials
- Arduino Uno R3
- Battery: AA, coin cell, LiPo
- Limit switch, lever microswitch x 2
- Line sensor, TCRT5000
- Motor driver, DRV8833
- Obstacle sensor, FC-51
- Resistor x 2
- Robot car chassis, 2WD
Check for understanding
Each student finishes "Coverage patterns" on their own, without opening the hints. The simulator checks 4 of its 4 steps as they go.
Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Tighter lanes".
Behaviors and power
A five-layer behavior ladder, a battery read through a divider, and the trip home to the dock.
| Lesson | Time | What students do |
|---|---|---|
| The behavior ladderFive layers, the higher always winning: cliff, bumper, obstacle, battery, clean. Trigger each one while it cleans, and prove a cliff beats a bump. | 50 min |
|
| Battery and dockingRead the pack through a voltage divider, decide when to head home, and drive back to the dock by dead reckoning. Then raise the threshold and see why real docks use an infrared beacon for the last bit. | 50 min |
|
Materials
- Arduino Uno R3
- Battery: AA, coin cell, LiPo
- Limit switch, lever microswitch x 2
- Line sensor, TCRT5000
- Motor driver, DRV8833
- Obstacle sensor, FC-51
- Resistor x 2
- Robot car chassis, 2WD
Check for understanding
Each student finishes "Battery and docking" on their own, without opening the hints. The simulator checks 4 of its 4 steps as they go.
Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Come home sooner".
Project
Clean a whole room, survive the furniture and dock.
| Lesson | Time | What students do |
|---|---|---|
| Project: clean a roomPut it all together: clean the whole room in rows, with the ladder watching, deal with a chair leg and a stair on the way, then drive home and dock. | 50 min |
|
Materials
- Arduino Uno R3
- Battery: AA, coin cell, LiPo
- Limit switch, lever microswitch x 2
- Line sensor, TCRT5000
- Motor driver, DRV8833
- Obstacle sensor, FC-51
- Resistor x 2
- Robot car chassis, 2WD
Check for understanding
Each student finishes "Project: clean a room" on their own, without opening the hints. The simulator checks 4 of its 4 steps as they go.
Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Make it yours".
Teach this unit as a class
Start a class from this course and its 7 lessons are assigned in one go, in order. Students join with a six-character code or printed login cards, and each one’s work comes back to you.
The class tools are free for 30 days for one class of up to 20 students, with no card. The lessons themselves are free either way.