This may seem a little stupid, i apologize if so as i'm new to electronics/arduino.

I have 4, 4-pin ping sensors. I'm running out of available pins on my UNO.

I had a ponder & wondered if it was possible to link all 4 sensor's trig pins to a single digital pin, with the echo pins assigned to their own pin. In my head, on each sensor call (sorry i'm used to programming terms) all 4 sensors would send a pulse, then only the sensor (or echo pin) in question would be read. Is that plausible? each ping sensor is about 20-30 cm separated, but facing internally, in a spiral downwards.

  • I don't see a problem. Should work.
    – Gerben
    Dec 19 '14 at 18:59
  • The problem with this wiring is that you won't be able to use pulseIn method to get the echo pins durations.
    – jfpoilpret
    Dec 19 '14 at 20:24
  • well, pulseIn will not stop working, but it can only measure one of the sensor's results at a time so the others signals are wasted. It is possible to write something that could measure all the pulses simultaneously, although it is not the easiest thing in the world to do.
    – BrettAM
    Dec 19 '14 at 21:05

I was able to achieve the result using my suggested method in the question. As BrettAM stated, the signals are wasted on the other 3 pins when checking 1. This solution was suitable as a proof of concept


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.