The ultrasonic sensor works on the principle of SONAR and RADAR system which is used to determine the distance to an object.
An ultrasonic sensor generates the high-frequency sound (ultrasound) waves. When this ultrasound hits the object, it reflects as echo which is sensed by the receiver as shown in below figure.
Using IO trigger for at least 10us high level signal.The Module automatically sends eight 40 kHz and detect whether there is a pulse signal back. IF the signal back, through high level , time of high output IO duration is the time from sending ultrasonic to returning.