Ultrasonic ranging module HC – SR04, is a basic obstacle detection sensor, which provides 2cm – 400cm non-contact measurement range with an accuracy of ~3mm. Basic principle of operating ultrasonic sensor :
Voltage : 5VDC, 15mA, 40Hz, 2cm to 255cm,
Measuring Angle : 15degree, 45*20*15mm
Send IO trigger pin with at least 10us active high signal.
The module will send automatically eight 40kHz pulse from the transmitter(thats why it is called ultrasonic). Any object detected will reflect the transmitted pulse back to the receiver.
The signal return in active high level can be detected at pin ECHO. The high level time, which is time of high output duration from sending ultrasonic and returning, resembles the distance.
Test distance = (high level time×velocity of sound (340M/S) / 2,
Avoid soft objects as it will absorb most of the transmitted waves