RS485 Interface: Wiring, Pins, and Two-Wire vs. Four-Wire Connections

RS485 Interface: Wiring, Pins, and Two-Wire vs. Four-Wire Connections

If the equipment communicates correctly on the bench but stops responding after installation, the problem may not be the controller or the device. RS485 wiring depends on topology, cable routing, termination resistors, and grounding. A misconnected A/B pair, missing termination, or incorrect reference can all create symptoms that look like communication failures but are actually wiring issues.

An RS485 interface is widely used in industrial equipment because it can support multiple devices on the same bus and operate over longer distances than standard UART or USB. But that flexibility introduces wiring decisions that do not exist with point-to-point connections. Understanding the difference between two-wire and four-wire configurations, how A and B signals function, and where to place termination resistors can prevent debugging loops that start with firmware but end with cable routing.

What Is an RS485 Interface?

RS485 is a differential serial communication standard that transmits data over a pair of twisted wires, typically labeled A and B. The receiver measures the voltage difference between these two wires rather than referencing voltage to ground. That differential approach reduces the effect of common-mode noise, which makes RS485 more resistant to electrical interference than single-ended signals.

The standard supports multi-drop bus topologies, which means multiple transmitters and receivers can share the same cable. Unlike point-to-point protocols, RS485 requires careful attention to bus structure, termination, and device addressing.

A typical RS485 transceiver converts UART signals from an MCU or controller into differential voltage levels on the bus. When transmitting, the driver raises the voltage on one line and lowers it on the other. When idle, the driver enters a high-impedance state so other devices can control the bus.

RS485 itself does not define protocol, baud rate, or device addressing. Those parameters are determined by the application layer, such as Modbus RTU, which is commonly implemented over RS485 hardware. If you are deciding between the two interfaces, see our guide to RS232 vs RS485 for a comparison of their electrical characteristics, communication distance, data rates, and supported network configurations.

The physical layer allows cable lengths up to approximately 1,200 meters at lower baud rates, but practical distance depends on cable quality, baud rate, number of devices, and electrical environment.

RS485 A and B Signals Explained

The A and B lines carry differential signals. When the driver transmits a logic 1, line A is typically more positive than line B by at least 200 millivolts. When the driver transmits a logic 0, line B becomes more positive than line A.

The receiver evaluates the voltage difference. If A is higher than B by the threshold amount, the receiver interprets a logic 1. If B is higher than A, the receiver interprets a logic 0.

This method rejects noise that affects both wires equally. If external interference adds 500 millivolts to both A and B, the differential voltage between them remains unchanged, and the receiver still sees the correct signal.

Polarity matters. If A and B are reversed at any device on the bus, that device will see inverted data. The symptom may not be complete silence. The device may respond intermittently, produce corrupt data, or fail only at certain baud rates. This makes polarity reversal one of the more frustrating wiring problems, because it can appear to work during initial testing but fail under load.

Some transceivers label the lines as D+ and D−, or TX+/RX+ and TX−/RX−, depending on whether the configuration is two-wire or four-wire. The electrical principle remains the same: differential voltage determines the data state.

Check the datasheet for the transceiver used in both the controller and the device. Not all transceivers label A as the more positive line during a logic 1. In some cases, the labels may be reversed, or the physical connector may not match the schematic label.

Two-Wire vs. Four-Wire RS485 Wiring

Two-wire RS485 uses a single twisted pair for both transmit and receive. All devices share the same A and B lines. This is the most common configuration for multi-drop networks. Each device must enable its driver only when transmitting, then return to a high-impedance state so other devices can use the bus. This requires software control of the driver enable pin, often referred to as DE or RE.

Two-wire systems are electrically simple, but the protocol must include timing or addressing to prevent bus collisions. Modbus RTU, for example, uses a master-slave model where only the master initiates communication, and each slave responds only when addressed.

Four-wire RS485 uses separate twisted pairs for transmit and receive. One pair carries data from the master to the slave, and the other carries data from the slave to the master. This allows full-duplex communication, which eliminates the need for driver enable control and simplifies timing.

Four-wire systems typically support only point-to-point or simple multi-point configurations. They require more cable and more connector pins, but they avoid bus contention.

Consider a controller connected to an HMI display module. If the display only receives commands and sends responses on request, a two-wire configuration is sufficient. If the display must simultaneously send asynchronous data while receiving updates, a four-wire configuration may reduce firmware complexity.

