21 Calibration Taxonomy and Zero-Span
21.1 Start With the Measurement Story
Prove the Correction With a Point You Did Not Use
Picture a tank probe that should read zero when the tank is empty and one hundred when it is full. It reports five at empty and ninety at full. A team can shift the line, stretch it, or fit a curve. The safe choice depends on the error shown by real reference points.
Calibration means comparing a measurement with a known reference, then recording any correction. A zero error shifts every reading by about the same amount. A span error makes the change too small or too large. A curved error changes by a different amount across the range. Drift means the error changes with time. Hysteresis means the result depends on whether the input rose or fell.
Measure empty, middle, and full points while the level rises and falls. Use some points to make the correction. Keep at least one point aside to test it. Then change temperature, restart the device, and try a value beyond the tested range. Keep the raw reading beside the corrected one.
This runway does not prove every future reading or choose a curve by itself. The deeper sections show the arithmetic, residual checks, reference records, expiry rules, and limits needed before a calibration can support a release.
A calibration problem is easier when the error has a name. Begin by asking whether the reading is shifted, stretched, curved, drifting, or hysteretic, because zero, span, and curve errors need different fixes.
21.2 Learning Objectives
After this page, you should be able to:
- Match offset, span, nonlinearity, drift, and hysteresis errors to the correction they can or cannot support.
- Run zero-and-span arithmetic from two reference readings without hiding the zero offset.
- Use residuals and holdout points to decide when a calibration model is overfit or out of range.
- Record traceability, expiry, and environmental evidence so calibration coefficients remain auditable.
21.3 After Calibration Techniques
Sensor Calibration Techniques introduces one-point, two-point, and multi-point calibration workflows with calculators and implementation examples. This page focuses on the decision logic behind those workflows: what kind of error is present, which correction is defensible, and what evidence should travel with the coefficients.
Use it before accepting a calibration record for a deployed IoT device, especially when the sensor has curvature, drift, temperature dependence, or a measurement claim that must survive review.
21.4 Calibration as a Toolbox
Calibration is often imagined as one action, but it is really a small toolbox of corrections, each aimed at a different kind of error. Match the tool to the error and the fix is clean; use the wrong tool and the error survives.
Three systematic errors have three matching corrections. A zero (offset) error is a constant shift, fixed by a one-point zero adjustment. A span (gain) error is a wrong scale, fixed by adding a second point. Nonlinearity is curvature the straight-line fit cannot follow, fixed by multiple points or a polynomial. A fourth problem, hysteresis, is path-dependent and cannot be removed by any of these — it has to be minimised in hardware and lived with as a spec.
In an IoT system, calibration is the boundary between a raw signal and a claim you can defend. A thermistor voltage, load-cell ADC count, or gas-sensor resistance is only an observation until it is tied to a reference standard with a date, environment, and method. That is why calibration records should name the reference instrument, the points used, the averaging window, and the final coefficients stored in firmware or cloud metadata.
The reference may be a traceable instrument or a physical condition that is stable enough for the claim: a NIST/NPL-traceable thermometer, a ruler or gauge block for a range sensor, an ice-water or boiling-water bath for temperature endpoints, or a 1 g orientation check for an accelerometer. The record should name the reference, its uncertainty, and the range it actually covered; otherwise calibration only maps one untrusted number onto another.
The number of reference points follows from the error you are trying to remove. One stable point can remove a zero shift, but it says nothing about slope. Two points define a straight line and therefore correct both zero and span across the calibrated range. Three or more points are evidence that the response bends; they can support a lookup table or low-order fit, but they also create a duty to validate at points that were not used to build the correction.
Intuition: zero correction slides the response, gain correction tilts it, linearity correction un-bends it. Knowing which of these your error is tells you exactly how many reference points you need.
Choosing zero, span, or nonlinear correction requires evidence about the error’s shape. Figure 21.1 shows how that diagnosis is built before any coefficient is accepted.
Figure 21.1 opens with 1. Reference Standards, explicitly requiring known, traceable values. 2. Collect Raw Measurements then calls for multiple points over the full range; only those pairs can reveal whether 3. Error Analysis finds offset, gain, or non-linearity. The Calibration Curve makes the diagnosis visual by contrasting Ideal and Actual, while the separate Offset Error and Gain Error sketches show why one correction cannot substitute for the other. The final 4. Correction Model offers a polynomial fit or lookup table, and the displayed y_cal equation records what firmware will apply. That sequence turns the section’s toolbox metaphor into a rule: select the smallest model justified by the reference data, then retain the conditions and validation evidence.
21.4.1 Overview Knowledge Check
21.5 Practitioner: Zero-and-Span Correction
The everyday two-point calibration is best understood as two separate corrections: subtract the zero, then rescale by the gain.
Run the procedure like a measurement task, not a single button press. Let the sensor and reference settle, take several readings at each point, average them, and write down the conditions. Temperature, supply voltage, mounting stress, and warm-up time can all move the raw reading, so a coefficient produced from rushed data can look mathematically clean while still being wrong in the field.
Choose reference points that bracket the useful operating range. If a freezer monitor only needs -20°C to 10°C, a low reference near -20°C and a high reference near 10°C teach the firmware more than a distant boiling-water point. After fitting the line, reserve a third value as a holdout check. The corrected reading at that holdout should meet the product tolerance before the calibration is accepted.
| Error type | Character | Correction | Points needed |
|---|---|---|---|
| Zero / offset | Additive constant | Subtract measured zero | 1 |
| Span / gain | Multiplicative scale | Multiply by true span / measured span | 2 |
| Nonlinearity | Curvature | Multi-point table or polynomial | 3 or more |
| Hysteresis | Path-dependent | Not correctable by fit; minimise in hardware | — |
21.5.0.1 Worked example: zero-and-span on a 0-100 unit sensor
A checkout finds the sensor reads:
2 units at a true 0 (zero error = +2)
98 units at a true 100
measured span = 98 - 2 = 96
gain = true span / measured span = 100 / 96 = 1.0417
corrected = gain × (raw - zero)
= 1.0417 × (raw - 2)
Check at raw = 98: 1.0417 × (98 - 2) = 1.0417 × 96 = 100 ✓
Check at raw = 2: 1.0417 × (2 - 2) = 0 ✓
Splitting the fix into "remove the zero, then scale the span" makes it obvious why you need exactly two points: one to find the zero, a second to find the gain.
For deployment, store more than just the two numbers. A useful record includes the raw low/high readings, the true reference values, the computed zero and gain, the technician or fixture ID, and the firmware version that applied the calculation. If a later batch starts failing validation, those records let you separate a bad sensor lot from a software regression or a drifting reference standard.
21.5.1 Practitioner Knowledge Check
21.6 Polynomial Calibration Risks
When curvature remains after zero-and-span, you reach for more points — but more is not always better, and no calibration lasts forever. The engineering problem is not to make a pretty curve through the calibration points; it is to reduce residual error across the range where the sensor will actually be trusted.
Start by plotting residuals: corrected value minus reference value at every calibration and validation point. If the residuals are randomly small, the model is probably adequate. If they arc upward or downward, the model is missing curvature. If they are small at the fit points but large between them, the fit is probably too flexible. A simple lookup table with interpolation is often safer than a high-order polynomial because its behavior between adjacent reference points is easier to inspect.
Linearity is also conditional. Temperature, vibration, acoustic noise, humidity, supply voltage, mounting stress, and bandwidth can move the residual curve after the neat bench plot is finished. A sensor may look linear during slow sweeps but distort rapidly changing inputs because the transducer, package, filter, or ADC front end adds amplitude lag, phase shift, or harmonics. If those error harmonics fall into the same band as the signal of interest, a polynomial fitted from DC reference points will not rescue the measurement. Dynamic nonlinearity needs a time-domain or frequency-sweep check, with bandwidth and response-time limits recorded beside the calibration curve.
21.6.0.1 Polynomial linearization
Fit corrected = a0 + a1·x + a2·x^2 + ... from several reference points to model the curve. A second- or third-order fit usually captures smooth sensor curvature well.
21.6.0.2 Overfitting and extrapolation
Too high an order chases measurement noise instead of the true curve and can swing wildly just outside the calibrated range. Use the lowest order that meets the spec, and never trust it beyond the points.
21.6.0.3 Look-up tables as an alternative
A multi-point table with interpolation avoids overfitting entirely and behaves predictably, at the cost of storing the points. It is often the robust choice for awkward, non-polynomial curves.
21.6.0.4 Calibration has an expiry
Sensors drift with time and temperature (quoted as %FS per year, ppm per °C). The recalibration interval is set by how much drift you can tolerate; a temperature reading lets firmware compensate the tempco between calibrations.
Drift turns calibration into a lifecycle decision. Suppose a 0–100 unit sensor is allowed 0.5 units of total measurement error and its datasheet drift is 0.2% of full scale per year, or 0.2 units/year. If the initial calibration already consumes 0.1 units of the budget, only 0.4 units remain for drift. A simple limit gives 0.4 / 0.2 = 2 years before the budget is exhausted; a maintenance plan might set the recalibration interval to 12 or 18 months to leave margin for harsh conditions and reference uncertainty.
Two final disciplines separate a calibration you can defend from one you cannot. Traceability: the fit is only as good as the reference standard, so record what you calibrated against and when, including the reference accuracy. Honesty about hysteresis: it is path-dependent, so no offset, gain, or polynomial removes it — it must be designed out, tested in both directions, and then stated as a residual uncertainty. Range discipline matters too: outside the lowest and highest reference points, the correction is an extrapolation, not a calibration.
21.6.1 Under-the-Hood Knowledge Check
21.7 Release Checklist
Before accepting calibration coefficients, confirm these points:
Start by the reference standards bracket the operating range that the device will actually use. Then offset, gain, nonlinearity, drift, and hysteresis have been separated instead of folded into one unexplained number. Next at least one holdout point not used in the fit validates the corrected reading against the product tolerance. After that the stored record includes raw readings, true references, environmental conditions, reference instrument ID, firmware version, and calibration date. Continue by the recalibration interval follows the drift budget rather than a generic calendar guess. Finally readings outside the lowest and highest reference points are labelled as extrapolations, not calibrated values.
21.8 See Also
Start by Sensor Calibration Techniques for the main workflow, calculators, and coefficient-storage examples. Then Sensor Calibration Lab for hands-on calibration and validation practice. Next Span Validation and Release Evidence for range guards, residuals, release labels, and validation evidence. Finally Accuracy, Precision, Drift, and Hysteresis for reporting residual uncertainty after calibration.
21.9 Next
Return to Sensor Calibration Techniques once the error model is clear, then continue to Sensor Calibration Lab to practice validation with a full sensor workflow.
21.10 Calibration Span Error and Validation
21.10.1 Start With the Measurement Story
A sensor can look correct at one point and fail across the working range. The story here is span evidence: checking low, middle, and high values so the calibration works where the IoT system actually operates.
The mathematical gist. A two-point calibration uses and . With the chapter’s 45%/55% references at raw counts 450/550, the slope is 0.1000% per count. If the high raw point is only 10 counts wrong, the fitted slope becomes 0.0909% per count, so raw 0 is reported as 4.1% and raw 1,000 as 95.0%. A narrow span turns a small reference error into a large endpoint error.
21.10.2 Learning Objectives
After this page, you should be able to:
- Explain why reference points that are too close together amplify calibration error.
- Choose calibration references that bracket the operating range instead of extrapolating from the middle.
- Use residual checks to separate random noise from systematic nonlinearity.
- Decide what evidence belongs in a production calibration release record.
21.10.3 Why This Follows the Lab
The Sensor Calibration Lab builds the two-point equation and stores it in firmware. This page tests the equation as an engineering model: the reference span, independent verification points, residual limits, and range guards decide whether the model is trustworthy enough to ship.
A calibration coefficient is not proof by itself. A useful record includes the two fit references, the calculated slope and offset, at least one holdout verification point, the accepted residual limit, and the range where the correction is allowed to operate.
21.10.4 Reference Points Too Close
The mistake: An engineer performs two-point calibration on a soil moisture sensor using reference points at 45% and 55% moisture (only 10% apart). After deployment, the sensor shows large errors at 10% and 90% moisture because small inaccuracies in the closely-spaced reference measurements were amplified across the full range.
Why it happens: Two-point calibration creates a linear equation (y = mx + b) using two measurements. When those measurements are close together, any small error in the reference measurement or sensor reading gets amplified when extrapolating to values far from the calibration range.
Real numbers: A 10 ADC count error (1% of full scale) in your reference point, when calibration range is only 100 counts, produces up to 5% error at the measurement extremes. The narrow calibration range acts as a lever arm amplifying tiny reference errors into significant measurement errors.
The fix: Use calibration points that bracket your expected measurement range with margin:
- Bad practice: Greenhouse needs 20-80% moisture, but calibration points are only 45% and 55%. The 10% calibration span covers only 17% of the operating range.
- Good practice: Greenhouse needs 20-80% moisture, and calibration points are 10% and 90%. The 80% span brackets the full operating range with margin.
Industry rule of thumb: Calibration span should be at least 1.2x your measurement range, ideally centered on your operating range. For a 20-80% application, calibrate at 10% and 90%.
Why wide span matters:
- Error division: 10 ADC count error / 800 ADC span = 1.25% relative error in gain, versus 10% relative error with a 100-count span.
- Interpolation not extrapolation: Measuring within calibration range is accurate; measuring outside it magnifies errors.
- Sensor nonlinearity: Most sensors are most linear in their mid-range; calibrating near the working endpoints exposes curvature sooner.
Verification test: After calibration, check several points across the full range:
- 0% moisture: Read dry sensor in air.
- 25% moisture: Use calibrated reference soil.
- 50% moisture: Half-saturated reference.
- 75% moisture: Nearly saturated reference.
- 100% moisture: Fully submerged in water.
If errors at 0% and 100% exceed +/-2%, your calibration points were too close together.
21.10.5 Close Reference Points Add Error
Start by calibration points: 45% and 55%. Then correct raw readings: 450 and 550 on a 0-1000 ADC scale. Next correct gain: (55 - 45) / (550 - 450) = 0.1. After that if the high point is off by only 10 ADC counts, the gain becomes (55 - 45) / (560 - 450) = 0.0909. Continue by at the low extreme, 0% becomes 4.1%. Finally at the high extreme, 100% becomes 95.0%.
The tiny reference error becomes a large endpoint error because the calibration span was too narrow.
21.10.6 Calibration Span Error
Explore how the width of your calibration span affects error amplification. Adjust the calibration points and reference error to see the impact on measurement accuracy at the extremes.
21.10.7 Knowledge Check: Calibration Span
21.10.8 Concept Relationships
| This Concept | Relates To | Relationship Type |
|---|---|---|
| Two-Point Calibration | Linear Algebra | Uses y=mx+b equation for correction |
| Gain Correction | Sensitivity Error | Multiplier that fixes slope/sensitivity issues |
| Offset Correction | Zero-Point Error | Additive constant that fixes bias |
| EEPROM Storage | Persistence | Non-volatile memory preserves calibration across power cycles |
| Moving Average Filter | Noise Reduction | Pre-filters data before calibration capture |
21.10.9 Label the Diagram
21.10.10 Code Challenge
21.10.11 Calibration Linearity Limits
A two-point calibration produces a straight line, so it silently assumes the sensor is linear between and beyond those points. That assumption is where calibrations quietly go wrong.
Use residuals to see the limit. Suppose the 0 kPa and 100 kPa references both calibrate exactly after the two-point fit, but a 50 kPa check reference reports 54 kPa. The residual is +4 kPa at mid-range. Repeating the 50 kPa measurement ten times may reduce random scatter around that 54 kPa value, but it will not move the average to 50 kPa because the remaining error is systematic curvature. A production calibration record should therefore keep the reference points, the fitted coefficients, and at least one independent verification residual, not just the final slope and offset.
Extrapolation is even riskier. The same line may be acceptable from 0 to 100 kPa but untrustworthy at 120 kPa, because the sensor diaphragm, bridge circuit, or ADC front end may stop behaving linearly outside the bracketed range. If the device must operate across a wider range, add reference points and use a piecewise-linear table or a fitted curve, then document the maximum allowed residual. The important engineering habit is to treat calibration as a model with a valid range, not as a permanent magic correction.
The endpoint fit can look perfect while the middle of the range is wrong. Figure 21.2 shows the independent checks needed before a calibration line is treated as a valid measurement model.
Figure 21.2 keeps Fit Points and Holdout Points separate: the former build the line, while the latter test it without having influenced the coefficients. Their errors feed Residual Review, where the +4 kPa mid-range result in this section would expose curvature despite perfect endpoints. The final Range Guard prevents a value beyond the validated bracket from inheriting unjustified confidence. If either residuals or range checks fail, the diagram sends the work back for better evidence or a different method. That loop connects the worked example to the following choice among more points, piecewise linearization, and explicit operating limits.
One point vs two points
A single reference can only correct offset; it trusts the datasheet slope. Two references correct offset and gain. Neither can correct curvature — that needs more points.
Interpolation vs extrapolation
Readings between the two references are interpolated and usually solid. Readings outside them are extrapolated, where unmodelled nonlinearity grows fastest. Bracket your working range.
Residual nonlinearity
If the true curve bows away from the line, a two-point fit leaves a bow-shaped error, largest near the middle. A three-point or polynomial fit is the fix, not a better two points.
Only as good as the reference
The calibration inherits the uncertainty of your reference standard. An uncertain reference gives an uncertain line — traceability matters, and drift means the line expires and must be redone.
It is also worth separating two jobs that are easy to confuse. Calibration removes systematic error (offset, gain, and with more points, curvature). Averaging many samples removes random error (noise). Averaging a badly calibrated sensor just gives you a very repeatable wrong answer.
21.10.11.1 Calibration Validation Limits
21.10.12 Release Checklist
Before accepting a two-point sensor calibration, record this evidence:
Start by the low and high reference values, including their uncertainty and traceability. Then the raw ADC counts or electrical readings captured at each reference. Next the calculated slope and offset, with units. After that at least one independent holdout point that was not used to fit the line. Continue by the maximum allowed residual and the actual residuals observed. Finally the operating range where interpolation is allowed and the rule for rejecting extrapolated readings.
21.10.13 See Also
Start by Sensor Calibration Lab - hands-on Wokwi calibration workflow. Then Sensor Calibration Techniques - broader calibration method reference. Finally Sensor Data Processing - filtering and signal conditioning before calibration capture.
21.10.14 What’s Next
Return to Sensor Calibration Lab for the lab summary, or continue to Sensor Power Management to connect measurement quality with field energy constraints.
