Sensors & Measurement · Study deck
Sensor Calibration: Measurement Foundations
A sensor can be precise and still report the wrong value.
Physics Phoebe is your guide for this deck.
After studying this chapter
Learning objectives
You will be able to:
- Explain calibration fundamentals: Describe why sensors need calibration and how raw readings differ from true values
- Implement two-point calibration: Calculate offset and gain correction using low and high reference points
- Apply signal conditioning: Configure moving average filtering to reduce noise in sensor readings
- Evaluate raw vs calibrated data: Measure the impact of calibration on measurement accuracy
Major section
Key Concepts
Moving Average Filter: A digital filter replacing each reading with the average of the last N samples, reducing noise at the cost of slower response to rapid changes.
- Reference Standards: Known, accurate values used as the basis for calibration; reference accuracy sets a ceiling on achievable calibration accuracy, while the rest of the measurement chain adds uncertainty.
- Calibration Drift: Gradual change in sensor response over time due to aging, contamination, or thermal stress, requiring periodic recalibration.
Major section
Most Valuable Understanding (MVU)
Every real sensor has manufacturing variations that cause its readings to deviate from the true value.
- Two-point calibration uses two known reference points to calculate correction coefficients that map inaccurate raw readings to accurate calibrated values.
- The formula y = mx + b (from basic algebra) is the foundation - gain is the slope (m) and offset is the y-intercept (b).
Major section
Introduction
In this hands-on lab, you will build a complete sensor calibration system using an ESP32 microcontroller in the Wokwi browser-based simulator.
- You will wire a potentiometer to simulate a sensor with offset and gain errors, implement two-point calibration to correct those errors, and apply a moving average filter for noise reduction.
- The lab takes approximately 45-60 minutes to complete and requires no physical hardware -- everything runs in your browser.
- By the end of this lab, you will have working firmware that interactively captures reference points, calculates calibration coefficients, and applies real-time correction to sensor readings.
Major section
Calibration Matters
Think of calibration like adjusting a musical instrument: Even a brand-new guitar needs to be tuned before it plays the right notes.
- Sensors are similar - they need to be "tuned" to give accurate readings.
- Manufacturing variations: No two sensors are exactly identical, just like no two guitars are perfectly tuned from the factory.
- This lab teaches you how to find those correction values using two known reference points - just like tuning a guitar by comparing it to a tuner at two different notes!
- A tuned note does not prove the sensor is accurate across its full range.
Major section
Calibration Matters (continued)
Environmental factors: Temperature, humidity, and age can cause sensors to drift over time.
- Component tolerances: The electronic parts inside sensors have slight variations.
- The mathematical approach: Instead of just "subtract 2", calibration gives us a formula: corrected = raw × gain + offset.
- Offset fixes constant errors (like always being 2 degrees off).
Major section
Teaching Sensors Truth
Sammy always reads too high - that is an offset error (always adding a constant).
- But notice something: at 10 degrees Sammy is off by 3, and at 25 degrees Sammy is off by 3 too.
- That constant +3 shift is a pure offset error.
- You could fix it by subtracting 3 from every reading.
Major section
Teaching Sensors Truth (continued)
A fixed zero error is only an offset.
- The scale can also stretch the numbers: a gain error changes with the reading, so one subtraction cannot correct both reference points.
- Sammy says "It's 3 degrees!" Oops - that is Sammy's offset error! (0 + 3 = 3).
- Max the Motor adds: "I need calibration too!
Major section
Teaching Sensors Truth (continued)
Sammy says "It's 103 degrees!" Still 3 degrees too high - the offset is consistent! (100 + 3 = 103).
- Lila the Light explains: "It's like being a translator!
- When someone tells me 'go 50% speed', I might actually go 55% without calibration.
- That could make robots bump into walls!".
Major section
Folded Error And Quality Metrics Notes
Offset shifts the whole response by a constant amount, so a zero reference can be wrong even when the slope is usable.
- Gain changes the slope, so error grows as the true value moves away from the reference point.
- These metrics are evidence for the tested range only.
- A two-point calibration should therefore record both reference points, the calculated slope and offset, and at least one verification point between or beyond the references.
- If the reference points are too close together, small reference mistakes can amplify at the extremes, so span and verification evidence matter as much as the equation.
Deck summary
Key takeaways
Moving Average Filter: A digital filter replacing each reading with the average of the last N samples, reducing noise at the cost of slower response to rapid changes.
- Every real sensor has manufacturing variations that cause its readings to deviate from the true value.
- In this hands-on lab, you will build a complete sensor calibration system using an ESP32 microcontroller in the Wokwi browser-based simulator.
- Think of calibration like adjusting a musical instrument: Even a brand-new guitar needs to be tuned before it plays the right notes.
- Environmental factors: Temperature, humidity, and age can cause sensors to drift over time.
Retrieval practice
Recall check 1 of 5

Physics Phoebe says: answer from memory, then check your reasoning.
Q1A raw sensor reads 10 at a true value of 0 and 90 at a true value of 100; which linear correction maps both references?
Show answer
Answer: C The slope is 100/80 and the intercept makes raw 10 map to zero.
Retrieval practice
Recall check 2 of 5

Physics Phoebe says: answer from memory, then check your reasoning.
Q2Noisy readings fluctuate around a stable value; what does a moving average trade for smoother output?
Show answer
Answer: D Averaging several samples smooths changes over time.
Q3Why store calibrated gain and offset in non-volatile memory?
Show answer
Answer: C Non-volatile storage preserves the correction after restart.
Retrieval practice
Recall check 3 of 5

Physics Phoebe says: answer from memory, then check your reasoning.
Q4The calibration lab has both systematic error and noisy readings. Which operation specifically targets the random variation?
Show answer
Answer: A The introduction assigns noise reduction to averaging and offset/gain correction to calibration.
Retrieval practice
Recall check 4 of 5

Physics Phoebe says: answer from memory, then check your reasoning.
Q5At a separate true reference of 50, a sensor reads 54 raw and 51 after calibration; how did absolute error change?
Show answer
Answer: C Comparing both readings with 50 shows the corrected value is closer.
Retrieval practice
Recall check 5 of 5

Physics Phoebe says: answer from memory, then check your reasoning.
Q6A thermometer reads a constant amount too hot across the tested range. Which calibration term addresses that pattern?
Show answer
Answer: C The chapter distinguishes a constant error from a gain or scaling error.
Print reference
Answers
Answer key.
- C · The slope is 100/80 and the intercept makes raw 10 map to zero.
- D · Averaging several samples smooths changes over time.
- C · Non-volatile storage preserves the correction after restart.
- A · The introduction assigns noise reduction to averaging and offset/gain correction to calibration.
- C · Comparing both readings with 50 shows the corrected value is closer.
- C · The chapter distinguishes a constant error from a gain or scaling error.