Challenge 1
Make the ride beep twice when the car lands, not once. Add a different, lower beep just before it lifts. A person across the room should know lifting from landing with their eyes shut. One more block and one changed number is enough.
Quick Learn — the model, the instructions, the program and the challenges. The theory is in Full Lesson.
EV3 Robotics›Level 1 · Beginner›Lesson 40
Level 1 · Lesson 40 · EV3-L01-4060 minutes · Ages 7+ · Model: Drop Tower
The Drop Tower: a tall tower with a motor lift. The lift pulls a car to the top. Then it lets it fall. An eye at the bottom watches for it to land.
The Driving Base in Lesson 1 only did things. This machine also notices things. Once it is running, you can leave it alone. It keeps going by itself. It lifts and drops. It waits for the landing. Then it lifts again. Nobody has to press a thing.
The clever part is not the tower. The machine looks to see when to lift next. It does not count seconds.
A drop tower is a tall ride. It pulls a car of riders to the top. It holds them there. Then it lets them fall. You can ride one at many big theme parks.

Pulling the car up stores potential energy. Let it go, and gravity turns that into kinetic energy. That is the energy of moving. The riders feel it! Brakes near the ground slow the car down safely.
Here is the part that matters today. The ride does not just wait a set time. It waits until the car is really down. A sensor at the bottom checks, every single time.
What if the ride used a timer instead? It would work for a while. But one day the car is slow. Maybe it is windy or cold. Maybe the riders are heavy. Then the next lift starts too soon. The car is still coming down! A timer guesses. A sensor checks. That is the whole lesson.
Lesson 1’s robot was blind. It did just what it was told. It would have driven into a wall! Today the machine gets an eye: the Colour Sensor. Now it can choose for itself when to move on.
Two ideas. They only work together:
A sensor turns something in the world into a number. A loop makes the robot read that number again and again.
One without the other is not much use. A sensor read once is like a photo. It was true when you looked. It may be wrong a second later. A loop with nothing to look at just repeats, blind. Put them together. Now you have the pattern inside nearly every robot: sense, react, repeat.
The Colour Sensor looks down at a surface and can answer three quite different questions: what colour is this?, how bright is this? and how light is the room? Choosing the wrong one is the usual reason a line-following robot refuses to work.
| Block | What it does |
|---|---|
([3 v] color :: sensors) | Reports which colour it sees, from a short list — red, blue, green, black, white and a few more. |
([3 v] reflected light intensity :: sensors) | Reports how bright the surface is, as a number from 0 (black) to 100 (white). |
<[3 v] is color [red v]? :: sensors> | Reports true or false for one particular colour. |
([3 v] ambient light intensity :: sensors) | Reports how much light is falling on the sensor, 0 to 100, with its own lamp switched off. |
The sensor does not describe a colour — it picks one from a list of eight, and that list is the whole of what it can ever say:
| Reports | Means |
|---|---|
| 0 | no colour — too far away, or too dark to call |
| 1 · 2 · 3 | black, blue, green |
| 4 · 5 · 6 | yellow, red, white |
| 7 | brown |
Anything you put under it is forced into one of those eight. There is no orange and no purple: an orange brick comes back as red or as yellow, and often as red one moment and yellow the next as the robot creeps along. Light blue and grey are the other classic pair to avoid — grey is neither black nor white, so it flips between them.
This is why colour mode is a good fit for a task you control and a bad fit for one you do not. Sorting the LEGO bricks that come in the set works, because they are made in exactly these colours. Reading a printed sheet, a coloured tile from another set, or anything pastel is asking the sensor to answer a question it does not have a word for.
Two practical points follow from how it decides. It shines its own lamp and looks at how much red, green and blue comes back, so it must be close — about half a centimetre, and no more than a centimetre. Lift it and the answer decays to 0. And because it takes those three readings before it can answer, colour mode is the slowest thing this sensor does; a robot driving quickly can pass right over a small patch without ever reporting it.
When a colour must be recognised reliably, test it. Drive the robot slowly over the real surface with color shown on the screen and watch what it actually says — including what it says at the edges between two colours, which is where the wrong answers live.
Both questions are asked of the same surface at the same moment. Watch the two answers travel across a strip of colours and then over the edge of a black line.
Watch the two read-outs over the last third of the strip. One of them changes once. The other changes the whole way across.
Over the patches, both read-outs are useful. Over the edge of the line they part company: the colour name has only two answers to give and jumps between them, while the number slides smoothly from 88 down to 8. Every value in that slide tells you how far onto the line the sensor is — which is information the name simply does not carry.
A line follower built on colour names only knows “black” or “not black”, so it can only lurch. Built on reflected light it can tell how far onto the line it has drifted, which is what makes smooth following possible.
The first two modes both switch the sensor’s own lamp on and measure what bounces back off the surface. Ambient light intensity does the opposite: the lamp goes off, and the sensor simply reports how much light is arriving from wherever — 0 in the dark, up to 100 in bright light.
| Mode | Own lamp | Measures | Points |
|---|---|---|---|
| colour | on | which of eight colours the surface is | at the surface, very close |
| reflected light | on | how much of its own light comes back | at the surface, very close |
| ambient light | off | how bright the surroundings are | wherever you want to measure |
That makes it the only one of the three that is not really about the floor. A number between 0 and 100 means very little on its own, so watch the same sensor sit through five different rooms — nothing underneath it changes at any point.
the sensor’s own lamp is off — it is measuring the room
Nothing under the sensor changed at any point in this run. Ambient light is the one mode that is not asking about the surface at all.
Those are the shape of the scale rather than exact figures, but the shape is the useful part: a lit room is nowhere near 100, and the top of the range is reserved for a light pointed straight at the sensor. Cover it with your hand and the number drops to near zero — which is the easiest way to check the sensor is doing what you think.
Point it at the ceiling and it tells you whether the room lights are on; point it forwards and a torch will spike the reading, which is a way of signalling to a robot without touching it.
Do not reach for it as a substitute for reflected light. Room light falling on a black line and on white paper is almost the same, so ambient mode can barely tell them apart — the reason reflected light works is precisely that the sensor brings its own light and measures how much of it survives.
It is also the mode most at the mercy of the room. A reading taken by a window in the morning will not match the same spot in the afternoon, so anything built on ambient light needs measuring on the day, in the place, with the lights as they will be.
Even the two lamp-on modes are affected by room lighting — a reading taken by a sunny window differs from one taken in a corner. The sensor must also sit close to the surface and at a constant height, because lifting it changes the reading even though the surface has not changed.
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 out loud: “My robot reads a number, over and over. It acts when the number changes.”
Look at your model. Find the parts with cables. There are three. One of them is new to you.
The Medium Motor does the lifting. It is smaller and faster than the Large Motors in Lesson 1. It is good for an arm, a lift or a gate. Those jobs need speed and care more than strength.
The Colour Sensor is an input. A motor is an output. You tell it to do something. It does it. A sensor is an input, like the Touch Sensor you know. It tells the Brick something. Nothing you send it makes it move.
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.
This build needs both ends of the Brick: a letter for the motor, and a number for the sensor. A Colour Sensor in a letter port will not read at all.
| Part | Port | Why this one |
|---|---|---|
| Medium Motor (the lift) | A | One motor on its own most often goes in A. That leaves B and C free for two driving motors. |
| Colour Sensor (the landing) | 3 | The course rule for all four sensors: Touch 1, Gyro 2, Colour 3, Ultrasonic 4. Keep to it. Then any lesson’s program will run on your robot. |
Check your own cables 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.
Watch out for the same two traps. The Brick may have gone to sleep. Or you may connect to the next group’s robot. Does a tower across the room lift when you press play? That is the second trap!
This step really matters today. One of the three parts is a sensor you have not used before. A sensor in the wrong port looks fine. You only find out when the program will not work.
Does the number stay the same when your hand moves? Stop here. Nothing later in this lesson will work.
That number is your best tool for finding bugs all year. You can use it before you write any program.
Make one change at a time. Guess what will happen before each run.
That last one is the point of the whole lesson. A timer would need changing. The sensor did not. It was never counting time. It was watching for something to happen.
Does your ride stop after one round? Then the sensor never reaches your target number. Go back to the port tile. Read the number again with the car down. Pick a number between your two readings. Do not pick one end.
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.
The same build on Google Drive — sometimes a video, sometimes a scan:
Fullscreen it while you build — you can pause and scrub with the player's own controls.
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.

