The HC-SR04 Ultrasonic Sensor measures distance from 2 cm to 4 m without contact by sending a 40kHz sound pulse and timing the echo. It is the most popular distance sensor for obstacle-avoiding robots, water level meters and parking sensors with Arduino and ESP32.
| Model | HC-SR04 |
|---|---|
| Range | 2 cm – 400 cm |
| Resolution | approx. 3 mm |
| Supply voltage | 5V DC |
| Working current | 15 mA |
| Frequency | 40 kHz |
| Measuring angle | 15° |
| Pins | VCC, Trig, Echo, GND |
What is the operating voltage?
5V DC.
Can I use it with ESP32?
Yes, but the Echo pin gives 5V – use a voltage divider to bring it to 3.3V.
How is distance calculated?
Distance (cm) = echo time (µs) / 58.
Can I buy the HC-SR04 Ultrasonic Sensor Module in Kanpur?
Yes – buy online with delivery across India, or pick it up from the iTechBuilders store, Damodar Nagar, Kanpur.