Spark Logic

HC-SR04 ultrasonic ranging module pinout

The HC-SR04 sends a 40 kHz ultrasonic burst and reports the round-trip time as the width of a logic pulse.

Four-pin module header

4 contacts Current package

ELECFREAKS ·

Four-pin module header pinout

Four-pin module header
Face the two transducers with the connector below them. VCC, Trig, Echo, and GND run left to right.
Selected pin details

1 · VCC

Supply input · Power

Primary device supply. Place the bypass capacitor close to this pin.

ELECFREAKS HC-SR04 User Guide, §§ 2.3–2.5 and 3.1.

Electrical limits · Link to this pin

All 4 pins

PinSignalDirectionFunction
1VCC Supply inputSupply input Primary device supply. Place the bypass capacitor close to this pin.
2Trig InputInput A high pulse of at least 10 µs starts one measurement.
3Echo OutputOutput The high pulse width measures acoustic round-trip time. The 5 V wiring below assumes a 5 V host.
4GND Supply returnSupply return Connect to the common ground plane or bench return.

Signal assignments

Trigger and echo

Use one GPIO output to start the burst and a separate input timer to measure echo pulse width.

Electrical limits

ParameterLimitConditions and source
Supply5 V DC5 V DC The guide lists 15 mA operating current. ELECFREAKS HC-SR04 User Guide, §§ 2.3–2.5 and 3.1.
Trigger width10 µs minimum10 µs minimum The module emits eight 40 kHz cycles per trigger. ELECFREAKS HC-SR04 User Guide, §§ 2.3–2.5 and 3.1.
Ranging interval2 cm to 4 m2 cm to 4 m The documented range depends on target size, angle, and acoustic conditions. ELECFREAKS HC-SR04 User Guide, §§ 2.3–2.5 and 3.1.

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.