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
| Symbol | Meaning |
|---|---|
| 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 | Default unit | Accepted units |
|---|---|---|
| Distance | cm | mm, cm, m, km |
| Round-Trip Time | µs | ps, ns, µs, ms, s, min, h |
Worked examples
| Given | Result | |
|---|---|---|
| Minimum range | Round-Trip Time 100 ns | Distance = 0.01715 mm |
| Low range | Round-Trip Time 1 µs | Distance = 0.1715 mm |
| Typical | Round-Trip Time 100 µs | Distance = 1.715 cm |
| High range | Round-Trip Time 0.5 ms | Distance = 8.575 cm |
| Maximum range | Round-Trip Time 5 ms | Distance = 0.8575 m |
Solving for each variable
| Solve for | Given | Result |
|---|---|---|
| Distance | Round-Trip Time 100 ns | 0.01715 mm |
| 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.
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%).