Resources
ReferenceRobotics7 min read

Sensors, and what they actually measure

A plain reference to the sensors used in school robotics: what each one really reports, and the ways each one lies.

Updated February 12, 2026 · For learners, educators, parents

Every sensor answers a narrower question than people assume. Most robot misbehaviour comes from believing a sensor measures the thing you care about when it measures something adjacent to it.

Ultrasonic distance

Sends a pulse of sound and times the echo. It measures time-of-flight to the first surface that reflects sound back, which is not the same as the distance to the nearest object.

  • Lies about: soft surfaces (fabric absorbs the pulse), sharp angles (the echo bounces away), and very close objects (the echo returns before it is listening).
  • Watch for: a reading of zero or maximum, which usually means no echo rather than a real measurement.

Infrared distance and reflectance

Emits infrared light and measures how much comes back. Cheap, fast, and highly sensitive to surface colour and finish.

  • Lies about: dark surfaces (absorb IR and read as far away) and glossy ones (reflect away and do the same).
  • Watch for: readings that change when the room lights change (sunlight contains plenty of infrared).

Line sensors

An array of reflectance sensors reading the contrast between the line and the surface. They report brightness, not position. Position is something your code calculates.

  • Lies about: any surface whose contrast differs from where you calibrated.
  • Watch for: performance changing with sensor height. A few millimetres matters more than most learners expect.

Encoders

Count rotations of a motor shaft or wheel. They measure how far the wheel turned, which equals how far the robot travelled only when the wheel does not slip.

  • Lies about: distance on a slippery surface, and any collision (the wheel keeps turning while the robot does not move).
  • Watch for: drift accumulating over a long run. Small errors add up and never cancel.

Gyroscopes and accelerometers

A gyroscope measures rate of rotation; heading is obtained by adding those rates up over time. An accelerometer measures acceleration, including gravity.

  • Lies about: absolute heading over time (integrating a small error produces steady drift).
  • Watch for: vibration from the robot's own motors appearing as motion.

Colour sensors

Measure light in several wavelength bands, usually with their own illumination. What they report depends on the ambient light as much as on the object.

  • Lies about: colour under different lighting. A value calibrated in the lab may not survive a gymnasium.
  • Watch for: distance sensitivity (the same colour reads differently at 5mm and 20mm).