flowchart TD
A["Raw sensor code"] --> B["Apply calibration method"]
C["Reference calibration points"] --> B
B --> D["Converted physical units"]
D --> E["Compare held-out residuals"]
E --> F{"Residuals within tolerance?"}
F -- "yes" --> G["Ship with valid range and uncertainty"]
F -- "no" --> H["Change method, add points, or relax claim"]
A --> I{"Inside calibrated range?"}
I -- "no" --> J["Flag or clamp instead of extrapolating"]
22 Sensor Linearization Methods
Choose Calibration Methods Without Hiding Measurement Error
22.1 In 60 Seconds
Linearization turns a curved sensor response into physical units, but it must not hide uncertainty. Pick the simplest method whose held-out residuals meet the target, keep the calibrated range explicit, and flag or clamp values outside the evidence instead of extrapolating confident numbers.
22.2 Start With the Story
Start with a physical signal that is noisy, delayed, sampled, quantized, calibrated, filtered, packed, and finally sent as a number someone will trust. The core idea in Sensor Linearization Methods is simple: signal processing is the bridge between the physical world and digital evidence, so every sampling, ADC, filter, and calibration choice changes the value that leaves the device. This page focuses that idea on Practice for selecting Taylor, piecewise-linear, lookup-table, and polynomial sensor linearization methods from calibration evidence, residual checks. In everyday IoT, temperature drift, vibration spikes, audio snippets, and lab traces all become decisions only after their limits and uncertainty are made visible. Start simple: trace one measurement through the chain, keep the raw-to-processed evidence, and move advanced math into the deeper review only when the simple chain no longer explains the result.
22.3 Turn a Curved Response Into Correct Units
Many sensors do not produce an output that is proportional to what they measure. A thermistor’s resistance, for example, changes steeply and nonlinearly as temperature changes. Linearization is the step that converts that curved raw response into the correct physical units.
Picture a bathroom scale whose spring stiffens as it compresses. The pointer still moves, but not evenly, so you need a conversion that knows the spring’s curve to read true weight. Linearization is that conversion for a sensor.
If you only need the intuition, this layer is enough: linearization maps a sensor’s curved output to real units, and a smooth, precise-looking converted number is only as accurate as the calibration it rests on, never more.
The honesty rule matters most here. Making the numbers come out smooth is not the same as making them accurate. A conversion can present a clean value to many decimals while the real uncertainty lives in the calibration behind it. No method can be more accurate than the calibration data it was built from.
Consider an NTC thermistor on a cold-chain logger. The ADC code may change quickly near freezing and slowly at warmer temperatures, so a single slope can make the freezer end look acceptable while the room-temperature end drifts. A better workflow is to collect reference points across the shipping range, fit a Steinhart-Hart equation or a lookup table, then compare the converted temperatures against held-out reference readings. If the held-out residuals are still larger than the product’s tolerance, the display should not imply more accuracy than the calibration proves. The firmware also needs to know the calibrated range: an ADC code outside the tested span should be flagged or clamped, not silently converted into a confident Celsius value.
The One-Minute Linearization Decision
Know the curve
Get the sensor’s characteristic from the manufacturer or your own calibration before choosing a method.
Match method to constraints
Balance accuracy, operating range, and the device’s available compute and memory.
Keep error visible
Track residuals and the valid range so the conversion does not hide measurement uncertainty.
Beginner Examples
- A nearly linear sensor over a small range may need only a straight-line fit with an offset and a slope.
- A steeply curved sensor over a wide range needs a method that follows the curve, such as a lookup table or a fitted model.
- A value shown to six decimals is not accurate to six decimals if the calibration was only good to a fraction of a unit.
Linearization Honesty Knowledge Check
If this gives you the core principle, you can stop here. Continue to Practitioner when you need to choose a method for a real sensor.
22.4 Apply It: Choose a Method From the Evidence
The practical job is to choose the simplest linearization method whose residuals meet the accuracy target within the device’s limits, then prove it on held-out data and protect against out-of-range inputs.
The Method Options
Walkthrough: From Sensor Curve to Validated Conversion
- Characterize the sensor. Gather calibration points across the real operating range, not only a few convenient values.
- Quantify nonlinearity and range. A nearly straight, narrow-range sensor needs far less than a steeply curved, wide-range one.
- List device constraints. Available compute, memory, and required conversion speed narrow the field; a small microcontroller may favor a lookup table over a high-degree polynomial.
- Choose the simplest method that meets the target. Prefer the least complex method whose residuals stay within budget.
- Check residuals on held-out points. Large or patterned residuals mean the method or its parameters are wrong.
- Guard the range and validate at release. Clamp or flag inputs outside the calibrated range, and re-validate against references before shipping and after any sensor or firmware change.
Choosing by Evidence
Incremental Practice
Beginner
For a near-linear sensor over a small range, justify using a simple slope-and-offset fit.
Intermediate
For a constrained device and a steeply curved sensor, argue for a lookup table over a high-degree polynomial.
Advanced
Given residuals that form a systematic curved pattern after a linear fit, state what that pattern reveals and your next step.
Method Selection Knowledge Check
If your job is to select and validate a conversion, you can stop here. Continue to Under the Hood for how each method fails.
22.5 Under the Hood: How Each Method Fails
The deeper layer explains the error behavior behind each method, because choosing well means knowing how each one breaks.
Local (Taylor) Linearization
A local linearization keeps the first-order term of a series expanded around an operating point, which is the local slope, and discards the rest. Those discarded higher-order terms are the error, and they grow roughly with the square of the distance from the expansion point. The result is excellent near the point and increasingly wrong far from it.
Polynomial Fit and Overfitting
A polynomial of degree n has n + 1 coefficients and can pass exactly through n + 1 points. Passing through the points is not accuracy. High-degree fits, especially with equally spaced calibration points, can swing far above and below the true curve between the points, a behavior known as the Runge phenomenon, and they diverge quickly outside the calibrated range. Prefer the lowest degree whose held-out residuals are acceptable.
Piecewise-Linear and Lookup Tables
Both approximate the curve with straight segments, and a lookup table is essentially a piecewise-linear model stored as data. The error inside a segment depends on the curve’s bend and the segment width. For a smooth curve the worst-case interpolation error scales with the square of the segment width, so halving the segment width roughly quarters the error. Accuracy is therefore bought with more breakpoints or table entries, which costs memory.
Calibration Uncertainty Is the Floor
No linearization can be more accurate than the calibration points it is built from. If the reference is uncertain, every converted value inherits that uncertainty. Keep two ideas separate: model error is how well the curve fits the points, and calibration error is how good those reference points were in the first place.
Residual Analysis
Residuals are the differences between the model and held-out calibration points. Small, randomly scattered residuals suggest a good fit, while a systematic pattern, such as a consistent smile or trend, means the model is missing real structure. Residuals measured on the same points used to fit understate the true error, so always check against points the model did not see.
Extrapolation Is Unbounded
Every method is valid only inside the calibrated range. Outside it, polynomial terms explode and tables have no data, so out-of-range inputs must be clamped or flagged rather than silently converted into confident, wrong numbers.
Common Pitfalls
- Equating fit with accuracy. Passing through every calibration point can be overfitting, not correctness.
- Raising polynomial degree to chase residuals. It can oscillate and worsen accuracy between and beyond the points.
- Reporting more precision than the calibration supports. The converted value cannot beat its reference.
- Extrapolating beyond the calibrated range. Error there is unknown and can be large.
- Checking residuals only on the fitting points. That hides the real generalization error.
Overfitting Knowledge Check
At this depth, linearization is a trade among model flexibility, compute, memory, and honesty about uncertainty. The best method is the simplest one whose held-out residuals meet the target, applied only inside the range where the calibration can vouch for it.
22.6 Summary
- Linearization converts a sensor’s nonlinear raw output into correct physical units.
- A smooth, precise-looking converted value is never more accurate than the calibration behind it.
- Common methods are local (Taylor) linearization, piecewise-linear, lookup tables with interpolation, and polynomial fits, each with different error behavior.
- Choose the simplest method whose held-out residuals meet the accuracy target within the device’s compute and memory limits.
- High-degree polynomials can overfit and oscillate, so passing through every calibration point is not proof of accuracy.
- Every method is valid only inside the calibrated range, so out-of-range inputs must be clamped or flagged and residuals checked on held-out points.
Pick the simplest linearization method whose held-out residuals meet the accuracy target, keep the calibration uncertainty visible rather than hidden by smooth numbers, and never trust the conversion outside its calibrated range.
22.7 See Also
ADC Sampling Fundamentals
The sampling and resolution decisions that produce the raw codes you linearize.
Signal Processing Essentials
Where linearization fits among filtering, resolution, and validation decisions.
