Try this in the moving-average smoothing and lag lab, where you change the DHT22 temperature and see the delayed average.
1. Start with two kinds of rounding
A sensor system picks moments in time and codes on a value scale. The DHT22 allows one reading every 2 s. The soil ADC stores one of 4,096 codes. A missed fast change is a timing error; a rounded moisture value is a code-size limit.
2. Turn the interval into a Nyquist ceiling
Invert timef_s=1/T=1/2 s=0.500 Hz.
Apply Nyquistf_max=f_s/2=0.250 Hz.
Read the period1/0.250 Hz=4.00 s per fastest full cycle.
Content above that limit can fold into a false slower signal. It does not simply disappear.
3. Turn bits into a moisture step
Count the codes2^12=4,096.
Divide the rangeq=100%/4,096=0.0244% per count.
Find RMS rounding noiseσ_q=q/√12=0.00705%.
Find ideal SNR6.02(12)+1.76=74.0 dB.
4. Compare the STUCK threshold
The chapter flags a 20-reading window when its standard deviation is below 0.01%. The ideal 12-bit floor is 0.00705%, so 0.01/0.00705=1.42. A real live sensor usually has extra noise. An unusually quiet sequence can therefore be evidence of a frozen ADC.
5. Say what averaging changes
For independent random noise, averaging N readings reduces the RMS noise by √N. It does not reconstruct a frequency that already aliased, and it does not revive a stuck code. The fix must match the failure: sample fast enough, use adequate code resolution, or repair the sensor path.
6. Check yourself
What is the sample rate for one reading every 2 s?
What is one count on a 12-bit 0–100% scale?
Can averaging repair aliasing?
These are the chapter inputs, worked results, and named teaching assumptions.
- 2 s interval
- Time, interval, or service-life value
- 12-bit ADC
- Digital resolution or converter setting
- 0–100% scale
- Percentage, ratio, or gain
- 20-reading STUCK window
- Device, payload, or sample count
- 0.01% threshold come from the chapter
- Percentage, ratio, or gain
The 0.500 Hz, 0.250 Hz, 4.00 s, 4,096, 0.0244%, 0.00705%, 1.42×, and 74.0 dB results follow from the displayed formulas. The model does not claim an ideal ADC describes field noise.
Phoebe guides