Echolocation with HC-SR04 ultrasonic distance sensor

Ultrasonic echolocation is common practice in many areas, including nature itself. We all know how bats or dolphins navigate – they emit ultrasonic waves, and depending on the time delay of reflected echoes, they can determine the distance from obstacles or catch. From an engineering perspective, it is relatively easy to measure distances with ultrasound – all you need to know is sound speed in the air and time delay between sent and received pulses. L is the measured distance; CAIR – ultrasound speed; t – the time between transmitted and received pulses. The accuracy of measured distance mainly depends on air temperature. The following formula can calculate sound speed in the air approximately : For instance, at 25ºC, the speed of sound in dry air CAIR = 346.13 m/s. If you want greater accuracy, you should also measure temperature to adjust sound speed.

Continue reading