Ultrasonic Sensor Module Working Principle
Pull the Trig pin to high level for more than 10us impulse, the module start ranging.
The module automatically sends eight 40KHz square wave to detect whether a signal is returned.
Finished ranging, If you find an object in front, Echo pin will be high level, and based on the different distance, it will take the different duration of high level.
So we can calculated the distance easily. The distance = ((Duration of high level)*(Sonic :340m/s))/2. Distance L = 1/2 × T × C