Sensors & Measurement · Study deck

Sensor Calibration: Math and Validation

A calibration equation is a rule for correcting a sensor reading.

Physics Phoebe is your guide for this deck.

sensorcalibration
iotclass.org

After studying this chapter

Learning objectives

You will be able to:

  • Explain: To consolidate the lab into a repeatable workflow, inspect Figure: Mind map of key sensor calibration concepts covered before moving from calculation to field use.
  • Explain: Automatic Baseline Correction (ABC) can compensate by assuming the sensor occasionally sees a known reference (e.g., CO2 sensors assume 400ppm outdoor air).
  • Explain: That order shows why a fitted gain and offset are only useful when their reference conditions, residual error, and recalibration trigger remain recorded.
  • Explain: With a 12-bit ADC (4096 levels) spanning the full 50 kg range, theoretical resolution would be 50/4096 = 12.2 g.
iotclass.org

Major section

Putting Numbers to It

With a 12-bit ADC (4096 levels) spanning the full 50 kg range, theoretical resolution would be 50/4096 = 12.2 g.

  • Adjusting amplification to use more of the ADC range would improve resolution.
  • Explore how ADC bit depth and measurement range affect the smallest detectable change (resolution per count).
iotclass.org

Major section

Checkpoint: Calibration Math

The window size (N) controls the tradeoff between smoothing and responsiveness.

  • Larger windows produce smoother output but react more slowly to real changes.
  • Background: Sensors drift over time due to aging, temperature changes, and contamination.
iotclass.org

Major section

Automatic Drift Compensation

Automatic Baseline Correction (ABC) can compensate by assuming the sensor occasionally sees a known reference (e.g., CO2 sensors assume 400ppm outdoor air).

  • To consolidate the lab into a repeatable workflow, inspect Figure: Mind map of key sensor calibration concepts covered before moving from calculation to field use.
  • The map connects error types, calibration methods, validation, and maintenance so none is mistaken for the whole job.
iotclass.org

Major section

Key Calibration Concepts Summary

That order shows why a fitted gain and offset are only useful when their reference conditions, residual error, and recalibration trigger remain recorded.

  • The core lab above shows how to build and store a two-point calibration.
  • The companion page focuses on the failure modes that determine whether those coefficients are trustworthy in production.
Mind map of key sensor calibration concepts covered in this lab
Mind map of key sensor calibration concepts covered in this lab
iotclass.org

Deck summary

Key takeaways

With a 12-bit ADC (4096 levels) spanning the full 50 kg range, theoretical resolution would be 50/4096 = 12.2 g.

  • The window size (N) controls the tradeoff between smoothing and responsiveness.
  • Automatic Baseline Correction (ABC) can compensate by assuming the sensor occasionally sees a known reference (e.g., CO2 sensors assume 400ppm outdoor air).
  • That order shows why a fitted gain and offset are only useful when their reference conditions, residual error, and recalibration trigger remain recorded.
iotclass.org

Retrieval practice

Recall check 1 of 4

Physics Phoebe says: answer from memory, then check your reasoning.

Q1A corrected mass reading is 22 kg against a 20 kg reference. The allowed relative error is 5%. Does it pass?

AYes, because any corrected reading passes by definition.
BYes, because the mass difference is small.
CNo; the absolute error is 2 kg and the relative error is 10%.
DNo, because calibration must always return the exact reference.
Show answer

Answer: C |22 kg − 20 kg| = 2 kg; 2 kg / 20 kg × 100% = 10%, above the 5% limit.

Q2A sensor reads 20% when the true value is 10%, and reads 80% when the true value is 90%. What is the gain (slope) coefficient?

A0.75
B1.0
C1.33
D4.0
Show answer

Answer: C

iotclass.org

Retrieval practice

Recall check 2 of 4

Physics Phoebe says: answer from memory, then check your reasoning.

Q3In the lab code, why is the moving average filter applied BEFORE calibration, not after?

AIt's faster to filter first
BIt stabilizes the captured reference readings
CCalibration doesn't work on filtered data
DIt doesn't matter - the order is arbitrary
Show answer

Answer: B B) Filtering removes noise that would cause incorrect calibration captures When capturing reference points (pressing ‘l’ or ‘h’), you want a stable, accurate reading - not a noisy instantaneous sample.

Q4Why does automatic baseline correction (ABC) track the MINIMUM reading over 24 hours, rather than the average or maximum?

AMinimum values are more accurate
BIt expects periodic exposure to the baseline
CMaximum values consume too much memory
DAverages can't be stored in EEPROM
Show answer

Answer: B see answers page

iotclass.org

Retrieval practice

Recall check 3 of 4

Physics Phoebe says: answer from memory, then check your reasoning.

Q5You need to calibrate a soil moisture sensor that will measure between 20% and 80% moisture in a greenhouse. Which reference points should you use?

A0% and 100% (full range)
B50% and 60% (middle of expected range)
C15% and 85% (bracketing the expected range)
D20% and 80% (exact boundaries of expected range)
Show answer

Answer: C C) 15% and 85% (bracketing the expected range) You want reference points that bracket (surround) your expected measurement range, but with some margin.

iotclass.org

Retrieval practice

Recall check 4 of 4

Physics Phoebe says: answer from memory, then check your reasoning.

Q6A deployed outdoor temperature sensor gradually reads 1.5C above a traceable reference after 6 months. Checks with a known electrical input show the ADC and wiring path remain stable. What is the most likely cause and next step?

AThe ADC resolution degraded over time and needs replacement
BThe sensor wiring corroded and needs resoldering
CThe microcontroller firmware has a memory leak causing numerical errors
DThe sensor has drifted due to aging and environmental exposure.
Show answer

Answer: D A stable electrical path plus a verified reference makes sensor-element drift the leading explanation for a growing offset.

iotclass.org

Print reference

Answers 1 of 3

Answer key.

  1. C · |22 kg − 20 kg| = 2 kg; 2 kg / 20 kg × 100% = 10%, above the 5% limit.
  2. C
  3. B · B) Filtering removes noise that would cause incorrect calibration captures When capturing reference points (pressing ‘l’ or ‘h’), you want a stable, accurate reading - not a noisy instantaneous sample.
iotclass.org

Print reference

Answers 2 of 3

Answer key.

  1. B · B) The sensor assumes it occasionally sees the baseline/reference condition For sensors like CO2 monitors, ABC assumes the sensor is exposed to “fresh air” (baseline ~400ppm) at least once during the 24-hour period - typically overnight when the room is empty.
  2. C · C) 15% and 85% (bracketing the expected range) You want reference points that bracket (surround) your expected measurement range, but with some margin.
iotclass.org

Print reference

Answers 3 of 3

Answer key.

  1. D · A stable electrical path plus a verified reference makes sensor-element drift the leading explanation for a growing offset.
iotclass.org