# HC-SR04 ultrasonic sensor: specs and pinout

> Ultrasonic ranging module with a trigger input and an echo output, measuring 2 cm to 400 cm.

[HTML version](https://soldr.ai/docs/components/hc-sr04)

[Docs](https://soldr.ai/docs) / [Components](https://soldr.ai/docs/components)

Ultrasonic ranging module with a trigger input and an echo output, measuring 2 cm to 400 cm.

Every value cites its sourceOfficial pinout

[Buy on Compoden](https://compoden.com/products/hc-sr04-ultrasonic-sensor-module-5v-distance-2cm-400cm)

## 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

| | Value | Source |
|---|---|---|
| Supply | DC 5 V | source Electric Parameter |
| Current | 15 mA working current | source Electric Parameter |

## 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](https://cdn.sparkfun.com/datasheets/Sensors/Proximity/HCSR04.pdf))
- Starting measurement cycles closer than 60 ms: the sheet suggests a measurement cycle over 60 ms ([source](https://cdn.sparkfun.com/datasheets/Sensors/Proximity/HCSR04.pdf))
- Connecting power before GND: the sheet says the GND terminal should be connected to the module first ([source](https://cdn.sparkfun.com/datasheets/Sensors/Proximity/HCSR04.pdf))

## What we could not confirm

- The sheet prints &#x27;Working Frequency 40Hz&#x27; 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&#x27;s original designer; a module sheet, not a chip-maker datasheet).
- The listing says Echo is 5 V; the Elecfreaks sheet says only &#x27;TTL level&#x27;. 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](https://cdn.sparkfun.com/datasheets/Sensors/Proximity/HCSR04.pdf)).

Building with the HC-SR04 ultrasonic sensor? [Describe your project on Soldr](https://app.soldr.ai): it assigns pins from the board's published pinout, checks power and logic levels, and shows how to wire every part.
