Multiple arduinos into 1 i/o pin of another arduino

Hey all,

I'm trying to set up a slave and master arduino circuit (without using I2C). The hope is that multiple arduinos (right now 2 but later hopefully about 10) will all be able to control one boolean variable in the master arduino.

Right now, I have pin 7 of the 2 slave arduinos set as Outputs, and both are connected via breadboard to one wire that goes to pin 7 of the master arduino that is set as Input. When the master arduino receives a HIGH voltage, it is supposed to run a function, however it is only receiving the signal from one of the slave arduinos, if i unplug the slave arduino that is working, the slave arduino that's signal isn't being received starts to be received properly.

I have made sure to connect them all to have a common ground, are there any large flaws from more of an electrical standpoint in my circuit that I've neglected? ie: perhaps slave arduino 1 steals the signal from slave arduino 2, preventing the signal from slave arduino 2 from going to the master arduino. If this, or something like this is the case, is there a component that might help me complete my circuit properly?

Thanks in advance :slight_smile:

How many resistors are involved in the circuit?

Have you noticed a burning odor?

May I ask, why not use I2C?

Currently not using any resistors between the pins in question, and no, no burning smell.

Also, if push comes to shove, ill try out i2c but my overall project is processing a lot more than just these pins, the master arduino is also communicating with a flash app, and I'm afraid that the arduino might not be capable of reliably monitoring so much at a time. Also, im weary of i2c because it seems very daunting to me (ive only been using arduino/coding and learning about electronics for about 2 months)

cheathe:
Currently not using any resistors between the pins in question, and no, no burning smell.

In which case you have gotten very lucky.

You will be learning about open collector. You will have a pull-up resistor connected to your signal wire. Your slaves will use pinMode to toggle their "output" between INPUT and OUTPUT / LOW. Your slaves will enjoy a long healthy life.

Lesson -: never connect outputs together.
If you must connect Arduinos together like this, and it is a very stupid thing to do, then use an external logic gate or as stated above, use a transistor on each output in an open collector configuration.

Side note:

I'm curious about the Flash app side of things? (As in Adobe Flash?)

How are you communicating with the app?

Are you getting 2-way communication?

Just need a simple diode on each slave output, cathode to slave, common anode to master, with a pullup resistor.
Each slave can pull the signal low, but cannot drive it high to affect the low output of another slave.

Just need a simple diode on each slave output, cathode to slave, common anode to master, with a pullup resistor.
Each slave can pull the signal low, but cannot drive it high to affect the low output of another slave.

thank you ! (I know it's a no-brainer but someone had to say it)

Or you can drive the pins open-drain thus:

void setup ()
{
  digitalWrite (pin, LOW) ;  // these are the defaults anyway
  pinMode (pin, INPUT) ;
}

void loop ()
{
  pinMode (pin, OUTPUT) ; // drive low
  pinMode (pin, INPUT) ; // let it float (hi-Z)
  .......
}

The the master Arduino would use INPUT_PULLUP, so that the pin reads as low if either slave is driving it LOW,
otherwise will read HIGH.

Of course if you add diodes you won't risk damaging any of the Arduinos should they be programmed wrong.

MarkT:
Of course if you add diodes you won't risk damaging any of the Arduinos should they be programmed wrong.

And that really was the point being made about the diodes or more complex options - reliability and safety. :wink: