Connection multiple arduinos via RS485

I2C

150 meters

Not normally possible although there are driver chips that may make it although I think 50m is about their limit.

In short RS-485 is made for this, may as well us it.

@HugoPT
You don't necessarily have to address each Arduino, you can use a publish/subscribe model whereby you send all data to the network (with a "data type" identifier) and each Arduino uses what it wants.


Rob

My bad. The distance was not in the original description of the problem and I did not pick up on the distance in the later post.

Anyone running other protocols on top of RS485??

This is interesting: Tinkering with Electronics...: Arduino and RS485 (ENGLISH VERSION)

I am probably going to work on implementing this with these: http://goo.gl/S1lFR

I understand RS-485 needs a common ground (that the differential is related to).. Can this just be "local Green Ground" in a few different rooms? Buildings? Or does the wiring have to include 1 or more ground conductors?

Anyone using CAT5 for this? 2-pair telephone wire?

DISCLAIMER: Mentioned stuff from my own shop...

I understand RS-485 needs a common ground (that the differential is related to)

Is this really true?
From what I had read the rs-485 just need 2 wires A and B.The ground is just in case we use a long link right?
I found this after a brief search

Connecting a multidrop 485 network. The EIA RS-485 Specification labels the data wires "A" and "B", but many manufacturers label their wires "+" and "-". In our experience, the "-" wire should be connected to the "A" line, and the "+" wire to the "B" line. Reversing the polarity will not damage a 485 device, but it will not communicate. This said, the rest is easy: always connect A to A and B to B.

Signal ground, don't forget it. While a differential signal does not require a signal ground to communicate, the ground wire serves an important purpose. Over a distance of hundreds or thousands of feet there can be very significant differences in the voltage level of "ground." RS-485 networks can typically maintain correct data with a difference of -7 to +12 Volts. If the grounds differ more than that amount, data will be lost and often the port itself will be damaged. The function of the signal ground wire is to tie the signal ground of each of the nodes to one common ground. However, if the differences in signal grounds is too great, further attention is necessary. Optical isolation is the cure for this problem. Contact B&B Technical Support for more details.

Thanks, Hugo...

I'll have to do some testing when I get this going. I'm mostly interested in running in a house and close by buildings like a barn etc., running from the same AC distribution transformer.

The "Neutral" might bounce a couple of volts with unbalanced loads, but the Green Ground as I've tested it, should be less different than that.

I want to be able to locate a few Arduinos in appropriate locations and coordinate them from one Arduino or a PC.

