The HC-SR04 is an affordable and highly popular ultrasonic distance sensor capable of measuring distances from 2cm to 400cm with an accuracy of up to 3mm. It works by emitting an ultrasound wave at 40kHz and calculating the time it takes for the echo to bounce back from an object. This "sonar" technique makes it a standard component for DIY robotics, especially for building obstacle-avoiding cars, smart dustbins, and proximity detection systems. It is easy to use and fully compatible with microcontrollers like Arduino, ESP32, and Raspberry Pi.
| Operating Voltage | 5V DC |
| Operating Current | <15mA |
| Operating Frequency | 40kHz |
| Measuring Range | 2cm to 400cm (0.78 inches to 13 feet) |
| Measuring Angle | <15 degrees |
| Accuracy | ~3mm |
| Dimensions | 45 x 20 x 15 mm |
| Pinout | VCC (Power), Trig (Trigger input), Echo (Receiver output), GND (Ground) |