Connecting one push button to two Arduino Uno?


I want to make a very simple midi over usb controller with just 4 buttons with Arduino Uno. I will use this controller to control QLab (an audio cue software for mac osx) for a dance show. Untill this everything is ok.

Now, I am using 2 macbook pro. One is the show laptop and the other one is the backup laptop. What I want is being able to press a buton of my controller to fire QLab on the two laptops. For this I'm thinking to use two Uno boards each one connected to its laptop via usb.

The questions are: Is it possible to connect the same push button to the pins of two Uno boards and Is it a correct design? Is I2C protocol an alternative for what I want to do? (Not sure if I can use the usb on master and slave). Is there a better alternative?

Thanks in advance for your help. Stéphane.

As long as the two Arduinos share a common Ground (and possibly a common power supply) you should be able to have a single button control input pins on both at the same time.

I would like my controller to be usb powered. Is it possible to share power supply in this case?

If in doubt, you could use an optocoupler to be save. Just connect the switch in line with a 470Ohm resistor and the input of that coupler - secondary side of that coupler connected to the 2nd arduino...

so like this: +5v --- 470R------coupler(input side)---switch----gnd

for the 1st arduino you can just get the signal between switch and ground ( don't forget to activate pullups on both arduino's inputs).

a cheap 4N25 should do the job.

best regards, Björn