A friend and I are working on shields for a Mega2560 that would have several ports for Home Automation, including RS-485, X-10 etc.. and another with WiFi and several other RF communications standards (http://davehouston.org/Zarduino.htm - Mega Boards) . But I want to get a simple multi-Arduino RS-485 system running sooner..

Is this really true?

You bet.

The ground is just in case we use a long link right?

Wrong.

does the wiring have to include 1 or more ground conductors?

I'm not completely sure, if there is a common ground connection maybe but no way I would trust a connection via who-knows-what, the "ground" could be several volts different. 485 is very forgiving in this regard (that's one reason it's the default standard) but every system I've every seen uses a ground wire in the cable.

AFAIK two wires will usually work but it's not best practice.

Anyone running other protocols on top of RS485??

I'm working on one now, a ring network of Mega1284s.

Anyone using CAT5 for this?

I'm using cat5/6, I need 4 conductors for signal and that leaves 4 to run power.

But I want to get a simple multi-Arduino RS-485 system running sooner..

I'm designing a PCB for a prototype, my network needs two serial ports per node though hence my use of the 1284s. The plus side is reliability, with a redundant ring network you can cut the wire with no appreciable affect on the traffic.


Rob

Following on from the above, I know everyone uses multi-drop for control networks but I have these issues with that topology

• A single short circuit and the entire network is down.
• A single rogue processor and the entire network is down.
• A cut wire and some or all of the network is down.
• Has to be either master-slave or use difficult bus-clash and arbitration techniques.
• If the master dies the entire network is down.

A redundant-ring network has none of those problems, any of the above faults have little or no effect on the network.
It does however require twice as many wires and does insert delays in the data transmission. As I’m more interested in reliability than absolute speed I’ve decided to use a ring topology, despite spending a lot of time designing a multi-drop version at first.


Rob

Hi Rob,

I know you were working on an earlier one... The process you went thru is helping me understand.

Are you using RS-485 4 -wire (Nodes transmit on 1 pair, receive on the other)?

Years ago I worked on IBM Token Ring networks. After a lot of thrashing about GM MAP, Ethernet etc, we went with Token Ring for a new Semiconductor factory. Worked out well, with multiple levels of rings..

I was always uncomfortable with the concept of MAP as a peer-network. Who's in charge in a big system? I used to say, "You can't get 500 guys and build a bridge when you are all peers". I got yelled at by the Manufacturing Strategy guys at headquarters. But you know what?? MAP died, along with DISCO.

Can you point to any of your current work/ideas??

Are you using RS-485 4 -wire (Nodes transmit on 1 pair, receive on the other)?

Yep.

Yes I spent over a year on and off working on a multi-drop/master-slave protocol then finally dropped it in favour of a redundant-ring/peer-to-peer, so I've had to totally rewrite the design.

In the process I've also slashed maybe 80% of the complexity, I want it to be reliable and have no DIP switches to set addresses etc so it's inevitable that some complexities will occur. But I think it will be fairly simple.

I have a finished schematic for a prototyping board and have started the PCB layout.

The design currently uses a Mega1284 at each node, it's not ready for public consumption yet but I'll email you (and anyone with a real interest) a document.


Rob

Rob,
Is RS422 or RS485 better for a 250Kbyte/sec connection over a 100-125' distance? One master, one slave.
Thinking MAXxxx chip on each end with RJ45 connectors.
Thanks

Just a couple of points of reference. Theater lighting control is considered mission critical by those of us who make our living from it. The defacto standard is DMX, specifically constructed packets send via RS485. In some cases it gets finicky BUT if it is deployed according to standards it is VERY robust. I have seen setups that should not work but do because the protocol and RS485 electrical speck are that robust.

Another project I used it on was for some distributed LED signs. I used some RS485 chips to extend 2 pins out to multiple signs. I was using shift out to drive a hand full of 7 segment LEDs in each sign. My system used 2 max485 at each location. 1 for clock and the other for data. The cabling was cat5 with rj45. 2 PR for clock and data, 1 pr for common/ground, and one other pr was +12V with a regulator at each drop to feed the Maxim chips 5V. So far it has worked very well with up to 3 signs and several hundred feet. Over a dozen installs and growing.

Crossroads,

I've not dealt with 422 but for point-to-point I think it's very similar to 485, one big difference (I think) is that the common-mode voltage levels are lower so it would be slightly more prone to ground offset issues.

As I doubt the price is any different between the transceiver types I'd go with 485.


Rob

Thanks Rob!

Is RS422 or RS485 better?

Hi Robert...

Quoting MAXIM, "The great thing about standards is there are so many to choose from." :slight_smile:

Selecting and Using RS-232, RS-422, and RS-485 Serial Data Standards by Maxim: Mixed-signal and digital signal processing ICs | Analog Devices

RS-485 meets all the RS-422 specifications and I always thought that RS-422 was just an early version that is seldom used. Anyone know of RS-422 specific applications?

Anyone know of RS-422 specific applications?

When I worked in the industrial world I ran into 422 far more often than 485. Probably because it's a bit easier to deal with on the software side (no need to turn the transmitter on / off).

Ah but that's comparing point-to-point with multi-drop. If both 422 and 485 are used in the same manner there would be no difference in the software.

Quoting me, "I like standards so much I've decided to design my own" :slight_smile:


Rob

Re: Direction Control:

MAXIM has the "Half-Duplex RS-485-/RS-422-Compatible Transceiver with AutoDirection Control" MAX13487E-MAX13488E

And if you are driving from a PC and USB, the FTDI FT232R (see the data sheet) can automagically control the direction.

This all seems prety interesting so I wanna try my hand at this and learn a bit, and I know there's a whole bunch of rs485 transievers, which do you guys reccomend the most?

Hi, MAX485 is the most popular I think... 75176 is the oldie but goodie... Newer ones are the MAX13487E-MAX13488E mentioned above.

Here are the MAX485 and 75176 on modules: http://goo.gl/S1lFR

The USB interface one uses the 75176 and it's direction is automatically controlled by the FTDI USB Interface, so your PC/MAC application does not need to know about RS-485, just "Serial"..

The "Arduino" / Micro one brings out both Driver Enable and Receiver enable, and the Sketch has to control the driver (as usual)..

I'm just starting to write some code for these; if I have news or examples I'll drop back in here and point to the info...

DISCLAIMER: Mentioned stuff from my own shop...

Hello,
I am very confused about 6 Arduino serial communication using RS485. So can you please help me out how to configure all of them together and make communicating with each other? It will be a great help.
Thank you.