Go Down

Topic: Communication between multiple arduino's without an address (Read 587 times) previous topic - next topic

Dannyeiz

Hi everyone,
I'm trying to build a project where I have one Arduino which is the master and he is getting data from multiple Arduino's.
I started by implementing an I2C between 2 arduinos and than moved to the following solution:

http://www.techbitar.com/how-to-network-many-arduinos-with-sensors-using-i2c.html

However it didn't work for me, since I need to differentiate between the Arduinos.
Meaning lets say I have the following schematic:

[1] -> [2] -> [3]

So 1 talks to 2 and 2 to 3, but I don't want 3 to listen to 1.
Using the I2C complicates everything since they are all on the same line (or I have a mistake).

One last comment, I don't know the sequence of the Arduinos, which means I can't just give each of them a different address.
But I do know that they can be connected with a cable one after another.
Any ideas?
Should I use another communication protocol?

What am I missing?

Thanks in advance,
Danny  :)

septillion

One last comment, I don't know the sequence of the Arduinos, which means I can't just give each of them a different address.
But that's the whole idea of I2C, each node has a address.

But I do know that they can be connected with a cable one after another.
Any ideas?
Should I use another communication protocol?
Then yes, I think I2C is not what you want to use. If you only want to talk to the next (as in hardware next) Arduino I think plain serial is an easy option. Just connect Arduino Tx to Arduino 2 Rx, Arduino 2 Tx to Arduino 3 Rx etc.
Use fricking code tags!!!!
I want x => I would like x, I need help => I would like help, Need fast => Go and pay someone to do the job...

NEW Library to make fading leds a piece of cake
https://github.com/septillion-git/FadeLed

SurferTim

I had to think abut it for a while, but are you wanting one "master" and a bunch of "slaves", correct? Then you could probably use the shiftOut on the "master" and "shiftIn" on the slaves.
http://www.arduino.cc/en/Reference/ShiftOut
http://www.arduino.cc/en/Reference/ShiftIn

edit: I can't figure out what the purpose is if the goal is to send data or a request to one device. I think it would be better to assign each an address and use I2C.

With shiftIn and ShiftOut, you can have the devices on separate buses.

Dannyeiz

Hi,
Thanks for the replays.
For some reason I thought it was closed.

Septillion - I think your solution would fit me for the mean time.

SurferTim - the purpose is to send and receive and that is why I started out with I2C.
However in my application I don't know the sequence of Ardino's in advance,
which might effect my program.
Do you think it's possible to know which of the arduino's is plugged to the main Arduino
using shift register or clocking?
I'm not sure I understand how.

Thanks again.

Go Up