TryHold Echo duration (µs) at 1750 and raise Temperature (°C) from 20. Compare the calculated distance with the fixed-speed result.
ObserveAt the opening settings, sound speed displays as 343.4 m/s and distance as 30.0 cm. The compensated result differs from the fixed-speed estimate by +0.04 cm.
ExplainTemperature (°C) sets sound speed to 331.3 plus 0.606 times temperature; Echo duration (µs) times that speed, converted to cm per microsecond, is halved for one-way distance.
Technical boundaries. The calculation assumes a round-trip echo and temperature-dependent sound speed, without humidity, target geometry or timing noise. Only the distance bar is capped at 400 cm; numeric distance remains uncapped, with warnings above 400 cm and below 2 cm.
NoteTry It: Ultrasonic Distance Calculator
Adjust the echo pulse duration and ambient temperature to see how they affect the calculated distance. Notice how temperature changes the speed of sound and therefore the distance measurement.