HC-SR04 ultrasonic ranging module connection guide
HC-SR04 ultrasonic ranging module Four-pin module header wiring guide with power, signal assignments, and bench checks.
Four-pin module header
4 contacts Current packageMeasure a distance with a 5 V host
RequiredUse a host with 5 V-compatible inputs and outputs. Share ground and power the module from a regulated 5 V supply.
- +5 V
- VCC (1)
- Regulated 5 V rail
- Ground
- GND (4)
- Host ground
- Trigger output
- Trig (2)
- Host GPIO output
- Echo capture
- Echo (3)
- Host timer capture input
Bench checks
- Set Trig low at idle. Send a pulse at least 10 µs long. Configure Echo as an input and impose a timer timeout so a missing echo cannot stall the host.
- Point the module perpendicularly at a flat target 30 cm away. At about 343 m/s sound speed, the echo pulse should be about 1.75 ms.
- Wait 60 ms between starts to keep later echoes from overlapping the next measurement.
ELECFREAKS HC-SR04 User Guide, §§ 2.3–2.5 and 3.1.
Four-pin module header wiring map
Four-pin module header
1 · VCC
Primary device supply. Place the bypass capacitor close to this pin.
Models and documents
This map follows the 5 V ELECFREAKS HC-SR04. Check the markings and voltage limits on lookalike modules.
- HC-SR04
- 5 V version documented by ELECFREAKS.
- HC-SR04 manufacturer documentation· ELECFREAKS HC-SR04 User Guide, §§ 2.3–2.5 and 3.1.
