The Timber Saw Machine: a table saw with a spinning blade. One Large Motor drives it through gears. The gears make the blade spin much faster than the motor. It will cut right through paper!
So this model is a little bit dangerous. Not to you, but to anything you feed it. That changes the question this lesson must answer.
Until now, you started a machine by clicking a button on a screen. Today you will add a switch of your own. You can put it wherever you like. A stop button must never be at the dangerous end of a machine.
In the real world 5 min
Where you have seen it
A sawmill turns trees into planks. A log goes in one end on a moving cart. A blade as tall as a person cuts along it. Square planks of wood come out. Mills like this have cut wood for well over a hundred years.
Two circular blades cutting a log in a sawmill. Photo: James Skitt Matthews / City of Vancouver Archives (Public domain).
Why it is built that way
A saw blade does not cut by pushing hard. It has lots of small teeth that arrive very quickly. Each tooth takes off a tiny bit. So a saw blade needs speed most of all.
The motor is not fast enough on its own. So the machine gears up. A big gear turns a small gear, and the small one spins faster. You saw this swap with the Gear Shooter: you get speed, but lose strength. A saw wants exactly that swap.
What would go wrong without it
Now think about stopping a saw. What if the only switch is next to the blade? Then, when something goes wrong, a person must reach towards the danger to stop it. That is how people get hurt. So real machines have big red stop buttons, away from the blade. They are low enough to hit with a knee. Often one machine has several of them.
If you must reach into a machine to switch it off, it is badly made. The switch belongs near the person, not near the danger.
One part the instructions do not show 3 min
The building instructions make the saw without a sensor. You are going to add one. First, follow every page of the instructions. Finish the saw and get it turning. Then come back here. No page is missing, and you did not skip a step. The Touch Sensor is an extra part for this lesson. Fixing it on is part of the job.
Once the saw itself is built:
Find a Touch Sensor. It is the one with the red button on the front.
Fix it on the frame as far from the blade as you can reach. Point the red button outwards. Then you can press it without leaning over the machine.
Push two pins through the holes in the sensor and into any beam. That will hold it. It does not need to be neat, but it must be firm. If a switch wobbles when you press it, sometimes it will not work.
Leave the cable for now. The Ports part below says which port it goes in, and why.
The main concept: the Touch Sensor 6 min
The Touch Sensor is a button on a cable. That is really all it is! The cable is the whole point. It means the button does not have to be on the Brick.
released
pressed
The same sensor, twice. Out and in. Those two places are all it can tell the Brick.
It tells the Brick one thing, and it is never unsure. But one press of a button is really three different moments. EV3 lets you ask about each one.
Block
Waits for
[1 v] wait until [pressed v] :: sensors
The moment the button goes down. It stays true while you keep holding it.
[1 v] wait until [released v] :: sensors
The moment it comes back up.
[1 v] wait until [bumped v] :: sensors
Down and up: one whole click. This is what “press the button once” really means.
This might sound like fussing over words. It is not! The demo below shows why. A program asks is it pressed? One normal press gets hundreds of “yes” answers. A finger stays on a button much longer than a computer takes to check it.
when program starts
forever
if 1 is pressed? then
change count by 1
versus two hat blocks
1 when pressed
1 when bumped
0is pressed? in a loop0when pressed0when bumped
In a loop: 0 answers from one pressBumped: exactly one
Nobody is touching the sensor. All three programs are watching it.A finger presses the button. Watch the red button go in — a couple of millimetres is the sensor's entire movement.The finger is still down. The loop checking «is pressed?» has already run hundreds of times, and every one of them counted.The finger lifts. Only now does «bumped» count, because bumped means pressed AND released.One press. Three completely different answers.Finished. The same press, counted three ways.
released
The middle counter is the one that surprises people. Nothing is wrong with it — a loop really does check that fast, and every check really is a separate answer.
For “click once to make something happen”, use bumped. Pressed is true as soon as the button goes down, and it stays true. So the next block waiting for a press gets the same press, from the same finger.
▶The Touch Sensor, and gearing upHow the sensor works, and how the gears make this blade spin fast. Open either one if it is not clear yet.Show meHide
ComponentSensing5 min
The Touch Sensor
The Touch Sensor is the simplest input the EV3 has: a button that is either pressed or not. That sounds trivial, but it is how a robot knows it has hit a wall, reached the end of a track, or been told to start by a person.
released
pressed
The red button out, and the same sensor with it pushed in. These two states are the entire output of this sensor — there is nothing in between.
Blocks reference
Block
What it does
wait until <[1 v] is pressed? :: sensors>
Holds the program here until somebody presses the sensor.
<[1 v] is pressed? :: sensors>
Reports true or false. Drop it into a condition to make a decision rather than a wait.
[1 v] when [bumped v] :: events hat
Starts a whole stack of its own. The dropdown chooses the moment: pressed, released or bumped.
Three different events
A button is not only “pressed”. One press is three things: the moment it goes down, the time it stays down, and the moment it comes back up. Watch what a single press does to three programs at once.
when program starts
forever
if 1 is pressed? then
change count by 1
versus two hat blocks
1 when pressed
1 when bumped
0is pressed? in a loop0when pressed0when bumped
In a loop: 0 answers from one pressBumped: exactly one
Nobody is touching the sensor. All three programs are watching it.A finger presses the button. Watch the red button go in — a couple of millimetres is the sensor's entire movement.The finger is still down. The loop checking «is pressed?» has already run hundreds of times, and every one of them counted.The finger lifts. Only now does «bumped» count, because bumped means pressed AND released.One press. Three completely different answers.Finished. The same press, counted three ways.
released
The middle counter is the one that surprises people. Nothing is wrong with it — a loop really does check that fast, and every check really is a separate answer.
Nothing there is broken. A loop really does get round hundreds of times a second, and each time it asks is pressed? the honest answer is still yes — so if that loop plays a sound or counts something, it does it hundreds of times from one finger. The two hat blocks each fire once, and they fire at different moments: pressed the instant the button goes down, bumped only when it comes back up.
The three options, and what each is for:
Pressed — the button is down right now. Good for “hold to run”.
Released — it is up again. Good for acting when somebody lets go.
Bumped — pressed and released. This is what you want for “click to start”, because it will not fire repeatedly while a finger stays down.
The classic bumper
when program starts :: events hat
set movement motors to [B v] and [C v] :: movement
start moving [straight: 0] :: movement
wait until <[1 v] is pressed? :: sensors>
stop moving :: movement
The robot drives until something presses the sensor. Note that the movement is started unmeasured on purpose — the sensor decides when to stop, not a distance.
Why it matters
Touch sensors are everywhere in machines you cannot see into: a lift knows the doors are shut, a printer knows the lid is closed, a washing machine will not spin until it is latched. They are safety devices as much as inputs.
ComponentMechanics5 min
Gearing up and gearing down
Two meshed gears are a bargain. Whatever one of them gains in turns it loses in force, and whatever it loses in turns it gains in force. There is no arrangement of gears that gives you more of both, and no amount of building will find one.
The ratio is the teeth
Count the teeth on the gear you are turning (the driver) and the teeth on the one being turned (the follower). That is the whole calculation:
turns out = turns in × driver teeth ÷ follower teeth
An 8-tooth gear driving a 24 gives ⅓ of a turn out for every turn in — and three times the turning force. Turn the pair round and you get three turns out and a third of the force. Count the turns yourself below.
0.00turns in0.00turns out×3turning force
strongerslowerslow and strong — a lifting winch
Two gears, meshed. The one on the left is being turned; the one on the right is along for the ride.Watch the two counters. They are not climbing at the same rate.Whatever the follower loses in turns, it gains in force — and whatever it gains in turns, it loses in force. There is no setting that gives you both.Finished. Count the turns again with a different pair and the trade goes the other way.
stopped
The number of teeth is the whole story. 8 teeth driving 24 means 8 ÷ 24 of a turn out for every turn in — and the force changes by exactly the opposite amount.
Gearing down, gearing up
Arrangement
Turns
Force
What it is for
Gearing down — small driving large
fewer
more
winches, lifts, robot arms, anything that has to move a weight
Gearing up — large driving small
more
less
fans, spinners, launchers, wheels on a light fast robot
1 : 1 — same size
same
same
moving the drive to a different axle, or fixing a direction
The names are worth getting right because they are backwards from what people expect: gearing down makes the output slower, not smaller, and it is the setting that makes a weak motor able to lift things.
Gear trains
Put several pairs in a row and the ratios multiply. Two 1:3 reductions in series give 1:9 — which is how a Medium Motor ends up able to raise something it could never shift directly. This is also how a gearbox with a sensible number of parts reaches a ratio that a single pair never could: a 40-tooth gear driven by an 8 is 1:5, and doing it twice is 1:25.
Only the first and last gear affect the ratio. Anything in the middle passes the motion along and changes nothing but the direction — which is a whole idea of its own, in Changing the direction of a turn.
What it costs
Every mesh loses a little to friction, so a long train is less efficient than a short one. Gearing down far enough to lift a heavy load also makes the mechanism slow, and slow is not always acceptable. And a gear train that is geared down hard is very hard to turn backwards by hand, which is either a useful brake or a nuisance depending on what you are building.
Why it matters
A bicycle is the same idea with a chain instead of teeth in mesh: the low gear that gets you up a hill is turning the back wheel slowly and pushing hard, and the high gear you use going downhill does the opposite. Cars, drills, cranes and clocks are all making the same trade.
Say this back before moving on: “Bumped means the button went down and came back up again.”
What’s in this build 4 min
Three electronic parts today. For the first time, one of them is a sensor.
Part
What it is doing here
EV3 Intelligent Brick
Runs the program, and is the base of the machine.
Large Motor
Turns the gears. It is strong, not fast. The gears turn its strength into speed for the blade.
Touch Sensor
The start and stop switch. You added it yourself. It is not in the instructions.
Count the gearing yourself
The blade spins faster than the motor. You can work out how much faster, with maths you already know.
Find the gear on the motor and the gear on the blade. Count the teeth on each. Mark your first tooth with a fingernail, so you know where you started.
Turn the motor gear one whole turn by hand. Count how many turns the blade makes.
When a big gear turns a small gear, the small one spins more times. Does your blade turn twice for each motor turn? Three times?
Your number shows how much strength you swapped for speed. The blade spins that many times faster. But it pushes that many times less hard.
Ports — and the rule 4 min
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.
Today, this rule matters for the first time. Every model so far had only motors, so you could not get it wrong. Now you have a motor and a sensor.
Part
Port
Why this one
Large Motor (drives the blade)
A
A single motor goes in A, as always.
Touch Sensor (start/stop)
1
In this course, the first Touch Sensor goes in port 1. Then the same sensor is always on the same port. So one group’s program will work on another group’s robot.
Check your own build now:
Motor cable in A. A letter.
Touch Sensor cable in 1. A number.
Press the red button with your finger. It should click and spring back. If it feels soft and squishy, it is pressing against something. Move it.
Stand where you would stand to use the machine. Can you reach the button without a hand near the blade? If not, move the sensor. That is why it is on a cable.
Connect the Brick 4 min
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.
▶How to connect the BrickUSB and Bluetooth, step by step, with a photograph of every screen. Open it if you have not done this before — or if pairing is not working.Show meHide
USB — the reliable one
Switch the Brick on with the dark grey centre button.
Cable into the Brick’s PC port — the small square socket beside the numbered ports, not one of the numbered ones.
Other end into the computer.
Bluetooth — name it first
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.
Name your Brick. On the Brick: Settings (the spanner) → Brick Name. Type something nobody else will pick, then press the tick. Every Brick is called EV3 until somebody changes it.
Turn Bluetooth on. Settings → Bluetooth. Tick Bluetooth and Visibility. Leave iPhone/iPad/iPod unticked.
Connect from EV3 Classroom. Click the Brick icon at the top of the programming area, find your Brick by name, and click Connect.
Say yes on the Brick. It asks “Connect?” with the computer’s name — choose the tick, then accept the passkey, which is already 1234.
Where to read it. The name sits in the bar across the very top of the screen, on every screen — so you can check which Brick you are holding at any moment without going into a menu. This one is EV3VE. A Brick nobody has renamed says EV3.Step 3, and the reason step 1 exists. Three Bricks in range — read the name before you click Connect. Pairing with the wrong one is not an error: it works perfectly, on somebody else’s robot.
Step 2.Bluetooth switches the radio on; Visibility is what lets the computer find you. With Visibility off your Brick works perfectly and simply never appears in the list.Step 4. Look at the Brick. It asks whether to accept and names the computer. Choose the tick.Then the passkey, already 1234. Press the tick again and you are connected.
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.
Keep it connected to the computer until it works. With a spinning blade, you want two ways to stop it: the computer and the button. Keep both until you trust your program.
Confirm the connection 2 min
This is the first time the port tiles have something interesting to show. Read them carefully.
Check the Brick icon. Is it connected?
Port A should show a Large Motor.
Port 1 should show a Touch Sensor. If port 1 is empty, the cable is in a letter port. The software cannot see a sensor in a letter port.
Now press and hold the red button. Watch the port 1 tile. It changes while you hold the button, and changes back when you let go. You just saw the sensor work, before any block ran!
If the tile does not change when you press the button, stop here. No program will work. The problem is the cable, not your code.
Change it and test 8 min
Make one change at a time. Guess what will happen before each run. Keep your hands away from the blade every time.
Set the speed to 30 %. Try to cut a strip of paper. Guess first: will a slow blade cut it, tear it, or just push it along?
Go back to 85 %. This time, cut a folded strip with two layers. Does the blade slow down as it cuts? That is because you swapped strength for speed.
Swap stop motor for a set speed to (30) % and then stop motor. Guess: will the blade stop more gently? Then watch how long it keeps spinning after the stop. A heavy blade does not stop when the motor does.
Change the direction to counterclockwise. Try the paper again. Does it still cut? Or does it push the paper away now?
This one matters most. While the saw is running, hold the button down for five whole seconds. Do not just click. Does it stop when you press, or when you let go? Now you know what bumped means.
Remember step 3 after this lesson too. The program said stop, but the machine did not stop. The blade is heavy and spins fast. It takes time to slow down. Real machines are the same. So never reach in just after you switch one off.
This is what you are building: the Timber Saw Machine.
Build it 15 min
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.
Make it move 10 min
Six blocks. Wait for a click, run the saw, wait for another click, stop. Clear the table round the blade before you run it.
when program starts :: events hat
[A v] set speed to (85) % :: motors
[1 v] wait until [bumped v] :: sensors
[A v] start motor [clockwise v] :: motors
[1 v] wait until [bumped v] :: sensors
[A v] stop motor :: motors
One click starts the saw, and the next click stops it. The blade keeps spinning in between, because nothing tells it to stop.
Go through it in the order the Brick runs it:
set speed to 85 %: nothing moves yet. A saw needs speed, and the gears add even more.
wait until bumped: the program stops here. It will wait as long as you like. Nothing happens until a finger presses and lets go.
start motor clockwise: the blade starts spinning. See that this is start motor, not run for. It has no end built in. So the motor keeps going while the program moves on.
wait until bumped: wait for a second click. The saw keeps running.
stop motor: and it stops.
What success looks like: the machine is quiet until you click. Then the blade spins, and keeps spinning for as long as you leave it. Click again, and it stops. Feed it a strip of paper while it runs. It should cut straight through.
Why bumped and not pressed? Try it! Change both blocks to pressed, and run it. One press starts the saw and stops it at once. Your finger is still down when the program gets to the second block. So the second wait is already done. Change them back.
Challenges 27 min
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.
Challenge 1
Make the machine say what it is doing. The screen must read STOPPED while the blade is still. It must read RUNNING while the blade spins. It must change at the same moment the blade does. Someone standing back should see if it is safe to come close. The screen alone must tell them.
Challenge 2
Build a hold-to-run switch. The saw must spin only while the button is held down. It must stop the moment you let go. This is a real safety design. Some machines must always stop when you let go. You will need a different choice in the dropdown from the one the lesson used. Say which one and why.
Challenge 3
Make it hard to start by mistake. Your saw must not spin up unless the button is clicked twice on purpose. Then a bag that knocks the switch cannot start it. Then say in one sentence what one knock by mistake does to your machine now. What did it do before?
Extra challenge
Design the whole safety system, not just the switch.
Your saw must work from start to finish without a hand ever near the blade. It must show what it is doing. It must warn before it spins up. It must run until someone stops it on purpose. It must be possible to stop it at any moment. That counts while it is running. It also counts just after it has started.
Plan on paper before you build. Plan where the sensor goes as carefully as the program. Where does the person stand? Can they reach the switch from there? Is there any time when the screen says something untrue about the machine?
You will be asked two questions when you show it. Show us a moment when your machine could be stopped. Show us one when it could not. If there is no such moment, prove it. And both a switch on a cable and the buttons on the Brick work. So why is the switch on a cable safer?