Topic Guide

Sensors

A sensor measures something in the physical world and gives the program a value to read.

Why this matters

A robot can measure distance, light, motion, temperature, touch, or sound. The readings vary, so students collect several before choosing the threshold that controls a response.

Beyond this topic

An automatic light receives a number from its sensor. The designer decides which readings count as dark enough, and the code compares every new reading with that threshold.

Math and logic

Measurement

A number or state reported by the sensor.

Threshold

The chosen value where the program changes its response.

Noise

Small fluctuations and errors in the readings.

Sampling

Taking new readings as the signal changes over time.

Small examples

1

Button

Report one of two states: pressed or released.

2

Distance

Estimate how far away an obstacle is.

3

Light level

Return a changing value as a space becomes brighter or darker.

4

Accelerometer

Report acceleration values that can indicate movement or orientation.

Program connections

Where this topic appears.

Active now

Robotics

Students write commands, wire simple circuits, read sensors, and trace physical cause and effect through the Sense–Decide–Act loop.

Coming later

AI & Smart Machines

A possible later program for testing patterns, predictions, prompts, mistakes, and the limits of AI tools.

Common mistakes

Expecting a fixed reading

Small fluctuations make the output flicker on and off.

Unhelpful threshold

The chosen boundary does not fit the room or task.

Skipping calibration

The program assumes every device and room gives the same values.

Giving the sensor too much credit

The component supplies a reading; the student's code decides what to do with it.

Put the idea to work

Read the Lesson
Robotics Guided Project

Button and Buzzer Alarm

Connect a button to a visible and audible alarm, then write clear rules for arming, triggering, and resetting it.

  • Input
  • Output
  • Events
  • Conditions
See how it works
Robotics Guided Project

micro:bit Reaction Timer

Build a reaction timer with a random delay, an early-press rule, and results in the correct units.

  • Input
  • Timing
  • Variables
  • Randomness
See how it works
Robotics Computer Lab Project

Robot Patrol Challenge

Design a repeating patrol that notices an obstacle, tries a response, and checks whether the response worked.

  • Loops
  • Sensors
  • Conditions
  • State
See how it works