My project uses two RPIs. These work collaboratively and as part of their work they both have to “agree” before a transistor is switched on to enable a work load. To that end, both PIs have an output pin connected to an AND gate such that when they go high the AND’s output will go high so switching the workload on; conversely, if either of the PIs cease to send a high then the workload is switched off. I’m reasonably happy with this part of the circuit, and I don’t believe I’ve done anything too daft. However, you will note that I feedback the signal being output from the AND gate into GPIO pins (configured as an inputs) on both PIs. Given I’m an electronics ignoramus I suspect I may be about to do something stupid and that the input pins need some defending. However, I don’t know and would rather not gamble twenty-plus pounds, hence my question to you: is what I’m doing sensible or are there further measures I should take?

I appreciate that I could programmatically solve this problem (i.e. sockets or I2C) but the simple feedback solution I’ve drawn would seem to be the most elegant. I would welcome your thoughts. GPIO feedback diagram

  • Pin 5 is SCL (gpio 1 or 3 depending on the version of Pi you have). Pin 6 is ground. Which pins have you connected?
    – joan
    Commented Dec 31, 2014 at 17:07
  • Hello, the pin numbers refer to the wiringPi designation and are "standard" GPIO pins - please see wiringpi.com/pins
    – Stewpid
    Commented Jan 1, 2015 at 19:28

1 Answer 1


The Pi have built in resistors but it's good practise to put at least a 10k resistor on input anyway. That protects from over current peaks I suppose.

Another safe guard is to use a diode just in front of the transistor. Just in case the transistor goes faulty you won't get 12 volt coming back down to the Pi's. Resistors won't protect you to from that.

Or optocoupler gives 100% safety instead of transistor.

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.