Calculation of the distance:
distance = speed of sound * duration
the speed of sound is 343,4 m/s or 0,0343 cm/microsecond to the Temperature of 20°C.
distance = 0,0343 * duration
we divide for 2 because the duration is the time spent from ultrasonic signal to sending and returning:
distance = 0,0343 * duration/2
but:
0,0343/2 = 0,01715 = 1/58,31
then:
distance = duration/58,31