RS-485 Wiring Tips
Use twisted pair shielded wire. Shielded wire is recommended. A signal ground is required. Although RS485 is often thought of as a single twisted pair, you actually need 3 conductors. The RS485 transceivers do not tolerate more than -7V to +12V of common mode voltage. Therefore a ground connection from one device to the next is needed. To limit ground loop current, a 100 ohm resistor should be placed between the ground wire and the ground terminal of the RS485 device.
The RS485 specification says termination is required. This is true for very long networks and/or very high baud rates. Otherwise you can skip it.
Line bias (or polarization) is generally required for proper operation. This is because when the transmitter is switched into transmit mode on an unbiased idle line, the turn-on will look like a start of character to the receiving UART and cause character errors that might not be recovered in time to catch the actual start of character.
Bias is created by placing a pullup resistor to +5V on the Data B (NET+) line, and pulldown resistor to ground on the Data A (NET-) line. Resistor value depends on bias and number of devices on the line, but must be such that 200mV differential between the A and B lines is maintained when the line is idle.
Modbus protocol specification says line termination may be 150 ohms, and line bias resistors must be between 450 and 650 ohms if used. Modbus protocol also suggests using termination of 120 ohms (1/4W) in series with a 1nF capacitor when line bias is used.
Line bias (polarization) must be placed at only one location on the network, and does not have to be at the end of the network. Termination must be at each end of the network.
It is important that “stubs” or taps be very short. The network must be wired in daisy chain style. The stubs are branches off the main network used to connect devices. Keep stubs or taps under 1 meter in length.
Length of network permitted depends on baud rate, wire gauge, and number of devices on the network (or load on network, including bias and termination). As an example, at 9600 baud with AWG26 wire, termination and bias, and 4 devices, the maximum length is 1000 meters according to the Modbus specification for serial line implementation. Other references are going to indicate somewhat different maximum lengths, but 1000 meters is still going to be a reasonable approximation.
When it comes to trouble shooting, it is worth noting that the designation of data lines A and B as defined in the RS485 (EIA-485) specification is opposite the A and B designation used by the transceiver chip data sheets. Consequently, incorrect labeling of equipment is common. If you are not getting any communications, simply try swapping A and B as a test.
General trouble shooting:
(a) If you are getting no communication, check wiring, baud rate, and device addressing.
(b) If you are getting some communications but with a lot of CRC errors, check wiring, termination and line bias. Make sure you have included a ground connection between the devices.
(c) If you are getting communications with few CRC errors but many exception errors (in Modbus), nothing is wrong with wiring check your configuration.