SLAA941 March 2020 TUSS4440 , TUSS4470
To convert time-of-flight to distance, use velocity = distance/time. More specific to ultrasonic time-of-flight to distance, use velocitysound = distanceto_object / timeof_flight_one_way for one-way measurements, and velocitysound = distanceto_object / (timeof_flight_round_trip / 2) for round-trip measurements. Note that the speed of sound varies as a function of transmission medium density and temperature, so TI recommends to use an external temperature sensor to measure ambient temperature to calibrate the speed of sound variable when converting time-of-flight to distance.
For example: If the time-of-flight for a round-trip measurement is 30ms, and the transmission medium is air at room temperature, then distance is calculated as shown in Equation 1.