Most Modbus RTU problems are wiring problems: swapped wires, a missing common, a star layout, too many terminators, or one device on the wrong parity. This guide shows how to wire a bus that works the first time, and what to check when it does not. It follows the two documents that define the rules:
- TIA/EIA-485 (now ANSI/TIA-485-A): the electrical standard for RS-485.
- Modbus over Serial Line Specification and Implementation Guide V1.02 (Modbus Organization): the rules for Modbus RTU on RS-485.
RS-485 basics in one minute
RS-485 sends data on a differential pair: two wires carrying opposite signals. The receiver looks only at the difference between them. Noise usually hits both wires equally, so the difference stays clean, which is why RS-485 works over long distances in noisy plants.
- Half-duplex, 2-wire (+ common). One pair carries data in both directions, but only one device talks at a time. A third conductor, the common, gives all devices the same reference.
- Multi-drop bus. Many devices share the same pair.
- Why Modbus RTU uses it. The master asks and one slave answers: a perfect fit for half-duplex. In the Modbus serial specification, 2-wire is the standard configuration; 4-wire is an optional add-on, rare in practice.
RS-232 vs RS-422 vs RS-485
| RS-232 | RS-422 | RS-485 | |
|---|---|---|---|
| Signal type | Single-ended (to ground) | Differential | Differential |
| Devices | 1 transmitter, 1 receiver | 1 transmitter, up to 10 receivers | Up to 32 unit loads (more with low-load transceivers) |
| Wiring | Point-to-point | Point-to-multipoint, usually 4-wire | Multi-drop, usually 2-wire + common |
| Duplex | Full | Full | Half (2-wire) or full (4-wire) |
| Typical max length | About 15 m (50 ft), limited by cable capacitance | About 1200 m (4000 ft) at low data rates | About 1200 m (4000 ft) at low data rates |
| Typical use | PC console, modems | Long point-to-point links | Modbus RTU, BACnet MS/TP, field buses |
The A/B naming confusion (and the simple fix)
What the standards say:
- TIA/EIA-485 names the lines A and B. A is the inverting line (−) and B is the non-inverting line (+). In the idle state (binary 1, "mark"), B is more positive than A.
- The Modbus serial specification calls them D0 and D1:
- D0 = A / A' (the "−" line)
- D1 = B / B' (the "+" line)
- Common = signal common (C / C')
What you see in the field:
Many manufacturers label the terminals the opposite way (their "A" is +). Others use +/−, D+/D− or TX+/TX−, and some differ between product lines of the same brand.
Practical rules:
- Connect + to + and − to − where labels are clear. Read the device manual, not only the terminal sticker.
- If labels are A/B only, start with A to A and B to B.
- If nothing answers, swap the two data wires. A reversed pair does not damage RS-485 transceivers. It just does not communicate.
The third wire: common (signal ground)
RS-485 is often called "2 wires only", but you should run a third conductor for the common. RS-485 receivers only work within a limited common-mode voltage range (−7 V to +12 V in TIA-485). Devices in different panels or on different supplies can have grounds at different voltages; without a common wire, that difference can exceed the receiver's range, causing errors or damaged ports. The Modbus specification requires the common as the third conductor of its 2-wire bus.
Good practice:
- Connect the common terminal (often marked GND, COM, C, 0V or REF) on every device with a dedicated conductor.
- Do not use the cable shield as the signal common.
- Ground the shield at one point only, usually at the master end or the panel ground bar. Grounding it at both ends can create a ground loop that adds noise. The Modbus specification also recommends tying the common to protective ground at one point only, generally at the master.
- At each device, join the incoming and outgoing shields so the shield is continuous along the bus.
For large ground differences (separate buildings, outdoor runs), use isolated RS-485 interfaces.
Topology: daisy chain only
Line, not star
An RS-485 bus must be a single line (daisy chain). No star wiring and no long branches: each branch acts like an unterminated cable end and creates reflections, especially at higher baud rates.
GOOD (daisy chain):
Master ---- Dev 1 ---- Dev 2 ---- Dev 3
BAD (star):
Dev 1
|
Master -----+----- Dev 2
|
Dev 3
Stubs (derivations)
A short drop from the main cable to a device is what the Modbus specification calls a derivation, and it must never be more than 20 m. With a multi-port tap feeding n derivations, each one is limited to 40 m divided by n. In practice, keep drops as short as possible: ideally loop in and out at the device terminals.
How many devices?
- TIA-485 drivers must handle 32 unit loads. A standard transceiver is one unit load, so that means 32 devices without a repeater (the master counts too). The Modbus specification also allows 32 devices without a repeater.
- Many modern transceivers are 1/2, 1/4 or 1/8 unit load. With 1/8-unit-load devices, the electrical limit can reach about 256 devices, fewer when biasing resistors are fitted, since they also load the bus. Check every device's datasheet; one standard device uses a full unit load.
- Modbus addresses limit you as well: slave addresses are 1 to 247. Address 0 is broadcast (all slaves receive, none reply). 248 to 255 are reserved.
Cable length vs baud rate
The commonly quoted maximum for RS-485 is about 1200 m (4000 ft), which applies only at lower data rates (around 100 kbit/s and below). The faster you go, the shorter the cable. The Modbus specification gives 1000 m at up to 9600 baud with AWG26 (or thicker) cable, and notes that the length depends on baud rate, cable, number of loads and configuration.
Cable: what to use
Use shielded twisted pair with a characteristic impedance of about 120 Ω. Examples made for RS-485 include Belden 3105A (1 pair, 22 AWG, 120 Ω) and Belden 9841 (1 pair, 24 AWG, 120 Ω).
What you need:
- One twisted pair for the data lines (D1/+ and D0/−). Both data wires must be in the same pair.
- One more conductor for the common. Single-pair cables like the two above need an extra conductor, so a "1.5 pair" cable (such as Belden 3106A) or a 2-pair cable is often more convenient.
- A shield, grounded at one point.
The Modbus specification states that AWG24 is always sufficient for the data pair over the full 1000 m, and that an impedance above 100 Ω may be preferred, especially at 19200 baud and above. 120 Ω cable meets both and matches standard termination.
Avoid: untwisted cable, data split across two pairs, and runs beside power or VFD cables.
Termination and biasing
Termination: 120 Ω at both ends only
A long cable at a high baud rate behaves like a transmission line: without a matching resistor at each end, the signal reflects and corrupts data.
- Place a 120 Ω resistor between D1 and D0 at the two physical ends of the bus (the first and last device on the cable).
- Never terminate in the middle or on a stub, and never fit more than two terminators.
- The Modbus specification allows a 150 Ω (0.5 W) resistor, and calls a 120 Ω (0.25 W) resistor in series with a 1 nF capacitor the better choice when the line is biased (the capacitor blocks DC load). In practice, 120 Ω matches most RS-485 cables.
- Many devices have a termination switch or jumper. Turn it ON only at the two ends.
A short bench cable at 9600 or 19200 baud usually works without termination. On a real site, terminate anyway.
Biasing (polarization or fail-safe)
When nobody transmits, the bus "floats" and receivers may read noise as data (framing or CRC errors). Biasing holds the line idle:
- A pull-up resistor from D1 (+) to 5 V
- A pull-down resistor from D0 (−) to common
The Modbus specification says that if any device needs biasing, it is applied at one point only for the whole bus, generally at the master, with resistors between 450 Ω and 650 Ω. It also reduces the allowed device count by 4.
Notes:
- Many USB adapters, gateways and controllers have built-in biasing, often with a switch.
- Many modern transceivers have "fail-safe" receivers and need less (or no) external biasing.
- Too many bias or termination resistors overload the bus and communication fails. Check each device's DIP switches.
Serial settings: everyone must match
Every device on one bus must use the same:
- Baud rate (9600, 19200, 38400 and so on)
- Data bits (8 for Modbus RTU)
- Parity (even, odd, or none)
- Stop bits (1 or 2)
What the Modbus specification says:
- Default: 19200 baud, even parity (8E1). 9600 and 19200 are the required rates (the minimal "basic" device class needs only 9600, and then defaults to it).
- Even parity is required and is the default; odd and no parity are optional.
- No parity requires 2 stop bits (8N2), so every character stays 11 bits long.
In the real world, many devices ship at 9600 8N1. When devices disagree, pick one setting and apply it everywhere.
Other rules:
- Every slave needs a unique unit ID (1 to 247). Duplicate IDs answer together and corrupt both replies.
- Address 0 is broadcast: write commands only, and no device replies.
- Only one master per bus.
Wiring diagram
Master with biasing, three slaves, termination at both physical ends:
+5V
|
[Rb] 450-650 Ω (pull-up)
|
MASTER | SLAVE 1 SLAVE 2 SLAVE 3
(PC/PLC) | ID 1 ID 2 ID 3
|
D1 / B / + ---+----------------+----------------+----------------+-----+
| | | | |
[Rt] (no terminator) (no terminator) [Rt]
120 Ω 120 Ω
| | | | |
D0 / A / - ---+----------------+----------------+----------------+-----+
|
[Rb] 450-650 Ω (pull-down)
|
COMMON -------+----------------+----------------+----------------+
|
GND
SHIELD ======(grounded here only)=====+================+================+
(shields joined, not grounded at slaves)
Connection checklist
| Check | OK? |
|---|---|
| Cable is shielded twisted pair, ~120 Ω, data on one pair | ☐ |
| D1/+ to D1/+ and D0/− to D0/− at every device (labels verified in manuals) | ☐ |
| Common wire connected to every device | ☐ |
| Daisy chain, no star, stubs as short as possible | ☐ |
| 120 Ω termination at the two physical ends only | ☐ |
| Biasing at one point only (usually the master) | ☐ |
| Shield continuous and grounded at one point | ☐ |
| Same baud rate, parity and stop bits on every device | ☐ |
| Unique unit ID on every slave (1 to 247) | ☐ |
| Bus cable separated from power and VFD cables | ☐ |
Connecting a PC or Raspberry Pi
USB to RS-485 adapters
A USB to RS-485 adapter is the easiest option. Look for:
- A known chip, such as FTDI FT232R or WCH CH340, with Windows and Linux drivers.
- Automatic direction control of send/receive, done in hardware.
- Isolation for panel work, against ground differences.
- Clear terminals for D+/D−/GND, plus switches for termination and biasing.
Windows: the adapter appears as a COM port under "Ports (COM & LPT)" in Device Manager. If not, install the chip vendor's driver. The number can change on another USB port.
Linux / Raspberry Pi: FTDI and CH340 adapters appear as /dev/ttyUSB0, /dev/ttyUSB1, and so on; adapters using the USB CDC-ACM class appear as /dev/ttyACM0. Use the stable name under /dev/serial/by-id/ so the path does not change after a reboot. Your user usually needs to be in the dialout group.
Raspberry Pi GPIO
The Raspberry Pi UART pins (GPIO14 TX, GPIO15 RX) use 3.3 V logic and cannot drive an RS-485 bus by themselves. You need a transceiver:
- A MAX3485 (or similar 3.3 V transceiver) works directly with the Pi.
- A MAX485 is a 5 V part. Powered at 5 V, its receiver output is 5 V, which the Pi's GPIO pins do not tolerate, so cheap MAX485 modules need level shifting (or a 3.3 V part instead).
- An RS-485 HAT combines transceiver, protection and sometimes isolation on one board.
The transceiver's DE/RE pins (driver/receiver enable) select send or receive. Either the board switches direction automatically, or a GPIO pin (or RTS) must switch it at the right time. Wrong timing cuts off frame ends, so for field use prefer automatic direction control.
Bench test: two USB adapters and a simulator
A bench test is the fastest way to learn your tools before going on site. You need: two USB to RS-485 adapters, a short twisted pair, and a PC (or a PC and a Raspberry Pi).
- Wire the two adapters together: A to A, B to B, and GND to GND.
- Note the two port names (for example COM5 and COM6).
- On the first port, run a slave simulator. ModLens Sim can create a simulated RTU device with moving values, or values from a CSV, Excel or JSON file. It can also run on a Raspberry Pi with a USB-RS485 adapter.
- On the second port, run your master tool with the same baud rate, parity and stop bits. In ModLens, use the Scanner to search unit IDs, then read some registers.
- Make the classic errors on purpose (swap A and B, change parity on one side, poll a wrong ID) so you recognise them on site.
Troubleshooting table
| Symptom | Likely cause | Fix |
|---|---|---|
| No response, timeouts on every device | A/B swapped; wrong COM port; wrong baud/parity; wrong unit ID | Swap D+/D−; confirm port; match serial settings; scan IDs |
| No response from one device only | Wrong ID or serial setting on that device; loose wire; no power | Check device menu or DIP switches; check terminals |
| Garbage data, CRC or framing errors | Parity/stop bit mismatch; missing biasing; missing common; noise | Match 8E1/8N2/8N1 on all devices; add biasing at master; connect common |
| Works on a short cable, fails at long distance | No termination; baud too high; poor cable; long stubs | 120 Ω at both ends; lower baud; use 120 Ω twisted pair; shorten stubs |
| One device "kills" the whole bus | Faulty transceiver; bias/termination ON in the middle; duplicate ID; device set as master | Disconnect devices one by one; check its switches and ID |
| Intermittent errors when motors or VFDs run | Noise coupling; ground difference; shield grounded at both ends | Separate from power cables; connect common; ground shield at one point; use isolated interfaces |
| Exception code 1 (Illegal Function) | Device does not support that function code (for example FC03 vs FC04) | Try the other read function; check the register map |
| Exception code 2 (Illegal Data Address) | Register does not exist; 0-based vs 1-based offset; reading past the end of a block | Try address −1 / +1; read fewer registers; check the map |
| Values look wrong (huge or negative numbers) | Wrong data type, byte/word order or scaling | Test 16-bit, 32-bit, float, signed, swapped orders and scale factors |
Note: an exception reply is good news for wiring. The device heard you; the problem is in the request, not the cable.
For wrong-looking values, compare one register with a known value, such as a temperature on the device display. The Find a value tool in ModLens searches registers for a known value across all common data types and byte orders, and the Explorer shows every interpretation of a register side by side.
FAQ
Can I connect RS-485 with only two wires and no common?
Sometimes, when all devices share one supply, but it is not reliable. Always run a common wire.
Will swapping A and B damage anything?
No. A reversed pair simply does not communicate.
Do I need termination resistors on a short cable?
Not on a short bench cable. On site, put 120 Ω at both physical ends.
What are the default Modbus RTU serial settings?
The specification default is 19200 baud, 8E1; many devices ship at 9600 8N1. Make every device match.
How many Modbus devices can I put on one RS-485 bus?
32 standard devices without a repeater; more with 1/4 or 1/8 unit-load transceivers, up to 247 slaves. In practice, polling time is often the real limit.
Summary
A reliable bus comes down to a few rules: one twisted pair for data, a common wire, a daisy chain, 120 Ω at both ends, biasing at one point, the same serial settings everywhere, and a unique ID on every device. When something fails, check polarity, then serial settings, then termination and biasing.