HC-SR04 ultrasonic sensor: specs and pinout
Ultrasonic ranging module with a trigger input and an echo output, measuring 2 cm to 400 cm.
Specs
| Spec | Value | Source |
|---|---|---|
| Working voltage | DC 5 V | source Electric Parameter |
| Working current | 15 mA | source Electric Parameter |
| Measuring range | 2 cm to 400 cm (4 m) | source Product features; Electric Parameter (min range 2cm, max range 4m) |
| Ranging accuracy | 3 mm | source Product features |
| Measuring angle | 15 degrees | source Electric Parameter |
| Trigger input | 10 µs TTL pulse | source Electric Parameter |
| Echo output | TTL level; pulse width proportional to range | source Electric Parameter |
| Measurement cycle | Over 60 ms | source Timing diagram section |
| Dimensions | 45 mm x 20 mm x 15 mm | source Electric Parameter |
Power
Pinout
| Pin | Function | Voltage | Notes | Source |
|---|---|---|---|---|
| Vcc | 5 V supply | 5 V DC (working voltage) | source Wire connecting direct as following (Product features page) | |
| Trig | Trigger pulse input | Datasheet: 10 us TTL pulse; voltage not given numerically | source Wire connecting direct as following (Product features page) | |
| Echo | Echo pulse output | Datasheet gives the output only as a TTL-level signal proportional to the range; the voltage is not stated numerically, so check it before connecting a 3.3 V-only input | source Wire connecting direct as following (Product features page) | |
| GND | 0 V ground | Datasheet: when powering up, connect GND first | source Wire connecting direct as following (Product features page) |
Common mistakes
- Sending a trigger pulse other than 10 µs: the trigger input is specified as a 10 µS TTL pulse (source)
- Starting measurement cycles closer than 60 ms: the sheet suggests a measurement cycle over 60 ms (source)
- Connecting power before GND: the sheet says the GND terminal should be connected to the module first (source)
What we could not confirm
- The sheet prints 'Working Frequency 40Hz' while its text describes eight 40 kHz bursts. The printed 40Hz is not used.
- The echo level is given only as TTL. No echo voltage figure is stated.
- The 3 mm accuracy is from the product features text. The test conditions are not stated.
- Echo divider values (10k/20k) are not in the sheet and are removed.
- Pins come from the Elecfreaks HC-SR04 module sheet (the module's original designer; a module sheet, not a chip-maker datasheet).
- The listing says Echo is 5 V; the Elecfreaks sheet says only 'TTL level'. The 5 V Echo claim and any voltage-divider values are not from the sheet and are not repeated.
Sources
- Elecfreaks HC-SR04 sheet (maker sheet; no semiconductor datasheet exists for this module). Local copy: a hosted copy (link).
Building with the HC-SR04 ultrasonic sensor? Describe your project on Soldr: it assigns pins from the board's published pinout, checks power and logic levels, and shows how to wire every part.