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:
- Apply the first known reference value and record the corresponding raw sensor reading.
- Apply the second known reference value and record the corresponding raw sensor reading.
- Store the two pairs of values in the device.
- 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:
| Parameter | Description |
|---|---|
x | Current raw sensor reading |
y | Calibrated output value |
R1 | First known reference value |
S1 | Raw sensor reading measured at R1 |
R2 | Second known reference value |
S2 | Raw 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
- Prepare two stable and accurately known reference values within the intended measurement range.
- Set the sensor to the first reference value and wait until the reading is stable. Record this raw reading as
S1and the reference asR1. - Set the sensor to the second reference value and wait until the reading is stable. Record this raw reading as
S2and the reference asR2. - Send the applicable two-point calibration command with the four recorded parameters.
- 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 item | Command |
|---|---|
| Current calibration | 2pCal_IDC |
| Voltage calibration | 2pCal_VDC |
| Query calibration values | See 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 is120. - The second reference value is
100, and the measured raw sensor reading is980. - 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
S1andS2. - Do not use identical raw readings for
S1andS2. - 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.