Ages 10+ · Coding · How computers work
Sensors and robots
Sense: read a sensor Decide: check the rule Act: move or light a lamp and around again A robot senses, decides with a rule, then acts. The big idea A robot senses, decides, then acts. Sensors are its eyes, ears and touch.
How it works Bo only followed steps, so he bumped into the table. Steps say what to do, and sensors show what is there.
A sensor measures the world: light, sound, touch or distance.
A robot does three things over and over: it senses, it decides with a rule, and it acts.
A robot follows its rule using what its sensors tell it, and nothing more.
1 if the table is close: 2 turn 3 else: 4 go forward Bo's rule for the table. The sensor • light • sound • touch • distance • heat It measures • how bright it is • how loud it is • a bump or a press • how far away it is • how warm it is Sensors and what they measure. Daylight • sunny • cloudy • dusk • dark • night Bo's lamp • off • off • on • on • on Bo's night-light as the day gets darker. Example 1: Bo and the table Bo's distance sensor sends out a tiny ping of sound, and it finds the table is close. Bo checks his rule: if the table is close, turn. His wheels turn him away, with no bump. Example 2: The distance ping The ping bounces back from the table. The longer it takes to come back, the farther away the table is. A quick ping back means the table is close. Example 3: The night-light Bo's rule says: if the room is dark, turn on the lamp. In bright sun and under a cloudy sky there is plenty of light, so the lamp stays off. At dusk the sensor reads low light, so the lamp comes on, and it stays on in the dark and at night. Example 4: The cloud at noon A big cloud drifts over at noon, and the room dims. Bo's sensor says dim, and his rule says lamp. The lamp comes on, and Bo was not silly: he followed his rule. Words to know sensor Measures the world, like light, sound, touch or distance. rule What a robot decides by. sense Read the world with a sensor. decide Check a rule. act Move a wheel or light a lamp. Watch out More steps do not help a robot notice the table. Only a sensor can show it. A robot knows only what its sensors tell it. A rule draws a line, like dusk for the lamp. At or past the line, the rule fires. Sense, decide, act repeats many times every second. Try it Which sensor measures how bright it is? A robot reads a distance sensor. Is that sensing, deciding or acting? Turning a wheel is sensing, deciding or acting? Bo's ping takes longer to come back. Is the table nearer or farther? True or false: a robot knows things its sensors cannot tell it. Answers: 1. A light sensor · 2. Sensing · 3. Acting · 4. Farther · 5. False
Try at home Look for sensors with a grown-up: an automatic light, a door that opens by itself, a thermostat, a phone that turns its screen. For each, say what it senses, what the rule might be, and what it does. Sense, decide, act.
For grown-ups Look for sensors at home together: an automatic light, a door that opens by itself, a thermostat, a phone that turns its screen. For each, ask what it senses, what the rule might be, and what it does.