Trigger & Echo Wiring
Connect the sensor's two control pins.
Four Little Pins
The HC-SR04 has four pins in a row: VCC, Trig, Echo, and GND. Get these connected correctly and the sensor just works.
Power It Up
Connect VCC to the Arduino 5V pin. This sensor needs a full 5 volts to charge up and fire its sound pulses properly.
All lessons in this course
- How Ultrasonic Ranging Works
- Trigger & Echo Wiring
- pulseIn to Time the Echo
- Build a Proximity Alarm