The choice affects cable routing, connector count, and driver enable logic. A two-wire system that works correctly in a controlled test environment may experience intermittent failures if driver enable timing is incorrect. The symptom often appears as garbled data or missing responses rather than a clean failure.

RS485 Bus Topology and Device Connections

RS485 works best with a linear bus topology. The cable runs from one end of the network to the other, and devices connect along the way using short stubs or direct taps.

Star topologies, where multiple cables branch from a central point, introduce reflections. Each branch creates an impedance discontinuity that reflects part of the signal back toward the source. At higher baud rates, these reflections interfere with the transmitted signal and corrupt data.

Reflections increase with stub length and baud rate. At 9,600 baud, a 2-meter stub may not cause visible problems. At 115,200 baud, the same stub length may produce bit errors.

If the equipment layout requires a branched topology, consider lowering the baud rate, shortening the stubs, or testing with an oscilloscope to check for signal integrity problems before production release.

Daisy-chaining devices along a single cable minimizes reflections. Each device should have an input connector and an output connector, with the bus passing through the device rather than branching to it. Some industrial equipment provides screw terminals for this purpose, allowing the bus to enter and exit without requiring a custom splitter cable.

When routing the cable, avoid parallel runs near power wiring. Even with differential signaling, high-current switching on adjacent cables can induce enough noise to affect communication. If the cable must cross power lines, do so at a right angle rather than running parallel for long distances.

Document the bus topology during commissioning. A schematic that shows cable routing, device order, and termination locations can save hours of troubleshooting if a problem appears later during installation or maintenance.

Termination Resistors and Biasing

RS485 buses should be terminated at both ends with resistors that match the characteristic impedance of the cable, typically 120 ohms. These resistors absorb signal energy at the ends of the bus and prevent reflections from traveling back along the cable.

Without termination, high-frequency components of the signal reflect from the cable ends. These reflections interfere with the transmitted waveform, especially at higher baud rates or longer cable lengths. The symptom is often intermittent communication or increased error rates during high traffic.

Place one 120-ohm resistor between A and B at each end of the bus. Do not place termination resistors at devices in the middle of the bus. Only the two physical ends require termination.

Some transceivers include built-in termination that can be enabled with a jumper or switch. If the transceiver does not provide this feature, install discrete resistors at the connector or terminal block.

Biasing resistors are sometimes added to pull the bus into a defined idle state. When all devices are in a high-impedance state, the bus voltage may float into an undefined region, which can cause the receiver to interpret noise as data. A bias network typically includes a pull-up resistor from A to Vcc and a pull-down resistor from B to ground, creating a small differential voltage that holds the bus in a known idle state.

Not all systems require biasing. If the bus operates correctly without it, adding bias resistors will not improve reliability. But if the system experiences false start bits or noise-triggered communication when the bus is idle, bias resistors may solve the problem.

Check the transceiver datasheet for recommended bias values. Incorrect biasing can load the driver and reduce noise margin.

Common RS485 Wiring Problems

Reversed A and B at one device. This does not always prevent communication. At very low baud rates with short cables, the system may still work because the transceiver’s noise margin can tolerate a partially inverted signal. But as baud rate or cable length increases, bit errors accumulate. Check polarity at every device, not just at the controller.

Missing termination resistors. The system may work on the bench with short cables and low baud rates, but fail during installation with longer cables. If communication becomes unreliable after moving the equipment into the cabinet, check for termination at both ends of the bus before replacing hardware.

Termination at the wrong location. If the bus physically extends beyond the device where termination is installed, the unterminated section acts as a stub and introduces reflections. Verify that termination is installed at the actual physical ends of the cable, not at the first and last devices in the addressing scheme.

Missing ground reference. Although RS485 is a differential standard, some common-mode voltage reference between devices can be necessary, especially over longer distances or in noisy environments. If the devices do not share a ground, the common-mode voltage may exceed the transceiver’s input range, causing communication failures. Connect the ground terminals of all devices to a common reference, but avoid creating ground loops that carry high current.

Incorrect driver enable timing. In two-wire systems, the driver must switch to high-impedance mode after transmitting the last bit. If the driver remains enabled too long, it will interfere with the response from the other device. If the driver disables too early, the last bit may not be fully transmitted. Test driver enable timing with an oscilloscope and adjust the delay if necessary.

