Lesson 12 · 60 minutes

When Sensors Lie

Noise, blind spots, and trusting the wrong number

Today's goal

Make each sensor give a confidently wrong answer, and explain to somebody else why it happened.

Ideas in this lesson

Sense → Think → Do

SENSE, interrogated. Every later lesson relies on sensors, so knowing their failure modes is knowing their limits.

How the session runs

  1. Sonar versus a soft jumper: hold cloth in front. The reading jumps or reads clear. Sound is absorbed, not reflected.
  2. Sonar versus an angled wall: turn a book to 45°. The echo bounces away and never comes home.
  3. Sonar versus a table edge: drive along a bench so the beam clears it. The robot is blind to something obviously there.
  4. Line sensors versus a dark floor: contrast, not colour, is what they see.
  5. Proximity versus sunlight: take it near a window. Infrared from the sun swamps the sensor.
  6. For each one, write the sentence: 'It reported X because it actually measures Y.'

Sample program

Creep forward only while the way ahead is clear. Run it toward a soft jumper and watch it drive straight into something it says is not there.

V 4
P 15
I 6
F 300
Z
I 5
W 200
Z
Q

Paste it into the Workshop's Robot language box, then press Text → blocks to see it as blocks — or just send it straight to the robot.

Try this

When it goes wrong

What you seeWhat it means
Readings jump around wildly near soft thingsWeak echoes arrive late or not at all. This is the sensor's honest limit, not a fault.
Everything reads 400 cmNo echoes at all. Check NOECHO in Read sensors — that means the sensor never answered, which is different from seeing nothing.
Notes for the grown-up

This lesson prevents a whole class of frustration later: when a maze run fails, the first question becomes 'did the sensor see it?' rather than 'is the code wrong?'. That is real debugging instinct.

← Getting Off the LineTwo Robots, One Room →