Basic
Follow the black line from the start box to Home. Stop fully inside Home.

Quick Learn — the model, the instructions, the program and the challenges. The theory is in Full Lesson.
EV3 Robotics›Level 1 · Beginner›Lesson 30
Level 1 · Lesson 30 · EV3-L01-3060 minutes · Ages 7+ · Model: Ball Collector
The Ball Collector is a driving base. It has a row of hanging fingers across the front. Drive at a ball, and it pushes past the fingers into the cage. The fingers swing back, so the ball cannot get out again.
You have driven robots to places before. This one has no place to go. Its job is to visit everywhere.
That is a new kind of problem. Getting to a spot is easy to check. Did you get there? Covering a whole area is harder to check. The part you missed is the part you never looked at.
The little round robot that cleans the floor. It does not know where the dirt is. So it does not try to find the dirt. It tries to go everywhere. It picks the dirt up on the way.

Watch one for a minute. It is not just wandering about. It follows a pattern. A long straight run, a turn, then another straight run next to the first. Back and forth, like mowing a lawn, or reading a page.
The pattern matters because of overlap. Each run covers a strip as wide as the machine. Put the runs too far apart, and you miss strips between them. Put them too close, and you waste time. You go over the same floor again.
A robot with no pattern just drives about and bumps into things. In the end it covers most of a room. But it takes much longer. And it can never say it has finished.
Here is the part that catches people out. A robot that missed a strip looks just like a robot that did the job. It is moving and busy, and it brings back some balls. You only find out by checking the floor.
Looking busy is not the same as covering everything. Judge a collector by what it left behind.
To cover an area, you need a shape that repeats. It is a straight run, a turn, and a straight run back. The rest is choosing the numbers.
You already know every block you need. A straight run is a move forward. A turn on the spot is the two-speed block from the Tricycle in Lesson 29. You give it opposite numbers. And repeat does the pattern as many times as you need.
| Choice | What it costs you if you get it wrong |
|---|---|
| Passes spaced too far apart | Missed strips. The robot looks like it worked, but it did not. |
| Passes spaced too close | Time wasted going over the same floor. Nothing is missed, but a real machine runs out of battery. |
| Turn slightly wrong | The whole pattern tilts. Every run after that is wrong too. It is the drift you measured on the Road Roller in Lesson 28. Now it matters. |
Put your runs a little closer together than the width of your robot. A bit of overlap costs little. A missed strip means the job failed.
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.
Machines repeat. A wiper sweeps, a conveyor runs, a ride goes round — and none of that should mean copying the same blocks over and over. A loop says “do this again” once.
| Block | What it does |
|---|---|
repeat (10) end | Runs the blocks inside a set number of times, then carries on below. |
forever end | Runs the blocks inside over and over, and never carries on below. |
repeat until <> end | Repeats until a condition becomes true — a loop with a sensor as its exit. |
Anything placed after a forever loop will never run. Not “runs late” — never. Both programs below end with the same block: set the status light green.
repeat (3)
forever
↑ this block never runs
Both programs contain the same green-light block. Let it run as long as you like — the right-hand ring will never turn green.
The repeat loop counts its three passes, stops, and moves on to the block underneath, so its light turns green. The forever loop reaches the bottom of its own blocks and jumps straight back to the top, so the block underneath is never reached — however long you leave it. If a program seems to stop half way through, look for a forever loop above the blocks that are not happening.
A program is a list, and the Brick works down it once. Every block runs, in order, and when the last one is done the program is over. That is fine for a list of instructions — drive, turn, beep, stop — because each is a thing you do once.
A sensor is not a thing you do once. Asking is 1 pressed? gives you an answer about this instant, and an instant later it may be wrong. Checking a sensor once tells you what the world was like at the moment the program started — which is almost never what you wanted to know.
So a program that has to react must ask again, and again, for as long as it is running. That is the whole job of the loop: not to repeat an action, but to keep the question being asked.
Wrap a sensor check and the motor it controls in a forever loop and you have built a closed-loop control system — the pattern behind every line follower, thermostat and cruise control:
It is called closed because the output feeds back round to the input: the motors move the robot, moving the robot changes what the sensor sees, and what the sensor sees changes the motors. Break the circle at any point and the robot stops responding.
when program starts :: events hat
forever
if <[1 v] is pressed? :: sensors> then
[A v] start motor [clockwise v] :: motors
else
[A v] stop motor :: motors
end
endRead it as a sentence and it is almost too simple to need explaining: for ever, if the button is pressed run the motor, otherwise stop it. The motor now follows the button for as long as the program is running.
This is the mistake nearly everybody makes first, and it is a hard one to spot because nothing about it looks wrong:
when program starts :: events hat if <[1 v] is pressed? :: sensors> then [A v] start motor [clockwise v] :: motors else [A v] stop motor :: motors end
The logic is perfect. The ports are right. Nothing is misspelled. And the robot will ignore the button completely — because the Brick reaches that if/else a few milliseconds after you press Run, finds the button not pressed, takes the else branch, stops the motor, runs out of blocks and ends. By the time a finger arrives, there is no program left to notice it.
with forever — a closed loop
without it — the common mistake
↑ running — for the only time
Both programs contain exactly the same if/else. The only difference is the forever block around one of them.
Both programs contain exactly the same if/else. The counter is what gives it away: one keeps checking for as long as it runs, the other is stuck on the single check it made before anybody touched anything. A student who has seen this once stops writing it.
The tell on a real robot is a program that ends the instant you start it — the Brick returns to its menu almost immediately. If a sensor program finishes rather than waits, the loop is what is missing.
Say this back before moving on: “Cover an area with runs side by side. Put them a bit closer together than the robot is wide.”
| Part | What it is doing here |
|---|---|
| EV3 Intelligent Brick | Runs the program. It sits over the wheels that the motors turn. |
| Large Motor ×2 | Ports B and C. Straight runs and turns, just like the Tricycle. |
| The finger gate (no cable) | A row of loose fingers on an axle. They swing inwards to let a ball in. They will not swing outwards to let it go. |
Those two numbers are your most important tools today. To plan a pattern, you must know how wide your robot is. You must also know how far it goes in one rotation.
Sensors go in ports 1, 2, 3, 4. Motors go in ports A, B, C, D. You cannot swap them. If you do, nothing warns you. The robot just will not work.
| Part | Port | Why this one |
|---|---|---|
| Left drive motor | B | B is left. It is the first number in the two-speed block. Today that matters, because every turn in your pattern needs it. |
| Right drive motor | C | Right is C. It is the second number. |
| Sensors | none | The collector cannot see balls or walls. You plan everything it does. |
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. This robot crosses its own path again and again. It will drive over a USB cable and drag it. In the end, the cable will wrap round a wheel.
Make one change at a time. After every run, put the balls back where your drawing shows. Then each pattern gets the same test.
Remember step 5. Nothing broke, nothing got stuck, and no block was wrong. But half the floor is still covered in balls. You can only find this kind of bug by checking the result. Watching the robot is not enough.
Judge a collector by what is left on the floor. Not by how busy it looked.

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.
One page at a time — use Next and Previous, or the ← → keys. 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.
Six blocks. A straight run, then a spin, four times. It drives a square, not a back-and-forth pattern. That is on purpose. It is the simplest pattern that goes somewhere. In the next section, you make it better.
when program starts :: events hat set movement motors to [B v] and [C v] :: movement set movement speed to (40) % :: movement repeat (4) move [forward v] for (4) [rotations v] :: movement move for (1) [rotations v] at (40) (-40) % speed :: movement end
Read it in the order the Brick runs it:
What success looks like: the robot drives a rough square. It collects any ball that was on one of the four sides. Count what it got. Even more important, count what it missed, and where. The middle of your square has almost certainly been missed.
The 1 rotation in the spin is just a guess. It will not be exactly a quarter turn on your robot. Change it until the square joins up. Fix that first.
This model drives, so its challenges are run on a mat. Mats differ between branches — check you are looking at the one in your room.

