Loading Abhiram Reddy Palle

→The labLab 04 / 10 · Distance experiment

ExperimentHC-SR04

Ultrasonic ranging

Ping. Listen. Do the maths on the echo.

The story, in 3 stages

  1. 01Ping
  2. 02Echo
  3. 03Distance

(01)The instrument

HC-SR04 · 40 kHzSimulated
120 cm

d = echo time × 343 m/s ÷ 2 — the sound goes there and back. Slowed down enormously so you can see it.

Round trip7.00 ms
Light would take8.01 ns
Speed ratio×874,030
Range2–400 cm

A simulation of how the part behaves — not a recording of mine. Bench photos go in the evidence below.

(02)Ping → Echo → Distance

  1. 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.

  2. 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.

  3. 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

The HC-SR04Fig. 01

Related on the bench

Next on the bench — 05 / 10Distance experimentLaser time-of-flight→The same question as sonar, answered with light.