ExperimentHC-SR04
Ultrasonic ranging
Ping. Listen. Do the maths on the echo.
The story, in 3 stages
- 01Ping
- 02Echo
- 03Distance
(01)The instrument
d = echo time × 343 m/s ÷ 2 — the sound goes there and back. Slowed down enormously so you can see it.
A simulation of how the part behaves — not a recording of mine. Bench photos go in the evidence below.
(02)Ping → Echo → Distance
- 01 · Ping→
A shout you can't hear
Give the HC-SR04's trigger pin a short pulse and it fires a burst of 40 kHz sound — far above anything you can hear.
- 02 · Echo→
The width of a pulse
Its echo pin stays high for exactly as long as the sound takes to bounce back. That pulse width is the entire measurement.
- 03 · Distance■
Divide by two
Sound travels about 343 metres a second. Distance = echo time × 343 m/s ÷ 2 — halved because the sound went there and back. Good for roughly 2 to 400 cm.
(03)On my bench
What I actually did with it
- 01Used for distance on the bench
[ADD — what you measured, and on which board]
(04)Evidence
Related on the bench