← Introduction to Robotics: Build, Code, Create
Free lesson

Choosing the Right Sensor for the Job

Start With the Question, Not the Sensor

The single biggest mistake beginners make is picking a sensor because it looks cool, rather than because it answers the actual question the robot needs answered. A good engineer always starts with: "What exact information does my robot need right now?"

A Worked Example

Imagine you want to build a robot that stops before it drives off the edge of a table. Let's think through it:

Wrong first instinct: "I'll use an ultrasonic distance sensor pointed forward, since that's for detecting objects."

Why that's wrong here: an ultrasonic sensor pointed forward detects walls and objects IN FRONT of the robot — but a table edge isn't in front of the robot, it's a sudden DROP below it. A forward-facing distance sensor would never see it coming.

The right answer: point a distance sensor DOWNWARD, facing the table surface. As long as the table is there, the sensor reads a short, consistent distance. The instant the robot reaches the edge, that reading suddenly jumps to a much longer distance (or no reading at all) — the robot's code can detect that jump and stop or reverse immediately. This exact trick is how many real robot vacuums avoid falling down stairs!

A Simple Decision Checklist

Before choosing a sensor, ask:

  1. What question am I actually asking? ("Is something close?" is different from "How bright is it?" is different from "Was I touched?")
  2. Does this sensor answer THAT exact question, or does it just seem related?
  3. Where does the sensor need to point to actually see/hear/feel what matters?
  4. What could fool this sensor, and does that matter for my robot's job?

Try This

For each robot job below, decide which sensor type (light, distance, touch, or sound) fits best, and where it should point:

  • A robot that follows a black line drawn on the floor
  • A robot that turns on a fan when it gets too warm and stuffy (trick question — think about what sensor we've actually covered so far!)
  • A robot that stops the instant it bumps into furniture, even in total darkness

There's real value in noticing which job DOESN'T have a perfect sensor yet from what you've learned — that's exactly the kind of gap real engineers identify before searching for a new sensor to solve it.

Enjoying it?

Sign up free to carry on with the course, with an AI tutor to help you.

Continue the course