What Is a Sensor?
A Sensor Is a Translator
A sensor's job is to turn something happening in the physical world — light, distance, sound, touch, temperature — into an electrical signal a robot's brain can understand. Think of a sensor as a translator between the physical world and the world of electricity and numbers.
Your own body is full of sensors: your eyes sense light, your ears sense sound, your skin senses touch and temperature. A robot needs artificial versions of these to do the "sense" part of the sense-think-act loop.
Analog vs Digital Sensors
Sensors generally give one of two kinds of answers:
- Digital sensors give a simple yes/no, on/off answer. A button is a digital sensor: it's either pressed or not pressed. There's no "half-pressed" reading.
- Analog sensors give a range of values, like a dial. A light sensor doesn't just say "light" or "dark" — it can say "quite bright," "a little dim," or anything in between, usually as a number.
Understanding this distinction matters because it changes how you write code to respond to a sensor — a digital sensor needs a simple if-true/if-false check, while an analog sensor often needs a threshold ("if brightness is below 50, turn on the light").
Common Robot Sensors You'll Meet in This Course
- Light sensors (photoresistors) — detect how bright or dark it is
- Ultrasonic distance sensors — measure how far away an object is, using sound waves (just like how bats navigate!)
- Touch/push buttons — detect a physical press
- Sound sensors (microphones) — detect noise or claps
Why Sensor Choice Matters
Choosing the WRONG sensor for a job is one of the most common beginner mistakes. A robot that needs to know "is there a wall in front of me?" needs a distance sensor, not a light sensor — even though both are "sensors," they answer completely different questions. Part of thinking like an engineer is asking: "What exact question do I need this sensor to answer?"
Key Takeaway
A sensor doesn't make decisions — it just reports information. The decision-making happens later, in the "think" step. A sensor's only job is to give the robot accurate information about the world.
Sign up free to carry on with the course, with an AI tutor to help you.
Continue the course
