Computing · Stage 4

Sensors: Sense & Respond

Coding & Systems · sensors · a sensor senses something in the world and the program responds

✦ Computing📘 Stage 4 · S4⏱ ~11 min🧒 Ages 8–9★ Free to start
I can program something that senses and responds.
Kavi the owl for Computing
📖

Kavi Builds a Night Light

Kavi wanted a lamp that turns on all by itself when the room gets dark. "But how will it know it is dark?" Kavi hooted. So Kavi added a light sensor — a part that can sense how much light there is. Then Kavi wrote a tiny program: IF the sensor senses it is dark → turn the light ON · ELSE → turn the light OFF. When Kavi covered the sensor, the lamp glowed. When Kavi uncovered it, the lamp went dark again. "It senses, then it responds!" Kavi cheered. "A sensor is how a program notices the world — and my program decides what to do about it."

🎓

What your child will learn

1A sensor lets a program notice the worldA sensor is a part that senses something real — light, a touch, a sound, or heat. The program reads the sensor, then responds by doing an action. Tap each sensor to hear what it senses.
2Do the same thing always, or sense & respond?A program with no sensor does the very same thing every time — it cannot tell what is happening around it. A program that senses first can respond differently depending on what it finds. Sensing lets a program fit the real world.
3Sense, then respond — over and overA sense-and-respond program keeps checking the sensor and acts on what it finds. Press ▶ Run to watch Kavi's night-light program sense the light and respond.
4How many times does the light turn ON?Kavi's light sensor checks the room five times in a row. The rule is IF dark → turn ON · ELSE → turn OFF. Read the five checks and count only the dark ones, then reveal.
🔍

A peek inside

Kavi wants a fan that turns on by itself when the room gets hot. Which sensor should the program read?
hot or cold is sensed by a heat sensor

Try this at home: A part that senses something real, like light or touch, is called a ____.

Ready to play and learn?

Start the free interactive lesson, or print the handout for screen-free play.

Part of Computing · Stage 4 · S4 on KAVI Academy — a secular, whole-child learning platform for ages 5–12.