My project uses seven Arduinos: six slaves and a master. I want to dedicate a digital output pin on each slave that can be set low (preferably) to signal the master that a fatal error has occurred. So one wire coming out of a digital output of each slave, normally high, and those six wires going into a single digital input on the master. I also want to add some "emergency stop" buttons that will ground the wires in a similar manner -- so that will be another few wires from the stop buttons, all joining at the master's digital "emergency stop" input pin.
All of my grounds are connected together, but the Arduinos have their own +5v supplies from wall warts.
This was easy with just the emergency stop buttons -- because every one would just have an open wire that would be connected to ground when the button was pressed. Simple!
It's more confusing (to me!) with the Arduino outputs -- if I set all six to normally high (+5v) then I guess that's not a problem...and the master sees +5v at it's input pin. But if one of the slaves pulls its output pin low, to signal emergency stop, then I have a short circuit between it and the other five slaves, and no telling what the master would see on the wire.
So I installed diodes on each of the six slave output pins, with the stripe towards the digital pin. I was thinking this would block the +5v from getting out, but would allow a ground to pass through it, so any slave that pulled its line low would thus pull the master's line low. Of course it didn't work as planned.
What I need is an "open circuit" output from the pins, like my emergency stop pushbuttons, rather than either +5v or ground...so they would behave like the pushbuttons. Could I do this by setting all of the slave "output" pins to input mode, and then changing just one (whichever wanted to signal the emergency stop) to output mode, low? That would eliminate the short circuit problem, but I'm not sure how the master would see all those six incoming wires that were set to input mode at their source??? I'm guessing this is an undefined state and would not be a reliable solution.
If necessary, I could change the setup so that the emergency stop was triggered by a high on the master's input pin -- but I don't see how that would eliminate the short-circuit problem. I know just enough electronics to be dangerous -- but I'm trying to learn so don't hate me!
Can someone please point me in the right direction? Thank you!