Skip to content
Tactiverge

How sensors measure

What happens inside a sensor, and the vocabulary engineers use to judge one: range, resolution, accuracy, precision, noise and bandwidth.

Lesson 1 of 6 · 30 min · Self-paced · Free

A robot only knows what its sensors tell it

A robot arm that picks up a cup never "sees" the cup the way you do. It receives numbers: a voltage from a joint sensor, a count from a wheel, an array of brightness values from a camera. Everything the robot believes about the world and about itself is built from those numbers. If they are wrong, late or noisy, the robot's decisions will be wrong, late or jittery, no matter how clever its software is.

So before choosing a sensor, an engineer asks a set of standard questions. How does it work? What can it measure, and how finely? How close to the truth is it, and how consistent? How quickly does it respond? This lesson gives you that vocabulary. The rest of the module applies it to real sensor types.

Transduction: turning the world into a signal

A sensor is a transducer: a device that converts one kind of physical quantity into another, usually an electrical signal a computer can read. Some examples:

  • A thermistor is a resistor whose resistance changes with temperature.
  • A photodiode produces a small current when light falls on it.
  • A potentiometer turns a rotation into a voltage, by sliding a contact along a resistive track.
  • A strain gauge is a thin metal pattern whose resistance changes very slightly when it is stretched.

In each case there is a chain: physical quantity → physical effect → electrical signal → number. Often the raw signal is tiny, so it is amplified, and then an analog-to-digital converter (ADC) turns the voltage into a whole number of "counts". Every link in that chain can add error, which is why a sensor's datasheet lists so many characteristics.

Range and resolution

Range is the span of values the sensor can measure. A distance sensor might work from 2 cm to 200 cm. Outside its range, it may report nonsense, report its maximum, or report nothing at all. A robot must know which, because "nothing detected" and "something very close" can look alarmingly similar.

Resolution is the smallest change the sensor can report. A kitchen scale that displays whole grams has a resolution of 1 g. A sensor read by a 10-bit ADC has 2¹⁰ = 1024 possible counts; if those counts span 0–200 cm, each count is about 200 / 1024 ≈ 0.2 cm.

Resolution is not the same as accuracy. That kitchen scale shows whole grams, but it might be 5 g off. A display with many digits can give a false sense of confidence.

Accuracy and precision

These two words are often used interchangeably in everyday speech. In engineering they mean different things.

  • Accuracy is how close the measurements are to the true value, on average. A consistent offset from the truth is called bias or systematic error.
  • Precision is how close repeated measurements are to each other. Poor precision shows up as scatter.

Picture throwing darts. Tightly grouped darts far from the bullseye are precise but inaccurate. Darts scattered evenly around the bullseye are accurate on average but imprecise. You want both.

The difference matters because the fixes differ. Bias can often be removed by calibration: measure something whose true value you know, and subtract the offset. Scatter cannot be calibrated away; it can only be reduced by averaging or filtering, which costs time.

Worked example

A distance sensor points at a wall that a tape measure says is exactly 50.0 cm away. Here are eight readings (made-up data for illustration), analysed in Python using only the standard library:

import statistics

true_distance = 50.0   # cm, measured carefully with a tape measure
readings = [51.2, 50.8, 51.5, 51.1, 50.9, 51.3, 51.0, 51.4]  # made-up data

mean = statistics.mean(readings)
spread = statistics.stdev(readings)
print(f"mean reading:        {mean:.2f} cm")
print(f"bias (accuracy):     {mean - true_distance:+.2f} cm")
print(f"std dev (precision): {spread:.2f} cm")
mean reading:        51.15 cm
bias (accuracy):     +1.15 cm
std dev (precision): 0.24 cm

This sensor is fairly precise (readings vary by about a quarter of a centimetre) but reads about 1.15 cm too long. Subtracting 1.15 cm from every reading would fix most of the bias. Notice that we needed an independent, trusted measurement (the tape) to discover the bias at all. Without a reference, a biased sensor looks perfectly healthy.

Noise

Noise is the random, unpredictable part of a measurement: the scatter in the example above. It comes from many sources: electrical interference from nearby motors, the random motion of electrons in resistors, vibration, flickering lights, and the rounding performed by the ADC itself.

A useful way to describe a sensor's noise is the signal-to-noise ratio: how large the quantity you care about is compared with the random variation. A 0.24 cm wobble is unimportant when measuring a 50 cm distance, but it would swamp a 0.1 cm change you were trying to detect.

The most common response to noise is averaging: if the noise is random, the average of many readings wanders less than any single reading. The price is lag. An average of the last ten readings describes where things were a moment ago, not where they are now. That trade-off between smoothness and delay appears throughout robotics.

Bandwidth and response time

A sensor does not respond instantly. A thermometer dipped in hot water takes several seconds to climb to the new temperature. Engineers describe this using response time, or more generally bandwidth: roughly, how fast a change the sensor can follow. A sensor with low bandwidth smooths out fast changes, whether you wanted it to or not.

Closely related is the sample rate: how many readings per second you take. Suppose a mobile robot drives at 1 m/s and its distance sensor updates 10 times per second. Between readings the robot travels 10 cm, blind. If it needs to stop within 5 cm of an obstacle, that sensor is too slow, however accurate each reading is.

Putting it together

Imagine choosing a sensor to detect when a gripper has closed on an object. You would ask:

  1. Transduction: what physical effect does it use, and can that effect occur in my situation? (An optical sensor cannot see through an opaque object.)
  2. Range: will the forces or distances I care about fall inside it?
  3. Resolution: can it detect the smallest change that matters?
  4. Accuracy and precision: is the bias calibratable, and is the scatter small enough?
  5. Noise: what else in the robot will disturb the signal?
  6. Bandwidth: can it respond before the gripper crushes the object?

No sensor is best at everything. Engineering is about choosing one whose weaknesses do not matter for the task, and designing around the ones that do.

Recap

A sensor transduces a physical quantity into a signal. Range is what it can measure; resolution is the finest step it reports; accuracy is closeness to the truth; precision is consistency; noise is the random part; bandwidth is how fast it can follow change. Calibration fixes bias, averaging reduces noise at the cost of delay, and an honest reference measurement is the only way to know which problem you have.

Project

Kitchen-table project: characterise a measuring device

Choose a measuring device you already have: a kitchen scale, a ruler, a bathroom scale, or a phone's built-in compass.

  1. Find a reference you trust, such as an unopened 500 g packet of food (the printed mass is a reasonable reference) or a known angle.
  2. Take at least ten measurements of the same thing, resetting the device each time.
  3. Compute the mean, the bias (mean minus reference) and the standard deviation, by hand, in a spreadsheet, or by adapting the Python example.
  4. State the device's resolution from its display, and compare it with the scatter you measured.

Write two sentences on whether the device is more limited by accuracy, precision or resolution.

Deliverables

  • A list of at least ten readings and the reference value
  • Calculated mean, bias and standard deviation
  • A short verdict on the device's main limitation

Knowledge check

Check your understanding

  1. 1. A sensor's readings are tightly grouped but consistently 3 mm higher than the true value. How would you describe it?
  2. 2. A 10-bit ADC spans a sensor range of 0–100 °C. What is the approximate resolution?
  3. 3. Averaging the last 20 readings makes a signal smoother. What is the main cost?
  4. 4. A robot drives at 0.5 m/s and its obstacle sensor updates 5 times per second. How far does it travel between readings?
  5. 5. Why do you need an independent reference measurement to discover a sensor's bias?

Go further