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:
- 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?
- 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.
- 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,