MyLeoNes™

Robots: sensing and acting — Computing, 7–10

A robot uses sensors to notice something and actuators to do something. This helps you understand how code can connect the digital world to the physical one.

Notice, decide, act

A robot is not simply a machine that moves. It can use a sensor to notice light, sound, distance or touch, let its program choose a response, and use a motor or light to act. The sensor is like an input and the motor is like an output, but both are connected to the physical world.

Why robots need sensors

A machine that only follows a fixed route gets stuck when a chair moves or a wall appears. People solve this by checking what is around them before choosing what to do. Robot makers gave machines sensors for the same reason: without fresh information, a robot cannot adapt to a changing room.

A robot avoids a wall

Imagine a small robot with a distance sensor. First, it measures 18 centimetres to the wall. Second, its program compares 18 with the safety limit of 10, so it keeps moving. Third, the reading becomes 7 centimetres. The program now stops the motor, turns right, and starts measuring again.

A sensor is not a brain

It is tempting to say that a robot knows there is a wall because its sensor sees it. Usually the sensor only produces a number, such as 7 centimetres; the program gives that number meaning and chooses an action. Mixing up sensing with deciding is reasonable because both happen so quickly that they look like one thought.

Robots around you

This pattern appears in automatic doors, vacuum cleaners and greenhouse systems. A door sensor notices someone nearby and a motor opens the door; a vacuum notices an edge and changes direction. These machines are not thinking like people. They are repeatedly measuring something, applying a rule, and making a physical change.

Keep exploring

Other languages

Loading MyLeoNes™…