Sensors
HC-SR04 ultrasonic distance module
Estimate distance by timing an ultrasound echo.
What it does
A trigger pulse launches sound. The echo pulse represents the outward-and-return travel time; halving that distance gives the target range.
Connections and compatibility
The standard HC-SR04 uses 5 V power and a 5 V echo output. Direct echo connection is for 5 V-tolerant inputs such as the Uno R3; a 3.3 V board needs suitable level conversion.
Choosing one
A common four-pin module is enough for indoor experiments. A waterproof JSN-SR04T has a different near-distance limit and is not an interchangeable choice for close objects.
Common mistakes
No echo is missing data, not zero distance. Soft fabric, angled surfaces, and nearby sensors can cause missed or false readings.
Use it in a tutorial
- Ultrasonic distance sensors — Measure distance with an HC-SR04, reject missing echoes, and compare raw readings with a small median filter.