Skip to main content

2 Points Calibration

1. Overview

Two-point calibration adjusts a sensor so that its output matches two known reference values. The device records the raw sensor reading at each reference point and uses the two points to calculate a linear calibration curve. This method compensates for both:

  • Offset error: The sensor reports a non-zero value when the actual reference value is zero.
  • Gain (slope) error: The sensor response does not change at the correct rate as the measured value changes.

Compared with one-point calibration, which corrects only an offset, two-point calibration corrects both offset and gain errors over the calibrated range.

2. Working Principle

The calibration procedure requires two reference points:

  1. Apply the first known reference value and record the corresponding raw sensor reading.
  2. Apply the second known reference value and record the corresponding raw sensor reading.
  3. Store the two pairs of values in the device.
  4. The device converts each subsequent raw reading to a calibrated output using the line through the two points.

The calibrated output is calculated as follows:

y = R1 + ((R2 - R1) / (S2 - S1)) * (x - S1)

Where:

ParameterDescription
xCurrent raw sensor reading
yCalibrated output value
R1First known reference value
S1Raw sensor reading measured at R1
R2Second known reference value
S2Raw sensor reading measured at R2

S1 and S2 must be different. The method assumes that the relationship between the sensor reading and the reference value is approximately linear within the calibrated range.

3. Calibration Procedure

  1. Prepare two stable and accurately known reference values within the intended measurement range.
  2. Set the sensor to the first reference value and wait until the reading is stable. Record this raw reading as S1 and the reference as R1.
  3. Set the sensor to the second reference value and wait until the reading is stable. Record this raw reading as S2 and the reference as R2.
  4. Send the applicable two-point calibration command with the four recorded parameters.
  5. Query the calibration values and verify the result. Recheck the sensor at both reference points after calibration.

4. Commands

Model support and command format: Two-point calibration is model- and firmware-dependent. Confirm that the target model supports this function and verify the exact command format in the corresponding product manual before use.

4.1 Generic Command Format

AT+2pCal=R1,S1,R2,S2

The command configures two-point calibration for the applicable sensor channel.

4.2 PS-LB Commands

The PS-LB software provides separate two-point calibration commands for current and voltage. The final command syntax and parameter units must follow the released PS-LB firmware specification.

Calibration itemCommand
Current calibration2pCal_IDC
Voltage calibration2pCal_VDC
Query calibration valuesSee the released PS-LB command specification

AT commands and downlink commands must be supported where specified by the PS-LB firmware. A query with no calibration configured returns:

0,0,0,0,0,0,0,0

5. Command Example

AT+2pCal=0,120,100,980

In this example:

  • The first reference value is 0, and the measured raw sensor reading is 120.
  • The second reference value is 100, and the measured raw sensor reading is 980.
  • The device uses these two points to calculate calibrated output values for readings within the calibrated range.

6. Notes

  • Use stable reference sources and allow the sensor reading to settle before recording S1 and S2.
  • Do not use identical raw readings for S1 and S2.
  • Use reference points that cover the range in which accurate measurements are required.
  • Calibration values remain active until they are replaced or cleared according to the product firmware specification.
  • Values outside the calibrated range are extrapolated from the same linear curve and may have greater error.
  • After updating calibration, verify the result with an independent reference.

For product-specific command details, refer to the applicable device manual and firmware release notes.