If I have four HC-SR04 detectors, can they share the same trigger pin on the Arduino? This would reduce the number of pins needed from eight to five.

Even if they can share the same trigger, maybe this doesn't make sense because the emitted signal from one HC-SR04 will give a false reading to the others. If this will occur, how much time should the sketch pause before triggering/reading the next HC-SR04?



No, you can't really share the same trigger pin, for the reasons you have already worked out. You can, though, share the same echo pin, since you know which HC-SR04 has been activated by the trigger.

To do that you will need a "wired or" circuit. The simplest method is a diode per ECHO signal and a pull-down resistor:


simulate this circuit – Schematic created using CircuitLab

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.