Influence of cable type and breadboard design on max cable length of RS485 connection with multiple slaves

Hello everyone,

I am setting up a series of serial slaves which shall communicate with an arduino or RPi master via RS485 and I am having some trouble finding out the suitable cable-converter-connector combination for ideal communication. Please see my introduction and a set of questions below.

I noticed pretty quickly that the rs485 is the much safer method for longer cable lengths than the native ttl.
For the start I used additional modules and was following this tutorial which worked perfectly:
RPi to Arduino Communication via RS485
I could even communicate through a long parallel (non-twisted) cable consisting of multiple extention parts which should be the absolute worst case.
To save some space and setup time in my later application I designed a pcb with the module included. I used this schematic for the rs485 module and added all the neccessary components to my pcb.
However the final pcb does work with shorter cables so the circuit should be allright but not with nearly as long cables as the setup with the external modules. The master seems to be unable to recieve all the serial bytes or none at all.
The complete system then somewhat looks like this:


For cables (1) I use simple 4-Pole parallel calbles because those worked on the first try as well, JST-XH connectors on the boards (2) for the serial chain. Of course there are some other components (3) on the board (voltage regulator with capacitors, some transistors for triggering other devices, some resistors etc.).

Now I have a set of questions:

  1. What influence does the cable type really have when it is only a distance of 10-20meters? Is there really already a need for twisted calbes or even shielding?
  2. Is the daisy-chain like setup with all its different connectors somehow harmful for the communication performance? I plan to add up to 15 slaves.
  3. Can the pcb layout influence the communication? E.g. other components like voltage regulators or any capacitors which might somehow interfere or the track width and spacing on the board itself.

I hope someone can share his/her experience on this.

Thanks in advance and best regards,
Felix

That depends on the frequencies involved and thus the data rate. At 9600 baud probably not much. At 1000000 baud probably enough to matter. Unfortunately I cannot put actual numbers to it, but maybe someone else can. Twisted pairs minimise interference, they reduce the interference given out by one circuit, they minimise the interference picked up by an adjacent circuit and they minimise the interference picked up from the environment. Whether that's relevant in your situation I do not know, but why would you even consider not using twisted pair cable when it is so ubiquitous as both telephone cable and cat 5 cable?

Not much. However, the resistors need to be at the end of the chain. Again, frequency is everything and 9600 baud is probably OK whatever you do, higher frequencies might be a problem. resistors should be at the ends to remove reflections (as in the page you linked to RS485-Modules - ArduinoInfo ).

I would not think an effects would be significant at the speeds I guess you are working at (which you have not stated).

1 Like

Thanks for the quick reply! I used the non-twisted ones because they were much easier to get with the right connectors.
I do not have any large requirements regarding speed an I am currently testing at 9600 baud. Since I do not need to transmit a lot of data I could even further reduce that if needed.
Any other opinions or confirmations are highly appreciated :slight_smile:

Strange. Can you not put the connectors on yourself?

I would doubt that over the distance concerned that the cable type would have much effect but I cannot say that with confidence. Something I learned a long time ago is if something doesn't work the way you want and there is something you know for sure is not right you don't spend time trying to decide if the thing you know isn't right is causing the problem you are having, you just get on and fix the known problem(s). In your case you don't have twisted pairs so fix that. If you still have a problem when you've replaced the cable then come back and ask for more help.

The limiting factor is the capacitance of the wiring. Back when RS-232 was king, 50ft was the limit for 9600bps. By using wire with thicker insulation and lower twist of the pair, you could get 100 ft because the capacitance was lower.
All this difference is because the signal was polar, reversing from + to - and the line drivers had to reverse the charge on the wire pair. This took time, making the signal not a square wave, but one with sloping sides.
Same applies to any serial communication over wires. Speeds were increased when driver devices could switch faster and supply more current.
So measure the capacitance of the wire pair and that will directly relate to the bit rate it will support with a particular driver.
Paul

1 Like

Is it enough to twist the signal pair and leave the power supply straight for a prototype or is it neccessary to have all as twisted pairs?

The easiest is just to use UTP cable, with low capacitance and twisted pair.

Well really with capacitance (what the RS485 specification is meant to reduce/counter act), you need to add up all of the capacitance in the chain. If you have 15 slaves all 20 meters apart, that comes down to a total of 300 meters. Plus the connectors, though being made of solid metal, they don't add to much.
with CAT-5 UTP you should be able to get up to 300meters at 250kbps and reduce the baud-rate by half should double your distance.
DMX which uses cable with slightly higher capacitance (but twisted), is transmitted at 250kbps, and is more or less guaranteed to work with chains up to 100 meters (it includes a lot of big XLR plugs) but usually much longer. For more info look at Capacitance Wikipedia and Twisted Pair Wikipedia

It can of course, but if you have the in/outputs of the transceiver near the edge you should not have to be bothered about it. The A & B traces should not be wide of course, they are for 'signal' not power.
Important is that they connected to a stable power source.

It is the data pair that needs to be twisted together. No need to twist the power wires.

However, it is important to avoid loops in wiring as loops act like aerials for noise. For this reason the data pair and power wires need to be kept together in one cable.

I repeat what I have said before and others have said: use twisted pair cable!

For the power make sure there is at least a 0μ1 capacitor across each chip as physically close to the power pins as possible. If you are using ready made module then the capacitors will (should) be included.