Sensors & Measurement · Study deck
Sensor Processing: Filter Selection and Validation
A vibration filter can remove noise and erase the fault at the same time.
Physics Phoebe is your guide for this deck.

After studying this chapter
Learning objectives
You will be able to:
- Explain: The Mistake: Using a large moving average window (N=32 or N=64 samples) to filter sensor data that changes rapidly, introducing unacceptable lag that makes control systems sluggish or miss transient events entirely.
- Explain: Result: The two-stage filter detects bearing wear threshold crossings within approximately 0.5 seconds (the N=50 averaging window fill time at 100 Hz) while completely rejecting electrical interference spikes.
- Explain: The dry-to-trigger region is the important operating span, so the ±1.5% and ±2.0% errors support a 30% irrigation threshold with more margin than the wetter end.
Major section
Vibration Filter Selection
Scenario: A food processing plant needs to monitor vibration on 12 conveyor belt motors.
- At 100 Hz, a 5-sample window covers 50 ms -- fast enough to preserve real vibration changes.
- Reports stable RMS value for threshold comparison.
- The 10-minute sustained-threshold requirement is evaluated by comparing consecutive 0.5-second RMS averages over a sliding evaluation period.
Major section
Vibration Filter Selection (continued)
Result: The two-stage filter detects bearing wear threshold crossings within approximately 0.5 seconds (the N=50 averaging window fill time at 100 Hz) while completely rejecting electrical interference spikes.
- Key Insight: For vibration monitoring, always use a median filter as the first stage to eliminate electrical spikes.
- A moving average alone will spread spike energy across the window, potentially triggering false bearing-wear alerts.
- The two-stage approach costs negligible additional resources on modern MCUs.
Major section
Sensor Calibration
Filtering removes random noise, but it cannot fix systematic errors built into the sensor itself.
- A sensor that consistently reads 2 degrees too high will still read 2 degrees too high after filtering -- just with less jitter.
- You have cleaned random variation.
- The next failure mode is bias: a value can be stable and still be wrong.
Major section
Sensor Calibration (continued)
The process needs two separated known values because one point cannot distinguish slope error from offset.
- Each error leaves a different pattern, so one calibration or filter cannot repair them all.
- To see how both systematic terms can be estimated, inspect Figure: Two-point calibration process before using the formula.
- This sequence connects calibration arithmetic to evidence that the corrected line works between its endpoints.
Major section
Soil Moisture Calibration
Scenario: You are deploying a soil moisture monitoring system for a greenhouse.
- The capacitive soil moisture sensor outputs an analog voltage (0-3.3V) that varies with soil moisture content.
- However, the raw ADC readings do not correspond to meaningful moisture percentages.
- You need accurate readings to trigger irrigation at 30% moisture.
Major section
Soil Moisture Calibration (continued)
The data points fall closely on the linear model, confirming this sensor has good linearity in the 0-60% range.
- For readings beyond 60% (saturated soil), the linear model extrapolates but accuracy degrades -- use multi-point calibration if the full 0-100% range is needed.
- The dry-to-trigger region is the important operating span, so the ±1.5% and ±2.0% errors support a 30% irrigation threshold with more margin than the wetter end.
- From 40–60%, the ±2.5% result is still accepted for this use, but it should not be silently generalised beyond the highest calibration reference.
Major section
Common Processing Pitfalls
The Mistake: Using a large moving average window (N=32 or N=64 samples) to filter sensor data that changes rapidly, introducing unacceptable lag that makes control systems sluggish or miss transient events entirely.
- For slowly-changing signals (room temperature sampled at 1Hz), a 10-second window works well.
- This works for sensors with linear response and negligible gain error.
- But many sensors are inherently non-linear: thermistors follow the Steinhart-Hart equation (exponential), pH electrodes have temperature-dependent Nernst slope, photodiodes have logarithmic response at high intensity.
Major section
Common Pitfalls
The calibrated sensor can never be more accurate than the reference standard you calibrated against.
- A moving average window that is too large smooths out genuine rapid changes in the measured quantity.
- A temperature spike from a briefly opened oven door may be a real event, not noise.
- Flashing new firmware can erase EEPROM calibration data depending on memory layout.
Deck summary
Key takeaways
Scenario: A food processing plant needs to monitor vibration on 12 conveyor belt motors.
- Result: The two-stage filter detects bearing wear threshold crossings within approximately 0.5 seconds (the N=50 averaging window fill time at 100 Hz) while completely rejecting electrical interference spikes.
- Filtering removes random noise, but it cannot fix systematic errors built into the sensor itself.
- The process needs two separated known values because one point cannot distinguish slope error from offset.
- Scenario: You are deploying a soil moisture monitoring system for a greenhouse.
Retrieval practice
Recall check 1 of 3

Physics Phoebe says: answer from memory, then check your reasoning.
Q1You have a noisy temperature sensor that occasionally produces spike values (e.g., 22C, 23C, 55C, 22C). Which filter is better for removing these spikes?
Show answer
Answer: B The median filter is the best choice for removing spike noise.
Q2Your temperature sensor reads 1.2C in an ice bath (should be 0C) and 98.8C in boiling water (should be 100C). What is the calibration slope?
Show answer
Answer: C
Retrieval practice
Recall check 2 of 3

Physics Phoebe says: answer from memory, then check your reasoning.
Q3Why is regular calibration important for IoT sensors deployed in the field?
Show answer
Answer: D Sensors experience drift over time due to aging, environmental exposure (temperature cycles, humidity, contamination), mechanical stress, and component degradation.
Q4For a moving average filter with window size N=10 sampling at 100Hz, what is the approximate latency introduced?
Show answer
Answer: B A moving average filter introduces a group delay of N/2 samples.
Retrieval practice
Recall check 3 of 3

Physics Phoebe says: answer from memory, then check your reasoning.
Q5Place each data-processing responsibility where it lives so you can preserve measurement meaning from raw samples through a result that an application can safely use.
Show answer
Answer: A Place each data-processing responsibility where it lives so you can preserve measurement meaning from raw samples through a result that an application can safely use.
Q6Complete the moving average filter for sensor data:
Show answer
Answer: A A deque with maxlen automatically drops old values when full, creating a sliding window.
Print reference
Answers 1 of 2
Answer key.
- B · The median filter is the best choice for removing spike noise.
- C
- D · Sensors experience drift over time due to aging, environmental exposure (temperature cycles, humidity, contamination), mechanical stress, and component degradation.
- B · A moving average filter introduces a group delay of N/2 samples.
- A · Place each data-processing responsibility where it lives so you can preserve measurement meaning from raw samples through a result that an application can safely use.
Print reference
Answers 2 of 2
Answer key.
- A · A deque with maxlen automatically drops old values when full, creating a sliding window.