TactivergeLite

Lite / Discovering How the World Works / Week 24

Sensors aren't perfect

Hold a thermometer still in a still room. Why might it read 20.1, 19.8, 20.3, 19.9?

About 25 min · 3 goals · Reviewed by the founders' mentors · Full interactive version

Why should I care?

Beginners trust every reading; engineers know better. Real sensors jitter, drift and occasionally glitch. Good intelligent systems are designed to cope: they average, double-check and leave safety margins. That habit separates machines that work in a demo from machines that work every day.

Predict

A distance sensor reads 31, 29, 30, 52, 30 cm while the robot stands still. What's the best guess for the real distance?

  1. 52 cm, the latest big change
  2. About 30 cm: 52 looks like a glitch
  3. Average all five: 34.4 cm
Guess first, then reveal

About 30 cm. Four readings agree closely and one is far off: probably a glitch (perhaps the sound bounced off something else). A plain average gets pulled towards the glitch, so engineers often throw out readings that disagree wildly first.

Discover

Watch how individual noisy readings scatter around the true value. Compare trusting one reading with the lab's combined estimate. Which stays closer to the truth?

What the interactive shows (text version)

The fusion lab can be replaced by this description: a robot's true position moves steadily along a line. Each sensor reading lands a little above or below the truth at random. A single reading can be quite far off; combining many readings, or two different sensors, gives an estimate that stays much closer to the true line.

You can also open the interactive on the full site when you have a faster connection.

Understand

Noise

Noise is the small, random wobble in every reading. It comes from electrical jitter, vibration, air currents and more. It can't be removed completely, only reduced.

Averaging calms noise

If the wobble is random, some readings are a bit high and some a bit low. Averaging several cancels much of it out. The cost: you have to wait for more readings, so the machine reacts a little more slowly.

Glitches and margins

Sometimes a reading is wildly wrong: a glitch. Throw out readings that disagree hugely with the rest. And never set a safety threshold right at the danger point: leave a margin for noise.

How often to look

A robot only knows about the world at the moments it checks. Between checks it is driving blind. Distance between checks = speed × time between checks. Faster robots need to check more often.

Explain it another way

Intuitive

Guessing how many sweets are in a jar: one person's guess can be way off, but the average of the whole class's guesses is usually surprisingly close.

Technical

A reading = true value + noise. Averaging N readings with independent random noise reduces the typical error, though with diminishing returns. Outliers are removed first because one large error can drag the mean.

Mathematical

Readings 20.1, 19.8, 20.3, 19.9 have mean (20.1 + 19.8 + 20.3 + 19.9) ÷ 4 = 80.1 ÷ 4 ≈ 20.0 °C. Between checks: a robot at 40 cm/s checking 10 times a second travels 40 × 0.1 = 4 cm blind.

Applied

Planetary rovers count wheel turns to estimate distance, but wheels slip in sand, so the estimate drifts. They correct it now and then by photographing landmarks. Combining sensors like this is called sensor fusion.

Worked example 1

Readings: 48, 51, 50, 49, 12 cm. Estimate the distance.

12 is far from the others: likely a glitch, so drop it. Average the rest: (48 + 51 + 50 + 49) ÷ 4 = 198 ÷ 4 = 49.5 cm. Averaging all five would give 42 cm, badly dragged by the glitch.

Common mix-ups

Practice

Practice, not a test. Answers are checked on our server; a wrong answer gets a hint and another try. Nothing is saved.

°C

cm

Practice 3. A robot must never get closer than 10 cm to a wall. Its sensor can be off by up to 2 cm. Which stop rule is safest?
Practice 4. Averaging 20 readings instead of 2 makes the estimate steadier. What's the cost?

Apply it

A rover's distance sensor gives readings every 0.5 s and the rover drives at 10 cm/s. How far does it drive blind between readings? Suggest a stop rule with a margin that keeps it at least 20 cm from rocks.

Reflect

When would you rather react quickly to one reading, and when would you rather wait and average?

Write your answer on paper or in your own notes. Lite never stores what you write.

← Sensors: how machines feel the worldActuators: how machines change the world →