Diagrama de pines
Pines de Sensor de distancia por ultrasonidos HC-SR04 (4 pines)

Pines
- VCC (5V)
- TRIG — a 10µs HIGH pulse in starts one ping
- ECHO — pulse width out, proportional to distance (~58µs per cm of round trip)
- GND
Especificaciones
| Tensión de alimentación | 5 V DC |
|---|---|
| Working current | 15 mA |
| Nivel lógico | 5 V (TRIG and ECHO) |
| Measuring range | 2–400 cm |
| Resolution | ≈3 mm |
| Measuring angle | 15° |
| Ultrasonic frequency | 40 kHz |
| Trigger pulse | 10 µs HIGH |
| Distance formula | Echo time (µs) / 58 = cm |
| Measurement cycle | ≥ 60 ms between pings recommended |
| Tamaño | 45 × 20 × 15 mm |
Notas
- ECHO is a 5V output. Feeding it straight into a 3.3V MCU input (ESP32, most ARM boards) is out of spec — use a voltage divider (e.g. 1kΩ over 2kΩ) or a level shifter first.
- ~15° detection cone, 2–400 cm range; soft or angled surfaces absorb or deflect the ping instead of returning it.







