Sensor Calibration Explained
A sensor does not report the truth. It reports an electrical signal that is related to the truth, and the relationship is never perfect. A temperature sensor might read a degree too warm, a pressure sensor might drift as it ages, and two sensors of the same model can disagree with each other. Calibration is the process of comparing a sensor to a known reference and correcting the difference.
This guide explains the main types of error, the common calibration methods, and the habits that keep readings trustworthy over time.
Accuracy, Precision and Resolution
These three words are often confused, but they describe different things.
- Accuracy is how close a reading is to the true value.
- Precision (or repeatability) is how closely repeated readings agree with each other.
- Resolution is the smallest change the sensor and electronics can show.
A sensor can be very precise yet inaccurate, giving the same wrong number every time. Calibration fixes accuracy. It cannot repair poor precision, which comes from noise, and it cannot add resolution the hardware does not have.
Types of Error
Most errors fall into a few families.
- Offset error: The reading is shifted by a constant amount. At zero input, the sensor shows a nonzero value.
- Gain (or span) error: The slope is wrong. The error grows as the input grows, so the reading is off by a larger amount at the top of the range.
- Nonlinearity: The response curves instead of following a straight line. Many sensors, such as thermistors, are strongly nonlinear.
- Hysteresis: The reading differs depending on whether the input is rising or falling.
- Drift: The error changes slowly with time or with temperature.
Offset and gain errors are the easiest to correct, because a simple straight-line formula fixes them.
The Reference Standard
Calibration needs a reference that is more accurate than the sensor being tested. A common rule of thumb in measurement practice is that the reference should be several times better than the device under test. For temperature, that could be an ice bath and a boiling point adjusted for local pressure, or a precision reference thermometer. For voltage, it is a calibrated meter or reference source. For weight, it is a known mass.
A reference must also be traceable, meaning it connects through a chain of comparisons to a national or international standard. In casual hobby work you may skip formal traceability, but you should still know how good your reference is, because your sensor can never become more accurate than what you compared it to.
One-Point Calibration
A one-point calibration corrects offset only. You expose the sensor to a single known condition, record the reading, and subtract the difference from every future reading.
corrected = raw - (raw_at_reference - true_at_reference)
This works when the sensor's slope is already good and only a constant shift is present. It is quick and often enough for a tolerance-friendly application.
Two-Point Calibration
A two-point calibration corrects both offset and gain. You measure the sensor at two known conditions, ideally near the low and high ends of the range you care about. Then you fit a straight line that maps raw readings to true values.
slope = (true_high - true_low) / (raw_high - raw_low)
corrected = true_low + (raw - raw_low) * slope
This is the standard method for many sensors, and it is accurate inside the span between the two points. Outside that span, errors can grow.
Multi-Point Calibration
When the response is nonlinear, two points are not enough. A multi-point calibration measures several known values across the range and either uses a lookup table with interpolation or fits a curve such as a polynomial. This costs more time but can handle sensors with curved characteristics.
Good Calibration Practice
- Allow the sensor and the reference to reach the same stable condition before recording. Rushing causes false readings.
- Take several readings and average them to reduce noise.
- Calibrate under conditions close to real use, including supply voltage and temperature.
- Store calibration constants in non-volatile memory so they survive power loss.
- Record the date, reference used and results.
- Schedule a recalibration interval, because drift is slow but real.
- After calibrating, verify with a third point that was not used in the fit.
When to Recalibrate
Recalibrate on a regular schedule, after any shock or overheating, after repairs, and whenever readings disagree with an independent check. In critical systems such as medical, safety or process control equipment, intervals and procedures are set by standards and regulations, and should be followed exactly.
Frequently Asked Questions
What is the difference between calibration and adjustment?
Calibration compares a device to a reference and records how far off it is. Adjustment then changes the device or its correction values to reduce that error. Some calibrations are done as comparison only, with no adjustment, which documents the error without changing it.
How often should a sensor be calibrated?
It depends on the sensor type, how harsh the environment is and how much accuracy matters. Manufacturers often suggest an interval, and you can shorten it if your checks show drift. Start with the recommendation and adjust based on the history of your own results.
Can software fix a bad sensor?
Software can correct predictable errors like offset, gain and smooth nonlinearity. It cannot fix random noise, large drift, or damage. If a reading is unstable or jumps unpredictably, the sensor, wiring or power supply needs attention, not just a correction formula.