First, the sensor by itself. The Colour Sensor can work in different ways. Today's job needs reflected light intensity. It shines a light down. It measures how much bounces back. It gives a number from 0 (dark) to 100 (bright).
Read your own two numbers before you program anything. Look at the port tile. What number does the empty landing spot give? What does it give with the car on it? Write both down. Your target number goes in between. It is for your robot on this table. A lesson cannot tell you what it is.
when program starts :: events hat forever [A v] set speed to (30) % :: motors [A v] run [clockwise v] for (2) [rotations v] :: motors wait until <([3 v] reflected light intensity :: sensors) < (25)> play beep (60) for (0.3) seconds :: sound end
Go through it in the robot's order:
What success looks like: the car lifts, drops and beeps. Then it lifts again. It keeps going without you touching anything. Now put your hand under the sensor while the car is up. The machine should think the car has landed. It carries on.
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.
Make the ride beep twice when the car lands, not once. Add a different, lower beep just before it lifts. A person across the room should know lifting from landing with their eyes shut. One more block and one changed number is enough.
Hold the car at the top for two seconds before it drops. Keep the landing check just as it is. Then make the ride wait before it lifts again. The landing spot must be clear for a full second first. Then a hand left under the sensor will not start the next ride. Think hard about which waits go inside the loop and which do not.
Run the ride ten times, then stop by itself. Show the count on the Brick screen as it goes. Ten means ten full rides, not ten lifts. A ride that never lands must not be counted. You will need something other than a loop that runs forever. You will need to decide where the counting happens.
The safety checker will not pass a ride that mixes up two things. One is a car that landed. The other is a sensor that broke. Build a Drop Tower that spots its own faults. A fault is something that has gone wrong. Say the car has not landed a fair time after it was let go. Then the ride must stop. It must show a clear warning on the screen. It must sound an alarm that is plainly not the normal landing beep. It must not just wait forever. That is what your program from this lesson does now. You must also be able to show it working. Run the ride as normal. Then cause a fault on purpose. Show the machine catching it. Plan on paper first. Your program must wait for a thing to happen. It must also notice when it has not happened. A plain wait-until can only do the first. What should "a fair time" be for your build? Be ready to say, and how you chose it.