The Mistake: An engineer performs two-point calibration on a soil moisture sensor using reference points at 45% and 55% moisture (only 10% apart). After deployment, the sensor shows large errors at 10% and 90% moisture because small inaccuracies in the closely-spaced reference measurements were amplified across the full range.
Why It Happens: Two-point calibration creates a linear equation (y = mx + b) using two measurements. When those measurements are close together, any small error in the reference measurement or sensor reading gets amplified when extrapolating to values far from the calibration range.
The Math:
Calibration points: 45% and 55%
Assume sensor reads: 450 and 550 (raw ADC values, 0-1000 scale)
Correct calibration:
Gain = (55 - 45) / (550 - 450) = 10 / 100 = 0.1
Offset = 45 - (450 × 0.1) = 45 - 45 = 0
Now imagine a 10 ADC count error at the high point (550 → 560):
Gain = (55 - 45) / (560 - 450) = 10 / 110 = 0.0909
Offset = 45 - (450 × 0.0909) = 45 - 40.91 = 4.09
At 0% moisture (raw ADC = 0):
- Correct calibration: 0 × 0.1 + 0 = 0% ✓
- Wrong calibration: 0 × 0.0909 + 4.09 = 4.1% (error = +4.1%)
At 100% moisture (raw ADC = 1000):
- Correct calibration: 1000 × 0.1 + 0 = 100% ✓
- Wrong calibration: 1000 × 0.0909 + 4.09 = 95.0% (error = -5.0%)
Real Numbers: A 10 ADC count error (1% of full scale) in your reference point, when calibration range is only 100 counts, produces up to 5% error at the measurement extremes. The narrow calibration range acts as a lever arm amplifying tiny reference errors into significant measurement errors.
The Fix: Use calibration points that bracket your expected measurement range with margin:
BAD Practice:
- Greenhouse needs: 20-80% moisture range
- Calibration points: 45% and 55% ❌
- Span: 10% (only 17% of operating range)
GOOD Practice:
- Greenhouse needs: 20-80% moisture range
- Calibration points: 10% and 90% ✓
- Span: 80% (covers 133% of operating range)
Industry Rule of Thumb: Calibration span should be at least 1.2× your measurement range, ideally centered on your operating range. For a 20-80% application, calibrate at 10% and 90%.
Why Wide Span Matters:
- Error division: 10 ADC count error ÷ 800 ADC span = 1.25% relative error in gain (vs 10% relative error with a 100-count span)
- Interpolation not extrapolation: Measuring within calibration range (interpolation) is accurate; measuring outside (extrapolation) magnifies errors
- Sensor non-linearity: Most sensors are most linear in their mid-range; calibrating at extremes captures any non-linearity
Verification Test: After calibration, check several points across the full range: - 0% moisture: Read dry sensor in air - 25% moisture: Use calibrated reference soil - 50% moisture: Half-saturated reference - 75% moisture: Nearly saturated reference - 100% moisture: Fully submerged in water
If errors at 0% and 100% exceed ±2%, your calibration points were too close together.