Ultrasonic Sensor HC-SR04 is a sensor that can measure distance. It emits an ultrasound at 40 000 Hz (40kHz) which travels through the air and if there is an object or obstacle on its path It will bounce back to the module. It is commonly used in obstacle avoiding robots and automation projects. It comes complete with ultrasonic transmitter and receiver modules. Commonly used with a microcontroller such as an Arduino UNO.
- Sensor has four pins -GND, VCC, trig, echo
- It works under 5v. Connect Vcc pin of sensor with Arduino 5v
- GND pin of ultrasonic sensor is connected to GND of Arduino
- Interface trig pin and echo pin of sensor with any digital pins of Arduino.