I would like to connect a relay, a 4-digit display, and a light sensors to a single Pi Zero W. I quickly realized that the relay and 4-digit display would conflict with one another because they are both using the GPIO18 pin. I don't want the relay and display to have the GPIO18 signal all the time.

If I "split" the GPIO18 signal in two, what hardware could I use to allow the signal to pass through only if another connected pin is 'on' (please see image).Blue signal is GPIO18 in image

Thank you in advance - having a great time playing with this.

  • 1
    Why not just use another pin?
    – Milliways
    Commented May 10, 2017 at 23:31
  • I'm not aware that you can do that. I thought the GPIO18 was special sending PWM (pulse wave modulation).
    – Nelson
    Commented May 11, 2017 at 0:31

1 Answer 1


While the solution you describe might not be the best one for your problem, the easy answer is that you need an AND-gate

For example the 74AHCT1G08GW from NXP or the SN74AHC1G08 from TI should do.

  • Thanks for the info!! You say this might not be the best solution for my problem, I'm curious what would be the best solution? Thank you again.
    – Nelson
    Commented May 11, 2017 at 12:14
  • Perhaps use SW PWM? raspberrypi.stackexchange.com/questions/298/…
    – Bex
    Commented May 12, 2017 at 7:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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