HC-SR04 (ultrasonic)
Also known as: HC-SR04 · RCWL-1601 · Distance & level
The blue robot-eyes sensor everyone starts with: a dollar of distance sensing that's survived every trend because it just works for coarse jobs.
As an Amazon Associate and an affiliate we may earn from qualifying purchases. Prices and availability are set by the retailer.
At a glance
⚑ flag an error| Measures | distance |
|---|---|
| Accuracy | 2 cm–4 m, ~cm resolution |
| Interface | GPIO (trigger + echo pins) |
| Supply | 5 V (3.3 V RCWL variants exist) |
| Battery-viable | Yes (deep-sleep friendly) |
| ESPHome | Native ESPHome component — ultrasonic |
| Typical price | $1-2 (street, varies) |
Compare all sensor modules in one table →
Which one do I buy?
vs VL53L0X ToF: ToF is precise and compact; ultrasonic is cheap and doesn't care about target colour or sunlight.
Clone check
Low clone risk. Buy from any reputable listing.
Good for
Gotchas to know
- 5 V part: the echo pin needs a divider into a 3.3 V ESP32 (or buy the RCWL-based 3.3 V clones).
- Soft, angled or narrow targets scatter the ping — readings get creative.
- For outdoor/tank use you want the waterproof JSN-SR04T instead.
Wiring it up
Simple wiring: one data GPIO on any ESP32 dev board.