Chapters

28 Accuracy, Precision, Drift, and Hysteresis

sensors
sensor
types
accuracy

28.1 Start With the Measurement Story

Separate a Slow Sensor From a Wrong Sensor

Picture a room sensor that matches a reference at rest but misses every fast temperature change. Bandwidth means the range of change rates a sensor can follow well enough for the intended decision.

Name the reference, sample timing, expected change, sensor reading, and allowed error. Test steady, repeated, rising, and falling inputs while keeping the setup fixed.

Keep both traces, time offsets, calibration state, and uncertainty. This proves behavior across the tested range and speed, not every environment; the deeper sections separate accuracy, precision, drift, hysteresis, bandwidth, and remedies.

A tidy graph can hide three different problems: readings can be wrong, scattered, or slowly moving over time. The first step is to separate accuracy, precision, drift, hysteresis, and repeatability before choosing a fix.

28.2 Learning Objectives

After this page, you should be able to:

  • Distinguish accuracy, precision, drift, hysteresis, resolution, and uncertainty.
  • Explain why averaging improves random scatter but does not remove systematic bias.
  • Use bidirectional tests to expose hysteresis and time-based tests to expose drift.
  • Build a practical error budget instead of trusting displayed decimal places.
  • Choose the matching remedy: calibration, averaging, bandwidth control, recalibration, characterisation, or uncertainty reporting.

28.3 Why This Follows Common Sensor Mistakes

Common Sensor Mistakes prevents the obvious failures: voltage mismatch, missing pull-ups, bad warm-up timing, invalid readings, overpolling, address conflicts, analog-reference errors, missing decoupling, long wire runs, and environmental blind spots. After those are handled, the next common failure is misclassifying the remaining measurement error.

Use this page when the sensor works but the number still cannot be trusted. A tight cluster in the wrong place needs calibration, not a longer moving average. A value that changes month by month needs drift evidence and recalibration. A pressure or position reading that differs by direction needs hysteresis testing. The first step is naming the error correctly.

The mathematical gist. With the chapter’s catalog-typical 3.3 V reference, a 24-bit ADC has a 197 nV step, 56.8 nV RMS quantisation noise, and an ideal 146 dB ceiling. A 2%-accurate sensor is only 34.0 dB on the same scale. The 112 dB gap is about 410,000×410{,}000\times: more converter bits shrink rounding, but they cannot remove the sensor’s bias, drift, or hysteresis.

Math Bridge · guided foundationsWhy can't 24 bits rescue a 2%-accurate sensor?Let Phoebe put ADC rounding and sensor bias on one dB scale without confusing them.

28.4 Four Sensor Error Terms

More sensor mistakes trace back to confusing four specifications than to any wiring error: accuracy, precision, drift, and hysteresis. They sound related, but they are independent, and confusing them leads to fixing the wrong problem.

Start by accuracy — how close a reading is to the true value. Then precision (repeatability) — how tightly repeated readings cluster, whether or not that cluster sits on the true value. Next drift — a slow change in the reading over time or temperature while the true input is constant. Finally hysteresis — a reading that depends on the direction you approached from (rising vs falling).

Accuracy and precision call for different remedies, so inspect the four target panels in Figure 28.1 before attaching a correction to a bad dataset.

Four targets compare tight centered, tight offset, scattered centered and scattered offset readings. Precision can coexist with inaccuracy when systematic offset needs calibration.
Figure 28.1: Four target-style panels compare sensor readings that are accurate and precise, precise but biased, accurate but noisy, or neither accurate nor precise.

The upper-left panel of Figure 28.1, High Accuracy + High Precision, clusters readings on the true value and represents the desired measurement. Low Accuracy + High Precision keeps a tight cluster but moves it off-centre, exposing a systematic offset that calibration can correct. In contrast, High Accuracy + Low Precision spreads readings around the centre; averaging can reduce that random noise but cannot repair a bias. Low Accuracy + Low Precision combines both defects, and the panel’s “Replace the sensor” warning reflects the weak evidence available for either correction. These patterns anchor the four terms below: location of the cluster speaks to accuracy and bias, while its spread speaks to precision and repeatability; drift adds the time dimension.

