This is a simple and easy to use ultraosonic sensor. It can detect objects infront of it within a range of 2-400cm. It is the perfect sensor to use in robotics, obstacle detection, etc. It has a wide beam angle unlike IR Sensors, which enables it to detect obstacles withing a wide angle. Signals can be read from the 4-pin interface (Vcc, Trig, Echo, Gnd). One pin is used to trigger the ultrasonic transmitter and another one is used to read the echo. This HC SR04 distance sensor offers both accuracy and stable readings that is not affected by sunlight or object color.
This economical sensor provides 2cm to 400cm of non-contact measurement functionality with a ranging accuracy that can reach up to 3mm. Each HC-SR04 module includes an ultrasonic transmitter, a receiver and a control circuit.You will find this sensor very easy to set up and use for your next range-finding project!
The HCSR04 is a popular widely used ultrasonic sensor. Libraries are available for all popular microcontroller platforms in including Arduino. This allows you to directly connect the sensor to the microcontroller and start using it without much programming.