Sonar: distance by echo
Your phone clicks and listens for the echo: the delay gives the distance to a wall, like a bat.
Press Start and allow the microphone, face a large wall in a quiet room, raise the volume and press Ping.
Readings are processed on your device only: nothing is recorded or sent unless you export it.
- Distance (median)
- —
- Echo delay
- —
- Echo strength
- —
- Measurements
- —
Press Start, then Ping.
Works best 1 to 10 m from a large hard surface. Each ping is a 4 ms sweep from 2 to 9 kHz.
Runs entirely in your browser. Your files never leave your device.
About this tool
Bats, dolphins and submarines find obstacles by listening to echoes. Your phone can do it too: it plays a very short sweep through its speakers, records with its microphone, and looks for the reflection that comes back from a wall. Sound travels about 343 metres per second at room temperature, so a delay of 10 milliseconds means the wall is 1.7 metres away, half of the round trip.
Stand facing a large flat wall, in a quiet room, between about 1 and 10 metres away, and press Ping several times: the page keeps the median of the measurements. Set the air temperature for a more precise speed of sound. It is an experiment rather than a tape measure, and furniture and corners also send echoes back.
How it works
- Press Start and allow the microphone.
- Point the bottom of the phone at a wall, in a quiet room.
- Press Ping a few times.
- Read the median distance.
Distance = speed of sound × delay ÷ 2, with c = 331.3 × √(1 + T / 273.15) m/s. The recording is compared with the sweep (matched filter), so each arrival becomes a sharp peak. Strong peaks are the direct sound, one per speaker; the echo is the strongest clear peak after them.
Worked example
Stand 2.5 m from a large flat wall in a quiet room and press Ping several times. The echo comes back after about 14.6 ms, and half of that round trip at 343 m/s gives 2.5 m. The median of five pings is usually within a few centimetres.
Set the room temperature: at 30 °C sound travels at about 349 m/s, which shifts the result by nearly 2 %.
Good to know
- Face a bare wall; furniture, curtains and corners send their own echoes.
- Keep the room quiet and hold the phone still while it listens.
- Below about 1 m the echo overlaps the outgoing sound and cannot be separated.