Tricky Circuit

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.

Open interactive experiment

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.

Open laboratory in a full window

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

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

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

  1. unchanged
  2. half as large
  3. 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.

ti.com

Temu affiliate offers

Find your next electronics project

Explore these do-it-yourself project kits. Check the selected option, included parts and instructions on each offer.

Tricky Circuit may earn a commission if you buy through these Temu affiliate links. These are product ideas; they have not been bench-tested by Tricky Circuit and are not verified lesson parts lists.

Supplier photo of an assembled infinity mirror light cube illuminated on a dark background.

Supplier product photo

Build an infinity light cube

Listing specifies 5-volt direct current. Soldering required; battery and glue not included.

View kit on Temu

Supplier photo of a breadboard, jumper wires and assorted electronic components in a plastic storage case.

Supplier product photo

Try breadboard experiments

Breadboard, wires and assorted parts. Arduino controller board not included.

View kit on Temu

Supplier photo of an assembled blue surface-mount soldering practice board with a circular ring of small lights.

Supplier product photo

Solder a chasing-light board

Surface-mount soldering practice. Battery and battery holder not included.

View kit on Temu