Rangefinders: Distance by Stopwatch
Ultrasonic and laser rangefinders play the same trick — shout, listen, halve the round trip. The differences that matter are the width of the shout and what the wall is made of.
Builds on: 0.1 Sense, Think, Act: What Makes a Robot
Same idea, other course:Vector: the speed of sound, measured by echo
The stopwatch trick
Send a pulse, start a timer, catch the reflection, stop. The pulse travelled out and back, so:
An ultrasonic ranger does it with a chirp of sound at v ≈ 343 m/s: a wall 1 m away answers in about 6 ms — leisurely time for a microcontroller. A time-of-flight sensor does it with light at 300,000,000 m/s, where the same wall answers in 6.7 nanoseconds — which is why ToF sensors need clever timing silicon, and why they cost more.
The cone is the catch
The sound chirp spreads as it travels — a cone of 15° or more. The sensor reports the nearest echo from anywhere inside that cone: a chair leg half a metre to the side reads as an obstacle dead ahead. The laser stays a pencil-thin line and measures what you actually pointed it at. Width is the deep difference between the two — not price, not precision.
Materials play favourites, each sensor its own: sound bounces off hard surfaces but is swallowed by curtains, foam and thick sweaters — soft rooms are sonically dark. Light bounces off almost everything but comes back weak from black velvet, or from glass, which reflects the beam away like a mirror unless hit square. Every rangefinder has a material that makes it lie.
From one beam to a picture
One rangefinder gives a number. Spin one on a turret and you get hundreds of numbers a revolution — a floor plan drawn in polar coordinates. That is all a lidar is, and it is the sensor behind every robot-vacuum map in Unit 5. Keep the humble formula in mind when the maps arrive: each pixel of them is one stopwatch click.
A camera sees everything and measures nothing: one image, by itself, does not contain distance. Rangefinders are the opposite — nearly blind, but every reading is a measurement. Real robots carry both and let each answer the question it is good at.
⚗️ Lab — The Echo Chamber
An ultrasonic cone and a laser beam aimed down the same corridor, with a movable target you can also re-upholster.
- Slide the target and watch both sensors track it — and watch the ping’s round trip tick by in milliseconds vs nanoseconds.
- Move the side obstacle into the sound cone: the ultrasonic reading jumps to the nearer object while the laser stays honest.
- Switch the target from plywood to curtain, then to glass — find which sensor each material blinds.
Work it by hand — 0 / 2
No multiple choice here: compute the value and type it. Suffixes like 2.5k or 20m are understood; answers within ±3% count.