WRO 2019 RoboMission Elementary — Smart Passenger Transport · official WRO game mat, 2362 × 1143 mm
The challenges name these places rather than distances, so the same challenge works on any mat:
Written for the WRO 2019 RoboMission Elementary mat. Each one is a single program run that starts in the ✕ box.
Follow the black line from the start box to Home. Stop fully inside Home.

In one program run, follow the black line to Home, then on to School.

In one run, go to Home, then School, then the Zoo. Stay on the black line all the way.

In one run, go to Home, School and the Zoo, then the Shopping Center. Stay on the black line all the way.

In one run, charge at the Battery Area first. Then go to the Shopping Center, the Cinema, and finish at Home. Stay on the black line all the way.

Work through them in order — each is harder than the last. The extra challenge comes after all three, and it is meant to make you plan before you build.
Collect every ball in a marked area on the mat. Scatter at least eight balls. Write down where they are. Then run a pattern that picks up all of them. If a ball is left behind, your pattern has a gap. Find the gap and say where it was.
Prove your spacing matters. Spacing is the gap between one pass and the next. Run the same area three times. First, space the passes one robot-width apart. Next, three-quarters of a width. Then one and a half widths. Count the balls you get each time. Tell us all three counts. Then say why the widest spacing failed.
Make it fast as well as complete. Time your runs. Find the pattern that gets every ball in the shortest time. Then tell us the trade you made. Tight spacing never misses. But it always takes longer.
Clear an area you have not seen yet. Your teacher will mark an area on the mat. They will scatter the balls and not tell you where. Your collector must sweep the area. It must bring back as many balls as it can. It starts from a station you choose. Plan on paper before you drive. You will not know where the balls are. So you cannot plan around them. Plan to cover the whole space instead. Then work out how you will prove that you covered all of it. Two questions when you show it. How do you know your robot went to every part of the area? Not just most of it? And if it missed a ball, was that a driving problem or a pattern problem?