Ultrasonic Distance Measurement Calculator

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

Loading calculator…

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

SymbolMeaning
dDistance to target (m)
tRound-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

SymbolDefault unitAccepted units
Distancecmmm, cm, m, km
Round-Trip Timeµsps, ns, µs, ms, s, min, h

Worked examples

GivenResult
Minimum rangeRound-Trip Time 100 nsDistance = 0.01715 mm
Low rangeRound-Trip Time 1 µsDistance = 0.1715 mm
TypicalRound-Trip Time 100 µsDistance = 1.715 cm
High rangeRound-Trip Time 0.5 msDistance = 8.575 cm
Maximum rangeRound-Trip Time 5 msDistance = 0.8575 m

Solving for each variable

Solve for GivenResult
DistanceRound-Trip Time 100 ns0.01715 mm
Round-Trip TimeDistance 1 mm5.831 µs

How Distance changes with Round-Trip Time

Round-Trip Time (input)Distance (result)
10 µs1.715 mm
25 µs4.288 mm
50 µs8.575 mm
75 µs12.86 mm
100 µs1.715 cm
150 µs2.573 cm
0.2 ms3.43 cm
0.4 ms6.86 cm
0.7 ms12.01 cm
1 ms17.15 cm

The same result in other units

UnitValue
mm17.15
cm1.715
m0.01715

Embed this calculator

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

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.

What does d mean in the Ultrasonic Distance Measurement formula?

d is Distance to target (m).

What should I watch out for when using Ultrasonic Distance Measurement?

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%).