Ultrasonic Sensor: How Robots Measure Distance With Sound
A robot sends out a burst of sound you cannot hear, waits for the echo, and turns the waiting time into distance.
Wall at 1.5 m → echo comes back after 8.7 ms. The robot divides that time by two, then multiplies by the speed of sound (343 m/s).
An ultrasonic sensor sends a very short burst of high-pitched sound, far above what people can hear. The sound hits an object and bounces back. The sensor measures how long that round trip took.
Sound travels at about 343 metres per second in room-temperature air. Distance equals speed times time, divided by two, because the sound went there and back.
A small robot can stop before a wall, keep a steady gap behind a person, or park itself, for just a few dollars of hardware.
The robot would only learn about a wall by crashing into it. Bumpers help, but they react after the hit.
Soft materials like curtains absorb sound, and sloped surfaces bounce it away, so the echo can be weak or missing.
Why does the robot divide the echo time by two?