Challenge 1
Clean a strip of scattered paper and leave the brush stopped at the end. Anyone should be able to see the machine has finished, because nothing on it is still turning.
EV3 Robotics›Level 2 · Intermediate›Lesson 15
Level 2 · Lesson 15 · EV3-L02-1560 minutes · Ages 9–16 · Model: Automatic Cleaner
The Automatic Cleaner: a driving base with a spinning brush on the front. Two Large Motors move it across the floor, and a Medium Motor spins the brush.
Here is the problem. The brush needs to spin fast — a slow brush pushes dirt rather than sweeping it. The base needs to move slowly, because a cleaner that races across a room has not cleaned it.
Two different speeds, on the same machine, at the same moment. And this time you are going to do it in one stack.
Robot vacuum cleaners are in ordinary houses now. Underneath, they all look the same: two driven wheels, a spinning side brush that flicks dirt out of corners and into the machine’s path, and a roller underneath.

The brush and the wheels are doing completely unrelated jobs, so nothing says they should run at the same rate. The brush’s speed is set by what it takes to throw dirt inwards — too slow and it just nudges it along. The wheels’ speed is set by how long the machine needs to spend over any patch of floor to actually pick it up.
So they get separate motors. Not because two is neater, but because one motor could only ever give both jobs the same speed.
Look at the photo again. That machine is doing everything it was told to. The wheels are turning, the brush is turning, and it is achieving nothing, because it drove somewhere it could not get out of and nothing in it is checking whether the driving is working.
A machine that runs is not the same as a machine that is working.
Two motor blocks that look almost the same behave completely differently, and the difference is whether the block waits.
| Block | Does the stack wait for it? | When does the motor stop? |
|---|---|---|
| run for (2) rotations at (50) % | Yes. Nothing below it happens until those two rotations are done. | By itself, after 2 rotations. |
| start motor at (80) % speed | No. The very next block runs immediately. | Never — until something else tells it to. It is still going after the program ends. |
That second row is how you get two speeds out of one stack. Start the brush — the stack does not wait, so it carries straight on — and then drive the base. The brush is spinning the whole time the drive block is running, because nothing ever asked it to stop.
[A v] start motor at (80) % speed :: motors move [forward v] for (4) [rotations v] :: movement [A v] stop motor :: motors
Read the middle block again. While the base is grinding through those four rotations, the stack is stuck on that block — and that is fine, because the brush does not need the stack. It was set going and it stays going.
Leave off the last block and the brush never stops. The program will end, the screen will go back to the menu, and the brush will still be spinning, because nothing that starts a motor ever stops it. Every start motor you write is a promise to write a stop motor somewhere.
Everything an EV3 does begins with a motor turning. Before worrying about how far or how fast, there are only two things to say to a motor: start and stop. The blocks are the same whichever motor you use — only the port letter changes.
| Block | What it does |
|---|---|
[A v] start motor [clockwise v] :: motors | Starts the motor and immediately carries on to the next block. The motor keeps turning on its own. |
[A v] stop motor :: motors | Stops the motor. |
wait (2) seconds | Holds the program here, which is how you control how long a motor runs. |
Because start motor does not wait, a motor started on its own would run until the program ended. The pattern that gives a motor a length is three blocks:
when program starts :: events hat [A v] start motor [clockwise v] :: motors wait (2) seconds [A v] stop motor :: motors
Read it aloud: start it, leave it two seconds, stop it. Change the wait and you change how far the motor gets.
The highlight below follows the block the Brick is running, and the shaft turns only while the program is between start motor and stop motor. Notice that the count keeps climbing all the way through the wait — the wait does not pause the motor, it pauses the program.
0.00rotations so farnoshaft turning
The count does not pause when the program does. A wait holds up the blocks, and the motor carries on turning underneath it.
This is the whole idea behind start motor: it hands the motor its instruction and moves on, leaving the motor running behind it. Nothing stops the shaft until a block tells it to.
The direction dropdown says clockwise or counterclockwise — but clockwise seen from where? Always from the axle end: look straight at the shaft coming towards you, and clockwise is the way a clock’s hands go.
Here the Medium Motor faces you, so its output axle points straight out of the page. This is the view to picture when you are choosing a direction.
when program starts :: events hat [A v] start motor [clockwise v] :: motors wait (2) seconds [A v] stop motor :: motors
A Medium Motor normally lives in port A or D.
The Large Motor is shown from the side, which is the face its axle comes out of — so once again you are looking straight down the shaft.
when program starts :: events hat [B v] start motor [clockwise v] :: motors wait (2) seconds [B v] stop motor :: motors
A Large Motor normally lives in port B or C. Compare the two programs: they are the same three blocks, and only A has become B.
A fan, a conveyor belt or a spinning ride does not need to stop at an exact position — it just needs to run while something is happening. For those, timing the motor is simpler and perfectly good enough.
“Run for” waits and stops itself. “Start” does neither.
A driving base has two Large Motors, one per wheel. You could drive them with two separate motor blocks — but they would never start at quite the same instant, and the robot would curve away. EV3 has a separate family of Movement blocks that treat the pair as a single driving base.
| Block | What it does |
|---|---|
set movement motors to [B v] and [C v] :: movement | Tells the Movement blocks which two ports are the driving wheels. Put it at the top of the program, before any movement. |
move [forward v] for (2) [rotations v] :: movement | Drives both wheels together, so the robot travels in a straight line. |
move for (1) [rotations v] at (75) (25) % speed :: movement | Drives the two wheels at different speeds, which makes the robot curve. |
set movement speed to (50) % :: movement | Sets how fast the driving base travels from now on. |
set movement motors to [B] and [C] is the block that decides which two motors every Movement block after it will drive. It does not look at the robot. It drives the two ports you name, whether or not there is a motor in them — so those two letters have to be the two sockets the cables are actually in.
This is the single commonest reason a driving base does nothing, and it is invisible in the program: every block is spelled correctly and the robot still will not go.
the same program on both robots
The yellow outline marks the two ports the block is driving. A robot only goes straight when both of them have a motor in them.
Both robots run the identical program. The left one has its motors in B and C, so both named ports have a motor and the robot drives straight. The right one is plugged into A and B: the block drives B, finds nothing in C, and never mentions the motor in A at all — so one wheel turns, one wheel sits there, and the robot swings round the dead one instead of driving.
If neither named port has a motor in it — cables in A and D, say, with the block still set to B and C — the robot does not move at all. The program runs happily to the end and the Brick reports nothing wrong, because as far as it is concerned it did exactly what it was told.
So before you look for a bug in the program, look at the cables: read the port letters off the Brick, then make the block say those two. B and C are only the usual choice, not a rule — if your build has the driving motors in A and D, set the block to A and D and everything works.
Everything a driving base can do comes from those two speed numbers. Try each button below and watch the trail the robot leaves.
The path is worked out from the two wheel speeds in the block, not drawn by hand — so changing the preset changes the numbers and the shape together.
Notice there is no steering block anywhere in that program, and no steering part anywhere on the robot. The turn is made entirely by driving the two wheels different amounts.
when program starts :: events hat set movement motors to [B v] and [C v] :: movement move [forward v] for (2) [rotations v] :: movement move for (1) [rotations v] at (50) (-50) % speed :: movement
“Move forward 2 rotations” says nothing about the floor — it says how many times the wheels go round. How far the robot actually travels depends on how big the wheels are, and once round a standard EV3 driving wheel is about 17.5 cm.
Before doing any sums, get a feel for it. Drag the robot along and watch both scales at once — rotations on top, centimetres underneath, the same line. Land on the half marks: there is a number between 1 and 2, and it is 1.5.
Drag the robot, or use the arrow keys — it moves in half rotations. Rotations above the line, centimetres below.
1.5 — a half rotation past 1. Half a turn of the wheels is 8.75 cm, so halves matter.
35 ÷ 17.5 = 2. That is a number you can type straight into the block.
set movement motors to [B v] and [C v] :: movement set movement speed to (30) % :: movement move [forward v] for (2) [rotations v] :: movement
Steering at right 100 or left 100 drives the two wheels in opposite directions, so the base stops travelling and pivots where it stands. The angle it sweeps is a simple doubling of the rotations:
Half a rotation is the one worth remembering: a square corner, 90°.
| Rotations | The robot turns |
|---|---|
| 0.25 | 45° — half a corner |
| 0.5 | 90° — a square corner |
| 1 | 180° — turn round and face back |
| 2 | 360° — all the way round |
The one to memorise is 0.5 rotations = 90°. Everything else follows from doubling or halving it.
set movement speed to (20) % :: movement move [right: 100] for (0.5) [rotations v] :: movement
Turn slowly. The wheels on a driving base are big and the robot carries a lot of weight, so at full speed it keeps going after the motors stop and lands past the angle you asked for. Somewhere between 15% and 30% speed is where turns become repeatable. A turn that overshoots is almost always a turn taken too fast, not a wrong number.
These figures belong to your robot. The distance depends on the wheels and the angle depends on how far apart they are, so a wider base needs a different number for 90°. Test it, measure what actually happened, and adjust — the same discipline as the Gyro Sensor tolerance.
Every wheeled vehicle steers this way — a tank, a digger, an office chair with two driven castors. Cars use a steering rack instead, but a robot that turns by driving its wheels at different speeds needs no steering mechanism at all.
Say this back before moving on: “If I start it, I have to stop it.”
| Part | What it is doing here |
|---|---|
| EV3 Intelligent Brick | Runs three motors at two different speeds, and rides on the machine. Its weight is what gives the wheels grip. |
| Large Motor ×2 — the drive | Ports B and C, driven as a pair by the Movement blocks so the cleaner tracks straight. |
| Medium Motor — the brush | Fast and light. The Medium Motor is the right choice precisely because a brush needs speed rather than force. |
| The brush itself (not electronic) | Must touch the floor lightly. Pressed down hard it stalls the motor; held clear it sweeps nothing. |
Sensors go in ports 1, 2, 3, 4. Motors go in ports A, B, C, D. They are not interchangeable, and nothing will tell you politely if you swap them.
| Part | Port | Why this one |
|---|---|---|
| Brush (Medium Motor) | A | A job motor, kept off B and C so it is never accidentally swept up into the movement pair. |
| Left drive (Large) | B | B is left, and the Movement blocks assume it. |
| Right drive (Large) | C | C is right. |
Check your own build now:
Two routes, and either is fine. USB is the reliable one and the one to fall back on when a room’s Bluetooth is busy; Bluetooth leaves the robot free to move, which some models need.
Do these in order. Naming the Brick after you go looking for it in the list is how groups end up driving each other’s robots.
EV3 until somebody changes it.EV3.The two failures, every class, every time. The Brick has gone to sleep while you were building — press the centre button to wake it. Or you have paired with the group at the next table, which is why the name matters.
The long version, including Port View and how to read the port tiles, is in the Brick & Bluetooth guide.
Bluetooth, definitely. This model drives across a floor with a spinning brush on the front. A USB cable will be dragged along the floor and then into the brush.
One cleaning run: brush on, sweep a strip, come back, brush off — and say so on the screen at each stage.
when program starts :: events hat set movement motors to [B v] and [C v] :: movement set movement speed to (30) % :: movement clear display :: display write [Bersih...] at line (1) :: display [A v] start motor at (80) % speed :: motors move [forward v] for (4) [rotations v] :: movement move [backward v] for (4) [rotations v] :: movement [A v] stop motor :: motors write [Siap] at line (3) :: display play beep (70) for (0.4) seconds :: sound
What success looks like: the brush comes up to speed first, then the machine sets off while the brush is still spinning, and the brush stops at the same moment the machine finishes. Watch the brush during the driving — that overlap is the whole result.
If the brush only spins after the driving finishes, you have used run for instead of start motor. The stack is waiting for the brush to complete a set number of rotations before it will start driving.
Same scattered mess each run — sweep it back into place before each test, or you are grading a different job every time.
[A v] run for (4) [rotations v] at (80) % speed. Predict what happens before you run it, then watch the machine do the two jobs one after the other instead of together.start motor back and delete the stop motor. Run it, and notice the brush is still going when the program has ended. Then put it back.Step 5 is the real engineering. Faster is not automatically better: past a certain speed the brush stops sweeping dirt inwards and starts firing it across the room. The best setting is a balance between two motors that have nothing to do with each other, and you can only find it by trying.
Separate motors mean separate decisions. Two speeds is not twice the work — it is two questions.