Intuition (the dartboard): precise but inaccurate is a tight cluster in the wrong place; accurate but imprecise is a loose scatter centred on the bullseye. They are different problems with different fixes — and neither is drift or hysteresis, which change over time or with direction.

Worked example: classify the mistake before fixing it

A temperature reference says the chamber is 25.0 °C. A sensor reports 27.9, 28.0, 28.0, 28.1, and 28.0 °C. The readings cluster tightly, so the sensor is precise. The cluster is about +3.0 °C from the reference, so it is inaccurate. Taking 100 more samples would make the mean look more stable, but it would still be near 28.0 °C unless you calibrate the offset.

Now suppose another sensor reports 24.4, 25.7, 24.9, 25.3, and 24.7 °C around the same reference. Its average is close to truth, but the spread is large for a control loop that needs stable tenth-degree changes. The fix is not the same. The first sensor needs calibration; the second needs noise reduction, bandwidth control, or a better front end. A third sensor that starts at 25.0 °C and creeps to 26.2 °C over a month has drift, so the fix is a recalibration interval. A pressure sensor that reads differently on the way up than on the way down has hysteresis, so you must test both directions.

Accuracy specifications often combine a fixed offset term with a proportional gain term. A meter specified as +/-(0.1% of input + 1 mV) over a 0 to 10 V input can be about +/-1 mV at zero, +/-6 mV near 5 V, and +/-11 mV near 10 V. The offset dominates near zero; the gain term grows with the signal. Keep both terms in the error budget instead of collapsing them into one headline percentage.

Co-located sensors give a useful precision test. Five temperature or humidity probes installed beside each other may trace the same weather pattern while small spreads, dropouts, and lag reveal repeatability, response, and installation differences. Agreement among the probes proves consistency within that group; it still needs a reference check before it proves absolute accuracy.

Overview Knowledge Check

28.5 Accuracy-Precision Confusion

Each confusion produces a predictable, costly mistake:

The mistakeWhy it fails
Averaging to improve accuracyAveraging tightens random scatter (precision), but a systematic bias survives untouched — you get a very repeatable wrong answer.
Treating resolution as accuracyA reading shown to five decimals can still be badly wrong; fine resolution does not imply closeness to truth.
Calibrate once, trust foreverDrift moves the response after calibration, so an old calibration slowly becomes wrong even if it was perfect on day one.
One-direction repeatability testsApproaching a value only from below hides hysteresis, which only shows up when you also approach from above.

Worked example: hysteresis hiding in a pressure sensor

A pressure sensor spanning 0–100 kPa is specified with 0.5% full-scale hysteresis. That means at a true 50 kPa the reading can differ by up to:

0.5% × 100 kPa = 0.5 kPa

…depending on whether you reached 50 kPa while pressure was rising or falling. A test that only ramps pressure upward will report excellent repeatability and completely miss this 0.5 kPa direction-dependent error.

Worked example: the wrong cure wastes the debug pass

A soil-moisture node gives ADC codes with a standard deviation of about 12 counts when the probe is held in one sample. Averaging 16 independent samples reduces random scatter by roughly sqrt(16) = 4, so the display noise may fall to about 3 counts. That is a precision improvement.

But if the probe was never calibrated and the conversion curve is shifted by 80 counts, the 16-sample average still carries almost the same 80-count bias. Likewise, if the reading changes by 20 counts after the probe sits in the soil for an hour, the issue may be settling or drift rather than random noise. The practical mistake is treating every bad reading as a filtering problem. Before writing more smoothing code, record whether the symptom is scatter, offset, slow change, direction dependence, clipping, or an impossible value.

This classification step also protects the rest of the troubleshooting checklist. A voltage-level mistake is solved before calibration, an address mistake is solved before filtering, and a warm-up mistake is solved before publishing data. The order matters because each unchecked mistake can make the next measurement look worse than it is.

Practitioner Knowledge Check

28.6 Different Errors Need Remedies

The reason the distinction matters is that each of the four has a different cure. Reach for the wrong cure and the error stays.

Accuracy → calibration

Close the gap to truth with a traceable reference. Averaging and higher resolution do nothing for a bias; only comparison against a known standard does.

Precision → averaging and bandwidth

