The HCSR04 is an inexpensive distance sensor. It uses Ultrasonic sound pulses to measure the distance between itself and any obstruction. The HCSR04 consists of two ultrasonic transducers, (one acting as a transmitter and the other as a receiver) and a control circuit. It has 4 pins VCC, GND, TRIG and ECHO. The VCC and GND pins are for powering the sensor, while the TRIG and ECHO are used to detect the distance.