Lesson / Robotics

What Question Is the Sensor Answering?

The display says 347. That might mean bright, close, tilted, or nothing useful at all. Find out what the sensor measures, collect readings, and decide where the program should change its response.

Lesson plan

  1. Name the measurement

    Identify what the input reports and the units or states it uses.

  2. Collect readings

    Record several values under different known conditions.

  3. Choose a boundary

    Compare readings and test a threshold or timing rule.

  4. Build the reaction timer

    Add waiting, a random start, button input, and an elapsed-time result.

  5. Explain the limits

    Demonstrate the reading, the program's decision, and one source of variation.

Learning goals

  • Name the quantity a sensor measures.
  • Record a changing value.
  • Choose and test a threshold.
  • Separate the measurement from the program's decision.
  • Explain variation in the readings.

Small examples

button = pressed

read one of two states

distance < 15

compare a reading with a threshold

light level

inspect a value that changes

read repeatedly

take several samples over time

Guided project

micro:bit Reaction Timer

Wait for an unpredictable signal, press as quickly as possible, and make the timer distrust suspiciously early presses.

Build This Project
Students build

A waiting state, Random start delay, Visible go signal, Button response.

Ideas in use

Input, Timing, Variables, Randomness, State.

Finish line

A working version with a tested change, one repaired problem, and a clear explanation.

Teacher checkpoints

  1. 1The student names the measured quantity.
  2. 2Several readings have been recorded.
  3. 3A threshold is stated and tested.
  4. 4The output changes for a traceable reason.
  5. 5The student identifies one limitation of the reading.

Common mistakes

  • Every reading is expected to be identical.
  • A threshold is chosen from one test.
  • The sensor is credited with making the decision.
  • The output changes before the input values are recorded.

Optional challenges

LEVEL 1

Builder

  • Display raw readings before deciding.
LEVEL 2

Inventor

  • Compare two candidate thresholds.
LEVEL 3

Boss Level

  • Smooth several readings before acting.

End-of-class demonstration

  1. What does the sensor measure?
  2. What values did you observe?
  3. Where is the threshold?
  4. What does the code decide?
  5. When could the reading be wrong?