Toolvito

Calculates on this device. File exports run online.

Sensor Linearization Calculator

Type calibration points: the raw reading of the sensor and the true value. The calculator fits a polynomial that turns raw readings into true values, shows the errors left and the sensor’s nonlinearity, and makes a correction table. It can also convert readings with straight lines between the points, or find a thermistor’s Steinhart–Hart coefficients and β.

Enter your values

Your values

Calibration points

The sensor’s raw output (volts, counts …) and the true value from a reference at the same moment.

One point on each line: the raw reading, then the true value (a tab, comma or semicolon between).

More options

Your values are worked out in this browser. They are not sent to a server.

Your result will show here

Fill in the values, then choose Calculate.

Coefficients checked on the server

Coefficients checked on the server

Uses the points of the result above. The server fits the same polynomial with statsmodels, or the Steinhart–Hart equation with SciPy, and compares the coefficients with the page’s. The server needs more points than coefficients (at least 4 for a thermistor).

The calculator above works on your device. When you run a task in this section, Toolvito receives the values and result you submit to make the file or run the check. Download the result within one hour after the job finishes. Choose Delete files now to request earlier removal. The hourly cleanup normally removes files within one to two hours after completion.

How to use the sensor linearization calculator

  1. Choose a polynomial fit, a lookup table, or a thermistor.
  2. Type or paste the calibration points: raw reading and true value on each line (for a thermistor, resistance in ohms and temperature in °C).
  3. For a polynomial, choose the degree; for a lookup table or a thermistor, type the readings to convert.
  4. Read the coefficients, the errors left and the table; copy them into your firmware or spreadsheet.

How it works

  • Polynomial: true = a0 + a1·raw + a2·raw² + …, fitted by least squares; the errors left are the differences at the points.
  • Nonlinearity: the largest distance of the points from their best straight line, in % of the true-value span.
  • Lookup table: between two points the true value follows the straight line through them.
  • Steinhart–Hart: 1/T = A + B ln R + C (ln R)³ with T in kelvin (Steinhart and Hart, 1968); three points give an exact fit, more points a least-squares fit.
  • β: ln(R1/R2) ÷ (1/T1 − 1/T2) between the first and last points.

Worked example

Six points from raw 0.10 (true 0) to 2.57 (true 50): a degree-2 fit gives true = −2.3233 + 24.2452 raw − 1.5202 raw², with at most 0.127 of error left at the points; the raw sensor is 2.61 % nonlinear. A 10 kΩ thermistor with 32,650 Ω at 0 °C, 10,000 Ω at 25 °C and 3,602 Ω at 50 °C gives A = 1.1274 × 10⁻³, B = 2.3440 × 10⁻⁴, C = 8.675 × 10⁻⁸ and β = 3891 K.

Limits you should know

  • Use the curve only between the smallest and largest raw readings you calibrated: outside them a polynomial can bend away fast.
  • A higher degree always fits the points better but can swing between them; keep the lowest degree whose errors are small enough.
  • The errors shown are at the calibration points only; the accuracy of your reference and the sensor’s drift are not included.

Related tools