This module uses the simple method, a control port with a 10US above high level, can wait for high level output at the receiving port. An output can drive the timer.
When this port is low can read the timer value, this time for the location of the time, can be calculated distance. So constantly cycle test, that can achieve the measurement of the value of your mobile.
The basic working principle:
(1) using IO port TRIG trigger location, to the high level signal of at least 10us;
(2) module automatically sends 8 40KHz Fang Bo, automatic detecting whether a signal return;
(3) a signal return, a high level is output through the IO port ECHO, the time duration of the high level is
ultrasonic from launch to return.
The test distance = (high level time * speed of sound (340M/S)) /2