Sensor
Can you walk across a room with your eyes closed? Why does it get harder? What kind of problem is this for a robot?
The Perseverance rover on Mars is 225 million kilometers from Earth. Sending a command takes 20 minutes. So if you say “stop!”, the rover hears it 20 minutes later.
The rover has to make decisions by itself! It measures the rock in front of it, the slope and the amount of light with sensors, and works out in its own brain: “should I go or should I stop?”
A sensor is a device that lets a robot collect information from its surroundings. Just like your eyes collect light, your ears sound and your hands touch — a robot’s sensors turn things like distance, light, temperature and sound into numbers. Without this data, a robot is like it’s blind and deaf.
1️⃣ The ultrasonic sensor sends out a sound wave → the wave hits the wall in front → it bounces back. 2️⃣ The sensor measures the round-trip time: 0.006 seconds. 3️⃣ Speed of sound (340 m/s) × time ÷ 2 = distance: 1.02 meters. 4️⃣ The robot now knows “there’s a wall 1 meter in front of me”. 5️⃣ In code: if (distance < 30cm) → stop().
Think of a car with parking sensors — it goes “beep beep” when reversing. That sound is really the ultrasonic sensor measuring the distance to the wall. The faster the beeps, the closer the car is to the wall!
Put your hand in front of your eyes and try to walk around the room — can you find your way with only footsteps and touch? Now lower your hand. That difference shows how valuable a sensor’s information is to a robot!
Research: what’s the difference between ultrasonic, infrared and laser (LIDAR) sensors? Which is more precise, which is cheaper? Why do different self-driving car companies choose different sensors?
How does an ultrasonic sensor measure distance?