Build the model before you read any further. Everything after this is about making it do something, and none of it will make much sense with nothing on the table in front of you.
Use the viewer's own controls to zoom and turn pages. Fullscreen makes it big enough to build from.
Check the finished build against the picture before you switch anything on. A motor mounted the wrong way round is far easier to spot now than it is to debug later, when it looks like a program fault.
Work through the challenges in order — each is harder than the last. The mission comes after all three, and it is meant to make you plan before you build.
Clean a strip of scattered paper and leave the brush stopped at the end. Anyone should be able to see the machine has finished, because nothing on it is still turning.
Find the best pair of speeds. Keep the same test mess and the same strip, and try at least four combinations of brush speed and drive speed. Record each one and how much it picked up. Name the winner and say why the fastest brush was not it.
Make the cleaner report itself while it works. Screen and sound must show which stage it is in — brush spinning up, cleaning, returning, finished — without ever stopping the cleaning to do it.
Design a cleaning run for a real area, not a strip. Pick a floor area about a metre square and mark its corners with tape. Your machine has to cover it — all of it — and stop with everything switched off. Plan the route on paper first, as a drawing with arrows. Decide where each pass starts and ends, how far sideways the machine moves between passes, and whether the brush should be running during the turns or not. That last one is a real decision and you should be able to defend it. Then run it over a scattered mess and photograph or sketch what is left. Two questions when you present it. Where did your route leave dirt behind, and was that a fault in the plan or in the driving? And your cleaner cannot tell whether an area is clean — describe what you would have to add for it to know when to stop, rather than stopping because the program ran out.