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
Measuresdistance
Accuracy2 cm–4 m, ~cm resolution
InterfaceGPIO (trigger + echo pins)
Supply5 V (3.3 V RCWL variants exist)
Battery-viableYes (deep-sleep friendly)
ESPHomeNative ESPHome component — ultrasonic
Typical price$1-2 (street, varies)

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

Wiring it up

Simple wiring: one data GPIO on any ESP32 dev board.

Resources

More distance & level sensors

← All sensors