RS485 pinout: Modbus on RJ45 and DB9
The TIA-485 (RS-485) standard defines electrical characteristics only, not a connector. The most used published pinout is Modbus: in 2-wire, D1 (B) on RJ45 pin 4 or DB9 pin 5, D0 (A) on pin 5 or 9, Common on pin 8 or 1. PROFIBUS has its own.
By Hugues Orgitello · Updated ·
Modbus 2-wire RS-485 on RJ45
Pinout required by Modbus over Serial Line V1.02, §3.5.1, for any Modbus device that uses an RJ45; the device carries the shielded female jack. D0, D1 and Common are the names the specification requires in device manuals.
| Pin | Signal | EIA/TIA-485 name | Requirement | Description |
|---|---|---|---|---|
| 1 | - | - | 4-wire only | Not assigned in 2-wire; used by the optional 4-wire variant (Not connected) |
| 2 | - | - | 4-wire only | Not assigned in 2-wire; used by the optional 4-wire variant (Not connected) |
| 3 | PMC | - | Optional | Port Mode Control, optional: leave unconnected unless the device manual assigns it (Configuration) |
| 4 | D1 | B/B’ | Required | Transceiver terminal 1, voltage V1; V1 > V0 for binary 1 (idle) (Differential pair) |
| 5 | D0 | A/A’ | Required | Transceiver terminal 0, voltage V0; V0 > V1 for binary 0 (Differential pair) |
| 6 | - | - | Not assigned | Not assigned by the Modbus RS-485 pinouts (Not connected) |
| 7 | VP | - | Recommended | Positive 5 to 24 V DC power supply (Power) |
| 8 | Common | C/C’ | Required | Signal and power supply common (Ground) |
Modbus 2-wire RS-485 on DB9 (D-sub 9)
Same specification table (§3.5.1), D-shell 9 column: it is neither the RS-232 nor the PROFIBUS pinout. Female socket on the device, male plug on the cable.
| Pin | Signal | EIA/TIA-485 name | Requirement | Description |
|---|---|---|---|---|
| 1 | Common | C/C’ | Required | Signal and power supply common (Ground) |
| 2 | VP | - | Recommended | Positive 5 to 24 V DC power supply (Power) |
| 3 | PMC | - | Optional | Port Mode Control, optional (Configuration) |
| 4 | - | - | 4-wire only | Not assigned in 2-wire; used by the optional 4-wire variant (Not connected) |
| 5 | D1 | B/B’ | Required | Transceiver terminal 1, voltage V1; V1 > V0 for binary 1 (idle) (Differential pair) |
| 6 | - | - | Not assigned | Not assigned by the Modbus RS-485 pinouts (Not connected) |
| 7 | - | - | Not assigned | Not assigned by the Modbus RS-485 pinouts (Not connected) |
| 8 | - | - | 4-wire only | Not assigned in 2-wire; used by the optional 4-wire variant (Not connected) |
| 9 | D0 | A/A’ | Required | Transceiver terminal 0, voltage V0; V0 > V1 for binary 0 (Differential pair) |
An RS-485 interface to design, isolate or protect, or a Modbus line dropping frames? We design the electronics and the firmware and debug it on the scope.
TIA-485 defines no connector
The standard’s title states its scope: TIA-485-A, “Electrical Characteristics of Generators and Receivers for Use in Balanced Digital Multipoint Systems”. It sets driver and receiver levels, the −7 V to +12 V common-mode range and the unit load, not the connector or the pin order. Application standards add those: Modbus, PROFIBUS, or each manufacturer’s manual.
The Modbus specification allows three connection types: screw terminals, RJ45 or D-sub 9. For terminals it sets no order, only that the manual gives the location of each signal under the names D0, D1 and Common. For the RJ45 and the DB9 it requires the two tables above.
A, B, +, −, D0, D1: which wire is which?
On the standard side, line B is the more positive one at idle (binary 1). Modbus calls it D1 and line A D0. Moxa and B+B SmartWorx (Advantech) give the same rule in another form: B is “+”, A is “−”. So does PROFIBUS: B is RxD/TxD-P, the positive line.
Chip makers often follow the opposite convention. On the Texas Instruments THVD1450, a high D input drives pin A high and pin B low: the chip’s A pin therefore goes to bus D1 (B). Schneider Electric likewise notes that the D(B) terminal of its TSX SCA boxes matches D1 “or A (+)”. The label alone is not enough: check the polarity.
Swapping A and B damages nothing, it just stops communication. With the bus biased and idle, measure with a voltmeter: D1 must be more positive than D0.
Termination and fail-safe bias
Modbus requires a termination near each of the two ends of the trunk cable, between D0 and D1, never more than two per pair and never on a derivation cable. It may be a 150 Ω (0.5 W) resistor; a 1 nF capacitor in series with 120 Ω (0.25 W) is better when the line is biased. The TI RS-485 design guide terminates with 120 Ω, the cable impedance the standard recommends.
At idle no driver is active on the pair and receivers can read noise. If a device needs bias, Modbus places one for the whole bus, usually at the master: a pull-up from D1 to 5 V and a pull-down from D0 to Common, 450 to 650 Ω. The number of allowed devices then drops by 4. Many recent transceivers have internal fail-safe, but TI points out its worst-case noise margin is only 10 mV.
2-wire or 4-wire
In 2-wire (half-duplex), one pair carries data both ways: one driver at a time, direction controlled by DE/RE. Modbus calls it the most common configuration. In 4-wire (full-duplex), the master transmits on one pair and the slaves answer on the other.
Modbus states that this 4-wire mode is not RS-422: RS-422 does not allow several drivers on one pair. The cabling must cross the two pairs at the master, and a crossed cable plugged into a 2-wire bus can damage devices. The specification also defines an optional 4-wire pinout (§3.5.2); lacking an independent implementation to cross-check it, we do not reproduce it here.
The third wire: Common, ground and shield
A “2-wire” RS-485 bus has three: Modbus requires a Common conductor between all devices, tied to protective ground at one point only, preferably at the master. Without it, the ground potential difference between nodes can leave the receiver’s common-mode range. For differences of several kilovolts, TI recommends galvanic isolation of the transceiver.
The Modbus cable must be shielded, with the shield tied to protective ground at one end. The recommended color code is yellow for D1, brown for D0 and grey for Common. At 9600 bit/s with AWG26 or thicker wire, the maximum length is 1000 m; Category 5 cable works up to 600 m, and each derivation stays under 20 m.
PROFIBUS and manufacturer pinouts
On DB9, the other standardised RS-485 pinout is PROFIBUS DP: B on pin 3, A on pin 8, data ground on 5, +5 V for the termination on 6. It is detailed on our DB9 pinout page. A Modbus device wired to the specification and a PROFIBUS cable do not talk to each other.
Many manufacturers follow neither. Moxa devices with a DB9 put B on pin 3, A on 4 and ground on 5; the Beckhoff Fieldbus Box Modbus module uses 3, 8 and 5, like PROFIBUS. The Schneider Altivar 212 drive follows the Modbus RJ45 but adds a Common on pin 2. Before any wiring, the device manual is the reference.
FAQ
- Is there a standard RS-485 pinout?
- Not in the RS-485 standard itself: TIA-485-A only defines the electrical characteristics of drivers and receivers. Standardised pinouts come from the protocols. Modbus over Serial Line V1.02 requires its own on RJ45 (D1 pin 4, D0 pin 5, Common pin 8) and on DB9 (D1 pin 5, D0 pin 9, Common pin 1). PROFIBUS DP has another DB9 pinout. Outside those two, each manufacturer chooses.
- A and B, or + and −: which one is D1?
- Per Modbus, D1 is the standard’s line B, the more positive at idle, and D0 is line A. Moxa and B+B SmartWorx call B “+”. But many transceiver chips name their non-inverting output A: on a TI THVD1450, the chip’s A pin connects to D1. If the bus stays silent, swap the two wires: it destroys nothing.
- Does every device need a 120 Ω resistor?
- No, only at the two ends of the trunk cable. Modbus forbids more than two terminations per pair and any termination on a derivation cable. The value follows the cable impedance: 120 Ω in the TI guide; Modbus accepts 150 Ω, or 1 nF in series with 120 Ω when the line is biased. A termination on every device loads the bus and crushes the signal.
- Is the ground wire mandatory in RS-485?
- In Modbus, yes: the specification requires a third conductor, Common, between all devices, tied to ground at one point. The differential pair only tolerates a −7 V to +12 V common mode; without a shared reference, the potential difference between two buildings or two cabinets can exceed it. Over long distances, an isolated transceiver is safer.
- Can a Modbus DB9 device use a PROFIBUS cable?
- Not directly. Both use a DB9 and RS-485, but not the same pins: PROFIBUS puts B on 3 and A on 8, the Modbus specification puts D1 (B) on 5 and D0 (A) on 9. An adapter wired pin by pin from both manuals works; a standard PROFIBUS cable does not. Check the termination too, which PROFIBUS powers from pin 6.
- Modbus Organization, MODBUS over Serial Line Specification and Implementation Guide V1.02 (2006-12-20), section 3
- TIA-485-A, Electrical Characteristics of Generators and Receivers for Use in Balanced Digital Multipoint Systems (paid or members-only document)
- Texas Instruments, The RS-485 Design Guide, SLLA272D (rev. May 2021)
- Texas Instruments, THVD1410/THVD145x RS-485 transceivers datasheet, SLLSEY3E, driver function table
- Schneider Electric, FAQ FA240415: ATS22 RJ45 Modbus port pinout
- Schneider Electric, Altivar 212 Modbus manual S1A53844, RJ45 connector table
- MKS Instruments, MF1 Mass Flow Controller pin-outs (Modbus 2-wire D-sub)
- Moxa, FAQ: connecting a serial device to Moxa 2-wire RS-485 interfaces
- B+B SmartWorx (Advantech), Polarities for Differential Pair Signals, white paper
- Beckhoff, Fieldbus Box x730 Modbus, RS485 connection
Tables built from these documents and cross-checked against manufacturer datasheets. Always check the datasheet of the connector you actually use: some manufacturers number differently.
- Embedded firmware development
- The UART serial link, from frame to electrical level
- DB9 pinout: RS-232, CAN and PROFIBUS DP
- RJ45 Ethernet pinout, T568A and T568B color code
- Electromagnetic compatibility: shielding and ground
Other pinouts
- USB-C
- USB-A, USB-B, Mini and Micro
- RJ45 Ethernet
- M12 industrial
- DB9 (DE-9)
- JTAG and SWD
- HDMI
- Raspberry Pi GPIO
- M.2 (keys M, B and E)
- SD and microSD card
- PCI Express card edge
- SATA
- DDR4 DIMM and SO-DIMM
- DDR5 DIMM and SO-DIMM
- OBD2 (OBD-II, J1962)
- ESP32, S3, C3 and C6
- Bosch ECUs EDC15P+, EDC16C34, MD1CS006
- RJ11, RJ14, RJ12 (6P6C)
- VGA (DE-15) and DVI
- Arduino Uno, Nano and Mega