Go Down

Topic: Few bytes, long distance, fast communication... wanted! (Read 1 time) previous topic - next topic

nicecpu

Ok, excuse my poor english...
I have many arduinos (let me call them a1, a2, ...an, n = max 40) that have to exchange 2/4 bytes in a "peer-to-peer or master-slaves" wired (or wireless) network. Each arduino should receive bytes from all the others as soon as possible.
The distances a1-a2, a2-a3 ... are about 30 meters...
I2c seems solution, one master loops on all slaves... but i fear that: i2c range extenders like p82b715 are not stable over 20 meters; the loop is too slow;
In a prototipe with five arduinos I'm working on a sort of "parallel" protocol, using digital I/O, but.. more arduinos, more I/O required!
Some suggested solution? Thanks

Erdin

Can you tell us more what it is used for ?
What timing is needed. Is 100ms acceptable as a delay ? Or do you need 1ms ?
Are the Arduino boards in one long line ? If the communication is cascaded, the 1ms could turn into 40*1ms for a total of 40 milliseconds.

Perhaps it is possible to synchronize the Arduino boards, so the signal delay can be resolved in the boards. But that depends on what it is used for.

nicecpu

#2
Feb 27, 2013, 12:05 pm Last Edit: Feb 27, 2013, 12:10 pm by nicecpu Reason: 1

Can you tell us more what it is used for ?
What timing is needed. Is 100ms acceptable as a delay ? Or do you need 1ms ?
Are the Arduino boards in one long line ? If the communication is cascaded, the 1ms could turn into 40*1ms for a total of 40 milliseconds.

Perhaps it is possible to synchronize the Arduino boards, so the signal delay can be resolved in the boards. But that depends on what it is used for.


each arduino have to turn on-off lamps according to movement' sensors, so 200ms timing is still good... and cascated is good, also...
genarally is one long line; if a more complex layout will come *), I think it will be possible to transform it in a linear way...
*) like groups of lamps in a star configuration, and more groups connected in a long line.

Graynomad

#3
Feb 27, 2013, 12:16 pm Last Edit: Feb 27, 2013, 12:19 pm by Graynomad Reason: 1
I'm currently working on something that may work here, but Erdin's question about timing needs to be answered before I can tell if I'm in the ball park with speed.

Also what IO is needed at each node?

OK, just read your post, have a look here,

www.ardweenet.com

It's nowhere near ready yet but PCBs have been made.

______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

Erdin

The serial communication with RX and TX can be cascaded.
But that distances is something for RS-485.
http://en.wikipedia.org/wiki/RS-485

The RS-485 will be reliable, but I don't know if it can be in a star configuration or if it can be casaced.

Graynomad

RS-485 can be used in a star config but at low speeds and it's certainly not recommended.

What I'm doing is a ring network, is that what you mean by "cascaded"?

______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

Erdin


What I'm doing is a ring network, is that what you mean by "cascaded"?


Perhaps I used the wrong term, I think it is called daisy chain.
http://blog.makezine.com/2012/12/03/how-to-daisy-chain-arduinos-via-serial/

nicecpu

#7
Feb 27, 2013, 02:15 pm Last Edit: Feb 27, 2013, 03:19 pm by nicecpu Reason: 1
Thank You very much for Your responses. In attach there is a scheme in which You have to imagine that arduino 1 can ask to arduino k to turn on lamp n-1, arduino 2 can turn on lamp 1 via arduino 1, and so on... time response: not more than 200/300 mS, I think
I'm testing i2c, that seem fast, but I have to test it on long distance with some extender...

nicecpu



What I'm doing is a ring network, is that what you mean by "cascaded"?


Perhaps I used the wrong term, I think it is called daisy chain.
http://blog.makezine.com/2012/12/03/how-to-daisy-chain-arduinos-via-serial/


uhmmm it sounds good but I think there is the problem to connect the last arduino tx to first rx... too long! For 2-3km I need some serial repeater...

Graynomad

Quote
I think there is the problem to connect the last arduino tx to first rx... too long! For 2-3km I need some serial repeater...

That's true if your string of nodes is in a straight line. But 39 x 30 metres is only 1170m so RS-485 would be OK at slower speeds.

But I forgot to mention that it's a "redundant" ring that is supposed to tolerate broken wires, so if you don't connect the last to the first it's the same as a cut wire and it should work the same.

______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

nicecpu

uhmmm, let's summarize:

(from ardu_n tx) --> rx_ardu_1_tx --> rx_ardu_ 2_tx -->  ... --> rx_ardu_n_tx --> (to ardu_1 rx)

in this chain, if ardu(k) have to communicate to ardu(k-1), data must be
echoed through k+1, ... n, 1, 2, k-1 so all wires must be ok! And time of echoing is ..not so short. I think that a i2c data bus is better if... repeaters or range extenders works. Do You agree?  :~
Before I start with... tests I like to know Your opinion!

Graynomad

#11
Feb 27, 2013, 05:30 pm Last Edit: Feb 27, 2013, 05:46 pm by Graynomad Reason: 1
Quote
so all wires must be ok! 

Also true of the I2C wires is it not?

In a nutshell I think the following is true

Redundant ring - most robust, slower than a bus because of the store-and-forward of the data
Line (daisy-chain) - pretty robust, slower than a bus
Bus (I2C, RS-485, whatever) - least robust, fastest

Why is a bus less robust? Because any single wire fault kills the entire system. With a redundant ring a single fault has almost no affect on the network. With a line a single fault may or may not have a serious affect, it depends on the physical location of generated data but some of the network will almost certainly keep running.

So no I don't think I2C is more robust, using normal bus extenders like the P82B715 doesn't change anything except the distance you can transmit. The whole system will still die if there's a single line fault

You can use an extender like the PCA9600, this changes the I2C signals into two differential pairs for the trip, but AFAIK this is point to point. IE no longer a bus so (electrically at least) you may as well use RS-485 and async comms. However it does allow you to stick with I2C if you are already comfortable using that.

Now all that is the theory, truth is most networks are buses and they work just fine, however I2C is not designed for these distances and I've not seen any real examples of it being used with these extenders so I can't really comment on their suitability.

______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

nicecpu

#12
Feb 28, 2013, 05:14 pm Last Edit: Feb 28, 2013, 05:53 pm by nicecpu Reason: 1

Quote
so all wires must be ok!  

Also true of the I2C wires is it not?
[...]
Now all that is the theory, truth is most networks are buses and they work just fine, however I2C is not designed for these distances and I've not seen any real examples of it being used with these extenders so I can't really comment on their suitability.
______
Rob

You're right! So I've decided that for prototypization (just 5 arduinos) I'll use a trick, with 5 i/o data bus in a "very unusual way"... meanwhile  I'll begin to test RS-485 and long range I2C. I'll post results here... if useful  ;)
( http://www.diakom.com.ru/el/elfirms/appnotes/Philips/an452.pdf )

Graynomad

Rob Gray aka the GRAYnomad www.robgray.com

CarlChow


Hi guys, I have similar solution that had completed. I post a schematic to show it implementing by wireless.

Go Up