HC-SR04 Ultrasonic Distance Sensor
Affordable 2 cm–400 cm ultrasonic rangefinder with trigger/echo interface.
Price last verified: 6 Nov 2026 · Check seller specifications before ordering
Buy
Maker Marketplace MY is an independent electronics and maker resource. We link out to third-party marketplaces such as Shopee Malaysia and Lazada Malaysia. Purchases happen on those external sites, not here. We may earn an affiliate commission when you buy through our links, at no extra cost to you. Prices are shown only when recorded; check the seller’s current price, specifications and delivery terms before ordering.
Opens externally in a new tab. We do not handle checkout or fulfilment.
Full description
The HC-SR04 is the textbook ultrasonic distance sensor. Send a 10 µs trigger pulse on TRIG, then time the width of the pulse on ECHO to get the distance to the nearest object. It works from 2 cm to 400 cm with a resolution of about 3 mm, which is plenty for robot obstacle avoidance, bin-fill monitors and touchless switches.
Main use case
Robot obstacle avoidance, water level detection, touchless switches.
Intended audience
Beginners and robotics learners.
Why we recommend it
Cost-to-capability is unbeatable for basic distance sensing.
Specifications
| Range | 2 cm – 400 cm |
| Resolution | ~3 mm |
| Beam angle | ~15° |
| Input voltage | 5 V DC |
| Trigger pulse | 10 µs TTL |
| Echo pulse width | 150 µs – 25 ms |
Pros & Cons
Pros
- Cheapest reliable distance sensor available
- Simple trigger/echo timing interface
- 2 cm to 400 cm range
- Runs from 5V, accepts 3.3V trigger
Cons
Common beginner mistakes to avoid
- Reading ECHO directly into a 3.3V GPIO (use a divider)
- Forgetting to set TRIG low before sending the 10 µs pulse
- Using float math on Uno for time-to-distance (use long)
- Assuming the sensor returns “cm” — it returns µs
Who should avoid it
High-precision applications — use a Time-of-Flight sensor like VL53L0X.