Tighten random scatter by averaging uncorrelated samples, limiting bandwidth, and using a lower-noise front-end — the tools that do nothing for accuracy.

Drift → recalibration and tempco

Set a recalibration interval sized to tolerable drift, and compensate temperature coefficient in firmware if a temperature reading is available. A one-time calibration cannot hold back drift.

Hysteresis → hardware and characterisation

No fit removes path dependence; it must be minimised in the material/mechanics and then characterised by testing both directions and quoting it as residual uncertainty.

Worked example: build an error budget instead of trusting resolution

A tank-level sensor is displayed with 0.1 cm resolution, but the error budget is larger. Calibration against a ruler leaves a possible +0.4 cm bias. Repeat readings have random scatter of about 0.2 cm standard deviation. Averaging 16 samples reduces that random term to about 0.2 / sqrt(16) = 0.05 cm. The display looks steady, but the calibration term still dominates.

If the sensor drifts by 0.1 cm per month and the last calibration was six months ago, add another possible 0.6 cm. If filling and draining tests differ by 0.3 cm at the same level, hysteresis adds another residual uncertainty. A conservative worst-case statement is about 0.4 + 0.05 + 0.6 + 0.3 = 1.35 cm. A root-sum-square estimate would be smaller, but only if the assumptions about independent errors are justified.

The reporting mistake is to publish "level = 47.3 cm" with no context. A better engineering record says "47.3 cm, calibrated six months ago, random noise after averaging about 0.05 cm, drift allowance about 0.6 cm, hysteresis allowance about 0.3 cm." That record tells the next engineer whether to recalibrate, filter, change hardware, or simply accept the uncertainty.

The deepest mistake underneath all four is reporting a bare number with no sense of its error character. "23.7 °C" hides whether that carries a two-degree bias, hundredth-degree noise, an hourly drift, or a direction-dependent offset. And resolution never rescues the weakest link: a 24-bit ADC in front of a 2%-accurate sensor still gives a 2%-accurate result. A trustworthy reading always travels with its error budget.

Under-the-Hood Knowledge Check

28.7 Separate Bias, Scatter, and Time in One Tank

A tank gauge can repeat the same wrong level all morning and then wander farther as its body warms. That pattern is precise at first, inaccurate against the ruler, and later affected by drift. In Figure 28.1, tight groups show precision while their distance from the target centre shows accuracy; neither picture alone proves stability over time or freedom from hysteresis.

Take five readings at a true 50.0 cm level: 50.5, 50.4, 50.6, 50.5, and 50.5 cm. Their mean is ((50.5+50.4+50.6+50.5+50.5)/5=50.5\ \text{cm}), so the observed bias is +0.5 cm. The readings span only 0.2 cm, which is good repeat precision, but that tight cluster does not erase the +0.5 cm error. If the mean becomes 50.9 cm after a hot afternoon, the extra +0.4 cm is drift evidence.

28.7.1 Predict the Tank Gauge Pattern

  • Predict: Calibration removes the +0.5 cm bias. Will the five readings become identical? Check: No. Calibration can shift their centre, but the 0.2 cm scatter still describes precision.
  • Predict: The gauge reads 50.3 cm while filling and 49.8 cm while draining at the same ruler mark. What changed? Check: The 0.5 cm path-dependent gap is hysteresis, not random scatter.

28.8 Release Checklist

Before accepting a sensor reading, record these measurement-quality checks:

Start by reference value and measured readings used to judge accuracy. Then repeat-read spread used to judge precision or repeatability. Next time, temperature, and environmental span used to judge drift. After that rising and falling test paths used to judge hysteresis. Finally resolution, calibration age, random noise, drift allowance, and residual hysteresis in the reported uncertainty.

28.9 See Also

Start by Common Sensor Mistakes for the hardware and firmware mistake checklist. Then Sensor Specifications for accuracy, resolution, range, and response-time vocabulary. Next Sensor Noise and Averaging Limits for SNR and averaging boundaries. Finally Sensor Calibration for offset, gain, and nonlinearity correction.

28.10 Next

Return to Common Sensor Mistakes once the error type is classified, then apply Sensor Calibration if the dominant error is bias, gain, or drift.