The Light and Proximity Numbers
Ada re-derives this chapter’s own numbers step by step, at full precision
ADA · CALCULATION AUDIT
The Light and Proximity Numbers
Divider voltage, time of flight, and temperature error, ~4 minutes
The sensor reading only becomes trustworthy after the physics unit is explicit: volts for the divider, metres for an echo, nanoseconds for optical timing, and centimetres of error when air temperature changes.
A lab notebook records a threshold of 1800 ADC counts and an ultrasonic echo of 5.83 ms that the chapter turns into a 1.00 m reading using 343 m/s, while light itself needs only 6.67 ns to cover that same 1 m round trip. The same page warns that at 0°C, sound closer to 331 m/s makes the 343 m/s formula overestimate a 2.0 m target by roughly 7 cm. This audit asks the question those numbers invite: once volts, metres, nanoseconds, and temperature are all made explicit, do the divider and time-of-flight calculations actually hold up?
Companion to the chapter Light and Proximity Readout Physics — every number here comes from that chapter.
The checks from the chapter values
| Check | Arithmetic from the chapter values | Review result |
|---|---|---|
| Photodiode front-end | Vout = Iphoto * Rf = 0.000001 A * 1,000,000 ohm = 1.000000 V. |
A 1 microamp photocurrent becomes a readable 1.0 V ADC input. |
| LDR divider | Vbright = 3.3 * 10 / (3 + 10) = 33 / 13 = 2.538461538 V; Vdim = 3.3 * 10 / (60 + 10) = 33 / 70 = 0.471428571 V. |
The rounded values are 2.54 V and 0.47 V, so this divider orientation falls as darkness raises the LDR resistance. |
| Ultrasonic echo | distance = 343 m/s * 0.00583 s / 2 = 0.999845 m. |
The displayed 1.00 m result is the final rounded value after the round-trip divide-by-two. |
| Optical time of flight | round trip = 2 m / 300,000,000 m/s = 0.000000006666... s = 6.666... ns. |
The 6.67 ns result explains why optical ranging needs dedicated timing hardware. |
| Cold-air distance error | For a true 2.0 m target at 0 °C: echo time = 4 / 331 = 0.012084592 s; using 343 m/s gives 343 * 0.012084592 / 2 = 2.072508 m. |
The overestimate is 2.072508 - 2.0 = 0.072508 m, or about 7.3 cm. |
What the audit buys you: thresholds become portable only when the unit, divider orientation, propagation speed, and rounding step are visible. A count-only threshold hides the physics; a short arithmetic trail makes the lab repeatable.
Every number above is taken from the chapter’s own light and proximity examples and re-derived step by step.