A field team faces an unresolved physical question: When does delay(250) make a real event disappear? They must answer it before changing sample rate on the real device. Predict the direction first.
See the relationship before changing it
The figure reads from left to right. The blue card is sample rate. The middle card applies this page's relationship. The green card is nyquist ceiling. Walk the arrows once: set the input, apply the rule, then read the result with its unit.
The retained audit below checks several chapter fixtures. This added model holds every other chapter fixture fixed, so the numeric fixture does not switch without explanation.
Derive the baseline in four named moves
- 1
Name the input. The chapter baseline for sample rate is 250.
- 2
Name the relationship. f s =1000/250=4.0 Hz f max =4/2=2.0 Hz button requirement=2/0.100=20 Hz required interval=1000/20=50 ms ADC step=3.3/4096=0.806 mV LM35 step=0.806/10=0.0806 °C
- 3
Substitute the chapter fixture. Set sample rate to 250. The page ledger gives nyquist ceiling as 2.00 Hz.
- 4
Read the result. Keep Hz beside the value. Use it only inside the technical boundary on this page.
Predict, then change sample rate
Try Predict the direction of nyquist ceiling. Move one control, calculate, then check your prediction.
Observe Scheduling controls whether the input is observed; converter resolution controls how finely an observed voltage is represented. Reset the control to 250 and compare nyquist ceiling.
Explain Only sample rate moves here. The other chapter fixtures remain fixed.
Check yourself
What should you do before trusting a moved-control result?
What does this small model leave out?
1. Start with time between observations
A polling loop can see the input only when it checks. A 250 ms delay means four checks each second. Slow room temperature changes easily fit inside that schedule. A 100 ms button press can begin and end between checks, so the same loop can miss it completely.
2. Name every algebra move
Convert milliseconds to ratefs=1000/Tms.
Find the Nyquist ceilingfmax=fs/2.
Set the event requirementA duration τ starts at fs≥2/τ in this teaching rule.
Invert rate to intervalT=1/fs.
Convert ADC volts to temperatureDivide voltage step by the LM35 slope.
3. Reproduce the chapter case
fmax=4/2=2.0 Hz
button requirement=2/0.100=20 Hz
required interval=1000/20=50 ms
ADC step=3.3/4096=0.806 mV
LM35 step=0.806/10=0.0806 °C
The 250 ms loop is five times slower than the 50 ms teaching requirement for the short event. Its ADC resolution is already fine for the LM35 example; timing, not voltage resolution, is the risk being exposed.
4. Try the polling interval
TryMove the loop interval while the 100 ms event and ADC stay fixed.
ObserveAt 50 ms the simple event requirement reaches 20 Hz. Changing the loop interval does not change the ADC voltage or temperature step.
ExplainScheduling controls whether the input is observed; converter resolution controls how finely an observed voltage is represented.
This is a regular-sampling teaching comparison, not a guarantee that polling catches every asynchronous pulse.
- Event capture
- Pulse phase, jitter, bounce, execution time, interrupts, and hardware latching affect guarantees
- Nyquist use
- A one-off button pulse is not a band-limited sinusoid; the 2/τ rule is a conservative runway here
- ADC result
- Reference error, noise, calibration, and LM35 accuracy exceed a simple code step
Measure worst-case loop time and use interrupt or latch hardware when missing an event is unsafe.
5. Choose the timing mechanism
Use elapsed-time scheduling when several slow tasks need turns without blocking each other. Use an interrupt or hardware capture path for short, important events. Keep the interrupt handler small and move slow work back into the main loop.
6. Record the evidence state
Store the event width, polling interval, maximum loop time, interrupt setup, debounce rule, ADC reference, bit depth, sensor slope, raw codes, firmware version, and a trace showing both caught and deliberately stressed events.
7. Check yourself
Why does 250 ms mean 4 Hz?
Why is the teaching interval 50 ms for a 100 ms event?
Does a 0.0806 °C code step prove that temperature readings are that accurate?
The arithmetic reproduces the chapter's 250 ms, 100 ms, 3.3 V, 12-bit, and LM35 values.
- 4.0 Hz
- The nominal loop rate before other work and jitter
- 50 ms
- A teaching interval, not a universal pulse-capture guarantee
- 0.0806 °C
- An ideal code step, not temperature accuracy
Correct, not complete: this ledger does not replace measured worst-case timing or a proper event-capture design.
Voltage Vera guides