A Two Point Calibration is a little more complex.  But it can be applied to either raw or scaled sensor outputs. A Two Point calibration essentially re-scales the output and is capable of correcting both slope and offset errors.  Two point calibration can be used in cases where the sensor output is known to be reasonably linear over the measurement range.

## How to do it:

To perform a two point calibration:

1. Take two measurements with your sensor:  One near the low end of the measurement range and one near the high end of the measurement range.  Record these readings as "RawLow" and "RawHigh"
2. Repeat these measurements with your reference instrument.  Record these readings as "ReferenceLow" and "ReferenceHigh"
3. Calculate "RawRange" as RawHigh – RawLow.
4. Calculate "ReferenceRange" as ReferenceHigh – ReferenceLow
5. In your code, calculate the "CorrectedValue" using the formula below:

CorrectedValue = (((RawValue – RawLow) * ReferenceRange) / RawRange) + ReferenceLow

## Example

A common example of a two-point calibration is to calibrate a temperature sensor using an ice-water bath and boiling water for the two references.   Thermocouples and other temperature sensors are quite linear within this temperature range, so two point calibration should produce good resuts.

Since these are physical standards, we know that at normal sea-level atmospheric pressure, water boils at 100°C and the "triple point" is 0.01°C.  We can use these known values as our reference values:

ReferenceLow = 0.01°C

ReferenceHigh = 100°C

ReferenceRange = 99.99

Here we'll show a two point calibration of a laboratory thermometer.  But the same principles apply to any temperature sensor:

Phase diagram by Matthieumarechal via Wikimedia Commons

### Boiling Water

As you can see this lab thermometer is off by -4 degrees at the boiling point of water.

### "Triple Point" Ice-Water Bath

The same thermometer registers a little less than zero degrees in the ice-water bath.

RawLow = -0.5°C

RawHigh = 96.0°C

RawRange = 96.5°C

So, if we get a raw reading of 37°C with this thermometer, we can plug the numbers into the equation to get the corrected reading:

(((37 + 0.5) * 99.99) / 96.5) + 0.01 = 38.9°C

This guide was first published on May 18, 2015. It was last updated on May 18, 2015.

This page (Two Point Calibration) was last updated on Mar 21, 2015.