Ultrasonic time of flight
Measure with an echo
Ultrasonic means sound above normal human hearing. An echo is sound reflected back from an object. TOF means Time of Flight, the time a wave takes to travel. Here the chosen echo time includes the outward and return trips.
EXPERIMENT BENCH
Change the circuit settings, predict the readings, then check a challenge. These are learning models, with the assumptions explained in each lesson.
Sign in to save progress. Guest progress stays on this device.
How it works
Dry-air speed approximation for the selected 0–40 °C temperature. Choose a valid round-trip echo; this model does not detect obstacles, false echoes, humidity or air gradients. It is a calculation, not a live sensor.
T is air temperature in degrees Celsius, c sound speed, t round-trip time in seconds. c = 331.3 + 0.606T. Distance = c × t/2: halve the journey because the echo travels there and back. 1 ms is 0.001 s. Multiply metres by 100 for centimetres.
Difficulty
Build · Observe
Power on at 20 °C and echo time 2 ms. Find 343.42 m/s and 34.342 cm.
Need a hint?
T=20 °C; t=2 ms → c=343.42 m/s; d=34.342 cm
Explore · Explore
Keep echo 2 ms and choose 0 °C. Find 331.3 m/s and 33.13 cm.
Need a hint?
T=0 °C; t=2 ms → c=331.3 m/s; d=33.13 cm
Solve it · Solve
Choose 40 °C and echo 10 ms. Find 355.54 m/s and 177.77 cm.
Need a hint?
T=40 °C; t=10 ms → c=355.54 m/s; d=177.77 cm
Extra reading and circuit recipes
Ultrasonic time of flight
A short wait can become a ruler. The selected echo time is like hearing a clap reflected from a wall, except ultrasonic hardware uses a sound frequency people normally cannot hear. A real receiver must still decide which reflection is the useful one.
c = 331.3 + 0.606T; d = c × (t/1000)/2 × 100 cm; t [ms], T [°C]
The delay encodes path length, not object size. Temperature changes the conversion from time to distance; it does not make the selected echo a measured temperature or resolve competing reflections.
A useful connection
At fixed temperature, twice the round-trip echo time means twice the distance.
Beyond the model
At the same measured time, warmer air gives a larger inferred distance in this model.
A useful trap to avoid
The time is already round-trip. Forgetting /2 doubles the answer. The linear temperature fit is an approximation, not a precision guarantee across all air conditions.
At the same temperature, echo time doubles. Distance becomes…
- unchanged
- half as large
- twice as large
Read more
Speed stays fixed, so distance follows time directly; /2 is present in both calculations.
A nearby return
Choose 20 °C and 2 ms.
Distance 34.342 cm.
A longer warm-air return
Choose 40 °C and 10 ms.
Distance 177.77 cm.
Try another change
At 20 °C compare 1, 2 and 4 ms. Predict 17.171, 34.342 and 68.684 cm before moving the control.