HC-SR04 Ultrasonic Sensor Arduino Distance Measuring Sensor
Enhance your projects with the HC SR04 Ultrasonic Sensor. With high accuracy distance measurement and obstacle detection capabilities, this compact and versatile sensor is perfect for robotics, automation, and industrial applications.




Category: Arduino Sensors
HC-SR04 Ultrasonic Distance Sensor for Arduino
The HC-SR04 measures distance from 2cm to 400cm using 40kHz ultrasonic pulses and a time-of-flight calculation. Trigger the sensor with a 10-microsecond pulse on the TRIG pin, and the ECHO pin returns a high pulse whose width in microseconds divided by 58 gives the distance in centimetres. No library is strictly required — a few lines of Arduino code handle the timing — though the NewPing library adds median filtering and non-blocking measurement for cleaner readings.
- 2cm–400cm measurement range
- 3mm resolution
- 5V supply, 2-pin measurement interface — TRIG and ECHO on any digital pins
- 15° cone angle — narrow beam reduces false reflections
- No library required — simple pulse timing in Arduino code
| Specification | Value |
|---|---|
| Range | 2cm – 400cm |
| Resolution | 3mm |
| Frequency | 40kHz ultrasonic |
| Beam angle | 15° |
| Supply voltage | 5V DC |
| Current | 15mA during measurement |
Can you use HC-SR04 with a 3.3V Arduino or ESP32?
The HC-SR04 needs a 5V supply and outputs a 5V ECHO signal. On a 3.3V ESP32, connect VCC to 5V, divide the ECHO pin to 3.3V with a 1k/2k resistor divider, and connect TRIG directly — ESP32’s 3.3V output is high enough to trigger the sensor. Without the voltage divider, the 5V ECHO signal risks damaging the ESP32’s GPIO.
What surfaces does it struggle to measure?
The HC-SR04 under-reads on soft, angled, or very small surfaces that scatter ultrasound rather than reflecting it back toward the sensor. Foam, fabric, and thin objects at 45° angles give erratic readings. Flat hard surfaces at 90° give the most consistent results.
Best for
Obstacle avoidance robots, bin level monitors, parking distance sensors, liquid level gauges, automatic hand-wash triggers, alarm perimeter sensors, and classroom distance measurement experiments.
Why Kunkune
Shipped from UK stock. 60-day returns, no minimum order. Fast Royal Mail delivery.
Buying in bulk? For orders of 10+ units, contact us for trade pricing.
A final check before payment
Review your options, quantities and the final total before confirming.
Ordering for an occasion
Delivery times are estimates, so leave time before your occasion.
Standard Shipping: Handling (business days) 0–1; Transit (business days) 7–15.
Express Shipping: Handling (business days) 0–1; Transit (business days) 7–15.
View policyIf plans change
Ask the store about your order before making return or refund arrangements.
Please contact us for the refund processing timeframe before returning an item.
View policyPlanning delivery
Review the available services for your destination.
Standard Shipping · United States: $0.00
Express Shipping · United States: $3.99
View policyReturn arrangements
Contact the store first to check the conditions for your item.
United States · Return window (days after delivery): 30. Return method: By mail. Return postage: Seller pays.
View policy