How to Connect an RS485 HMI to a Controller

Connecting an RS485 HMI to a controller requires matching the communication settings, wiring the A and B lines correctly, and ensuring the bus topology supports the system configuration.RS485 is often chosen for industrial installations that require longer cable runs or multiple connected devices, while RS232 is commonly used for point-to-point connections. For a detailed comparison of both interfaces, read our guide to the differences between RS232 and RS485.

Start by confirming the baud rate, data bits, stop bits, and parity settings on both devices. If these parameters do not match, communication will fail or produce corrupt data. Many HMI modules allow configuration through software or jumpers, so verify the actual settings rather than assuming default values.

Connect the A line of the HMI to the A line of the controller, and the B line of the HMI to the B line of the controller. If the system uses a two-wire bus with multiple devices, daisy-chain the connections rather than creating a star topology.

If the HMI is located at the end of the bus, install a 120-ohm termination resistor between A and B at the HMI. If the HMI is in the middle of the bus, do not install termination.

For some intelligent HMI modules, such as those integrating a display, touch interface, and embedded controller, the communication architecture can simplify system integration. For example, STONE’s intelligent TFT LCD display modules communicate with MCU platforms like STM32 or Arduino using a UART serial interface, which can be connected to an RS485 transceiver to support multi-drop or long-distance installations. Because the display module handles the graphical rendering and touch input internally, the MCU firmware only needs to manage the command protocol and data exchange over the serial link, reducing the complexity of both the wiring and the firmware.

If the controller does not have a built-in RS485 transceiver, add an external transceiver module between the controller’s UART and the RS485 bus. Connect the UART TX and RX lines to the transceiver’s transmit and receive inputs, and connect the transceiver’s A and B outputs to the bus. If the transceiver requires driver enable control, connect the enable pin to a GPIO on the controller and manage the timing in firmware.

Test communication at a low baud rate first, such as 9,600 baud. If that works, increase the baud rate incrementally while monitoring for errors. If communication fails at higher baud rates, check cable quality, termination, and stub lengths before assuming a hardware problem.

During commissioning, verify that the HMI responds consistently under repeated communication cycles. If the HMI works for several minutes and then stops responding, check for driver enable timing issues, thermal conditions inside the enclosure, or ground potential differences between devices.

Frequently Asked Questions

What is the maximum distance for RS485 communication?

RS485 can support distances up to approximately 1,200 meters at lower baud rates, typically 9,600 baud or below. As baud rate increases, the maximum distance decreases due to cable capacitance, attenuation, and signal timing requirements. The practical limit also depends on cable quality, transceiver type, and the number of devices on the bus. For long distances, use twisted-pair cable with low capacitance and verify signal integrity with an oscilloscope before relying on the system in production.

Do I need termination resistors on a short RS485 bus?

Termination resistors are most important at higher baud rates and longer cable lengths. On a very short bus with a low baud rate, the system may work without termination because reflections do not have time to interfere with the transmitted signal. However, installing 120-ohm termination resistors at both ends of the bus is good practice even on short networks, because it ensures reliable operation if the baud rate is increased or the cable is extended later.

Can I use an RS485 interface with different baud rates on the same bus?

No. All devices on an RS485 bus must operate at the same baud rate. The physical layer does not support multiple baud rates on the same cable. If the system requires devices with different baud rates, use separate buses or a gateway device that translates between them.

What happens if I connect A to B and B to A?

Reversing the A and B connections at any device will invert the data seen by that device. Depending on the protocol, transceiver noise margin, and baud rate, the system may fail completely, work intermittently, or produce corrupt data. Check polarity at every device on the bus, and verify with an oscilloscope if communication is unreliable.

Why does my RS485 system work on the bench but fail after installation?

The most common causes are missing or incorrect termination, ground potential differences between devices, interference from nearby power cables, or changes in cable routing that introduce stubs or reflections. Compare the bench setup to the installed configuration and check for differences in cable length, topology, and grounding. If the installation uses a longer cable or adds more devices, verify that termination is installed only at the physical ends of the bus.


If the system still does not communicate after checking baud rate, polarity, termination, and topology, return to the signal level and verify with an oscilloscope that the differential voltage is within the transceiver’s input range. If the project has reached repeated integration delays or requires a faster solution under delivery pressure, external engineering support can help isolate the problem without replacing hardware unnecessarily.

    Scroll to Top