Sensors that are not linear over the measurement range require some curve-fitting to achieve accurate measurements over the measurement range. A common case requiring curve-fitting is thermocouples at extremely hot or cold temperatures. While nearly linear over a fairly wide range, they do deviate significantly at extreme temperatures.
The graphs below show the characteristic curves of high, intermediate and low temperature thermocouples. Note how the lines start to curve more at the extremes.
Thermocouple Characteristic Curves
Thermocouple curves CC0 Public Domain via Wikimedia Commons
Fortunately, the characteristic curve of standard thermocouple types are well understood and curve-fitting coefficients are available from NIST and other sources.
If you are using a Max31855 Thermocouple Amplifier, check out the next page for some excellent linearization code developed by some members of the Adafruit Forum.
But if you are working with a home-brew DIY sensor, you may need to do some characterization to determine the characteristic curve and derive a linearization formula for your sensor.
Excel and similar spreadsheet type programs have some built-in tools to assist with curve fitting. For a good tutorial on Advanced Regression with Excel, see the following link:
Text editor powered by tinymce.