Kunkune

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.

HC-SR04 Ultrasonic Sensor Arduino Distance Measuring Sensor - Main image
$1.03 $1.45 In stock

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 policy
If 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 policy
Planning delivery

Review the available services for your destination.

Standard Shipping · United States: $0.00

Express Shipping · United States: $3.99

View policy
Return 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

Customer Reviews (4.4 / 5 · 5 reviews)

David ★★★★★

Plugged it into my breadboard and got stable readings from about 3cm out to nearly 4 meters, which is way more range than I needed for a parking sensor project. The 10-microsecond trigger pulse took a minute to get right in the code, but once it was dialed in the numbers stayed consistent. Cheap, si

Eva H. ★★★★★

Wired this up to an Arduino and the trigger pin only needs a 10-microsecond pulse, which made the sketch way simpler than I expected. Readings held steady across the whole 2cm to 400cm range once I mounted it flat, no jitter at all. Cheap enough that I ordered two more for the next build.

Robert ★★★★★

Got my obstacle-avoiding robot measuring perfectly from 2cm to 400cm on the first try. The 40kHz pulse and 10-microsecond trigger work exactly as described, and readings stay stable even when I move the sensor around quickly.