This HC-SR04-Ultrasonic Range Finder is a very popular sensor that is found in many applications where it requires measuring distance and detecting the objects.
The module has two eyes like projects in the front which form the Ultrasonic transmitter and Receiver. The HC-SR04 ultrasonic sensor uses sonar to determine the distance to an object like bats or dolphins do.
This Ultrasonic Sensor module is a transmitter, a receiver and a control circuit in one single pack!! It has a very handy and compact construction. It offers excellent range accuracy and stable readings in an easy-to-use package. Its operation is not affected by sunlight or black material like Sharp rangefinders are (although acoustically soft materials like cloth can be difficult to detect).
The Trigger and the Echo pins are the I/O pins of this module and hence they can be connected to the I/O pins of the microcontroller/Arduino.
When the receiver detects return wave the Echo pin goes high for a particular amount of time which will be equal to the time taken for the wave to return back to the sensor.
Ultrasonic Ranging Module HC-SR04 provides 2cm-400cm non-contact distance sensing capabilities, ranging accuracy up to 3mm.