Pages: [1]   Go Down
Author Topic: Few bytes, long distance, fast communication... wanted!  (Read 1372 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Offline Offline
Edison Member
*
Karma: 58
Posts: 2078
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: February 27, 2013, 06:10:25 am by nicecpu » Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 130
Posts: 8620
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
« Last Edit: February 27, 2013, 06:19:01 am by Graynomad » Logged

Rob Gray aka the GRAYnomad www.robgray.com

Offline Offline
Edison Member
*
Karma: 58
Posts: 2078
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 130
Posts: 8620
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Rob Gray aka the GRAYnomad www.robgray.com

Offline Offline
Edison Member
*
Karma: 58
Posts: 2078
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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/
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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...


* arduinos.jpg (23.21 KB, 492x242 - viewed 47 times.)
« Last Edit: February 27, 2013, 09:19:26 am by nicecpu » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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...
Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 130
Posts: 8620
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Rob Gray aka the GRAYnomad www.robgray.com

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?  smiley-confuse
Before I start with... tests I like to know Your opinion!
Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 130
Posts: 8620
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
« Last Edit: February 27, 2013, 11:46:32 am by Graynomad » Logged

Rob Gray aka the GRAYnomad www.robgray.com

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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  smiley-wink
( http://www.diakom.com.ru/el/elfirms/appnotes/Philips/an452.pdf )
« Last Edit: February 28, 2013, 11:53:40 am by nicecpu » Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 130
Posts: 8620
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Let us know how it goes.

______
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


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


* wireless solution for long area turning onoff lamp.JPG (129.22 KB, 980x900 - viewed 46 times.)
Logged

Pages: [1]   Go Up
Jump to: