Ultrasonic Distance Measurement

d = v × t / 2

Quick answer

This calculator solves d = v_sound × t / 2, v_sound ≈ 343 m/s at 20°C for Distance. With Round-Trip Time 100 µs, the result is 1.715 cm. It solves in 2 directions, so you can enter the values you have and get the one you need.

Calculator

Distance (cm)
—

Formula

d = v_sound × t / 2, v_sound ≈ 343 m/s at 20°C

Description

Ultrasonic distance sensors measure the time for a sound pulse to travel to a target and return (echo). Since the sound travels to the target and back, the one-way distance is half the round-trip time multiplied by the speed of sound. The speed of sound in air at 20°C is approximately 343 m/s (0.0343 cm/µs). Temperature affects the speed of sound significantly: v ≈ 331.3 + 0.606 × T(°C) m/s. Common ultrasonic sensors like HC-SR04 measure distances from 2 cm to 400 cm with ±3 mm accuracy.

Variables

  • d — Distance to target (m)
  • t — Round-trip echo time (s)

Practical Notes

At 20°C, sound travels about 0.343 mm/µs or 34.3 cm/ms. A target at 1 m distance produces a round-trip time of 2/343 ≈ 5.83 ms. The minimum detectable distance is limited by the transmit pulse duration (typically 0.3-1 ms, corresponding to 5-17 cm minimum range). Maximum range is limited by signal attenuation and beam spreading. Temperature compensation improves accuracy: at 0°C, v = 331 m/s (−3.5%); at 40°C, v = 355 m/s (+3.5%).

Symbols and units

Symbol Meaning Default unit Accepted units
d Distance cm mm, cm, m, km
t Round-Trip Time µs ps, ns, µs, ms, s, min, h

Step by step

  1. 1. What you know: Round-Trip Time 100 µs
  2. 2. The relation: d = v_sound × t / 2, v_sound ≈ 343 m/s at 20°C
  3. 3. Substitute: t = 100 µs
  4. 4. Result: Distance = 1.715 cm

Worked examples

Minimum range

Given: Round-Trip Time 100 ns

Result: Distance = 0.01715 mm

Low range

Given: Round-Trip Time 1 µs

Result: Distance = 0.1715 mm

Typical

Given: Round-Trip Time 100 µs

Result: Distance = 1.715 cm

High range

Given: Round-Trip Time 0.5 ms

Result: Distance = 8.575 cm

Maximum range

Given: Round-Trip Time 5 ms

Result: Distance = 0.8575 m

Solving for each variable

Solve for Distance

Round-Trip Time 100 ns → 0.01715 mm

Solve for Round-Trip Time

Distance 1 mm → 5.831 µs

How Distance changes with Round-Trip Time

Round-Trip Time (input) Distance (result)
10 µs 1.715 mm
25 µs 4.288 mm
50 µs 8.575 mm
75 µs 12.86 mm
100 µs 1.715 cm
150 µs 2.573 cm
0.2 ms 3.43 cm
0.4 ms 6.86 cm
0.7 ms 12.01 cm
1 ms 17.15 cm

The same result in other units

Unit Value
mm 17.15
cm 1.715
m 0.01715

Embed this calculator

Paste this into any page. It keeps working when this page updates, and credits the source.

<iframe src="https://vbatpower.com/embed/ultrasonic-distance/" width="100%" height="460" style="border:1px solid #1f2a37;border-radius:12px" loading="lazy" title="Ultrasonic Distance Measurement"></iframe>
<p><a href="https://vbatpower.com/formulas/ultrasonic-distance/">Ultrasonic Distance Measurement</a> Calculator by vbatpower.com</p>

Frequently asked questions

How do you calculate Ultrasonic Distance Measurement?

Use d = v_sound × t / 2, v_sound ≈ 343 m/s at 20°C. With Round-Trip Time 100 µs, Distance works out to 1.715 cm.

What is the formula for Ultrasonic Distance Measurement?

The formula is d = v_sound × t / 2, v_sound ≈ 343 m/s at 20°C. Ultrasonic distance sensors measure the time for a sound pulse to travel to a target and return (echo).

How do you find Round-Trip Time when you know the other values?

Rearrange for Round-Trip Time: with Distance 1 mm, Round-Trip Time is 5.831 µs.

What units does Ultrasonic Distance Measurement use?

Distance is shown in mm, cm, m. Values are held in SI base units internally, so you can mix prefixes without converting by hand.