cheap, easy way to connect 20+ arduino

So I have a little project where I want to have lights scattered around the room which can be controlled with arduino`s.

Now I want to be able to do this from a central point, Now of course I need to have a good way to power and do communication between the arduino`s.

I wonder if it would be possible to have 1 single cable which would go from 1 arduino to the next containing 1 power cable, 1 ground and 2 serial cables rx and tx. and use each arduino node as an 'active' repeater so I can kind avoid the problems with having very long cables.

Since I have literally no idea about any of the stuff with cabling and how to best deal with this I would like some advice.

  1. how to best power these arduino`s
  2. wire to use. Can I use just standard wiring and then shield the 4 of them by hand?
  3. the powering of the lights is another problem but optimally I would like to power these from the same wire as the arduino.

I hope someone can enlighten me!

What's the voltage and current requirement of the "LIGHTS"?

If communication is only one-way then you only need three wires.

Connect the TX of each Arduino to the RX of the next one in the chain.

Everything else depends on the power requirements of the "lights" (which is still a secret...)

I thought about having four wires since I could have a way back but arduino only has 1 of each rx and tx so that wouldn`t work.

anyway for the led`s I want to have 2 segments of 3 leds, red, green and blue. so I would have 6 in total.

https://www.sparkfun.com/products/8862 https://www.sparkfun.com/products/8861 https://www.sparkfun.com/products/8860

rowanG337: I thought about having four wires since I could have a way back but arduino only has 1 of each rx and tx so that wouldn`t work.

You could do that with I2C.

rowanG337: anyway for the led`s I want to have 2 segments of 3 leds, red, green and blue. so I would have 6 in total.

https://www.sparkfun.com/products/8862 https://www.sparkfun.com/products/8861 https://www.sparkfun.com/products/8860

6 on each Arduino?

120 of those LEDs is 10 Amps of current. Maybe better to have multiple power supplies.

Sounds like a job for DMX http://playground.arduino.cc/Learning/DMX

if your setup is a master arduino and a lot of slave arduinos, then you probably could use four wires for tx, rx, ground and power between them. You might need diodes on the slave tx pins in such a setup.

Maybe daisy chain like this. Master can include an address, slave receives and passes along if message not meant for him. The slave that finally uses changes the data to “Used” and passes it along, eventually it makes it back to the master.
If the master doesn’t see Used after sending a message out, or gets the same message back, it knows there was an error.

If you have to daisy-chain power then use the Barrel jack or Vin, so that the voltage drop along the chain isn't a problem (unless you use very thin wire or are pulling lots of current at each node). Thus if you put 10V in at one end and get 8V at the end of the chain each board can still have a nice steady 5V supply.

This will still mean that the grounds will be at slightly different voltages, but if you use the Tx -> Rx chain then this won't build up relative to the signals - you need to ensure the voltage drop along the ground wire isn't more than 0.3V or so, to keep the signals from going more than 0.3V below ground at the next board (abs max limit).

If the chain can link back into a circle then you can apply power at both ends which reduces the total voltage drop. For instance if installing boards all around a room this could be feasible.

Oh yes, one other thing - if you stream serial data from the master continuously with no breaks then you are at the mercy of system clock differences between the different boards - many Arduinos only have +/-0.3% tolerance on the system clock so sending 10,000 chars at full rate could cause the sender to get 60 chars ahead, worst case, for example. This would overflow the Serial RX buffer at some point and lead to dropped characters.

The same issue is likely to happen if you use delay() in the sketch too.

The defence is to not send data at max rate for long periods - though this isn't a particular common issue I suspect unless streaming lots of data from SDcard or audio or similar.

Use 115200 as the baud rate everywhere to reduce the chances of saturating the TX line like this.