Skip to content
IoT Crest

RS-485 explained: wiring, termination and how the bus works

Published , 11 min read

Short answer: RS-485 is an electrical standard for sending serial data over a twisted pair as the difference between two wires, which lets many devices share one cable over distances up to about 1,200 meters. It defines voltages and loads only; a protocol such as Modbus RTU runs on top. Most problems come from wiring: a missing terminator, a star layout, swapped A and B, or no common ground.

RS485 explained: differential signaling on a twisted pair, the A and B lines, termination and biasing, cable length against speed, and RS-485 vs RS-232.

This article covers what RS-485 defines, how differential signaling rejects noise, the A and B naming muddle, two-wire and four-wire buses, termination, biasing and grounding, distance against data rate, how it compares with RS-232 and RS-422, and how an IoT gateway reads an RS-485 network. It does not cover transceiver selection for a specific board, the electrical design of isolation barriers, or any particular vendor's register map.

RS-485 is a standard for the electrical side of serial communication. It sends each bit as the voltage difference between two wires in a twisted pair, so that electrical noise from motors and drives, which shifts both wires together, cancels out at the receiver. Because of that, one RS-485 cable can run for hundreds of meters through a plant and connect dozens of devices: energy meters, temperature controllers, variable speed drives, flow meters and PLCs. This article explains what the standard does and does not define, how the bus is wired, why termination and biasing matter, how far and how fast it goes, how it compares with RS-232 and RS-422, and how an IoT gateway reads the devices on it.

What RS-485 is, and what it is not

RS-485 was published by the Electronic Industries Association in 1983 and is now maintained by the Telecommunications Industry Association as TIA-485-A. The full name of the current document is long, and nearly everybody still calls it RS-485 or EIA-485.

The standard covers the physical layer only. It sets out the voltages a driver must produce, the voltages a receiver must recognize, the range of ground offset the parts must tolerate, and how much load each device may put on the line. It does not say anything about baud rate, byte format, addresses, message structure, error checking or who is allowed to talk when. Those come from whatever protocol runs on top of it.

That is why “Is RS-485 the same as Modbus?” is such a common question. Modbus RTU is a protocol, and RS-485 is the most common wire it travels over; the Modbus RTU article covers the protocol side. Other protocols use RS-485 too: PROFIBUS DP in factory automation, BACnet MS/TP in building controls, and DMX512 in stage lighting, among others. Two devices that both have an RS-485 port can only talk if they also share a protocol, a baud rate and a byte format.

Differential signaling: why RS-485 copes with noise

A single-ended interface such as RS-232 sends each signal as a voltage on one wire, measured against ground. Any noise picked up on that wire, or any difference between the ground at each end, adds straight onto the signal.

RS-485 uses two wires for each signal and drives them in opposite directions. When one goes up, the other goes down. The receiver ignores the absolute voltage on either wire and looks only at the difference between them. Noise from a nearby motor cable lands on both wires of a twisted pair almost equally, because they run so close together, so it moves both by the same amount and the difference stays the same. Twisting the pair also means each wire spends equal time nearer the noise source, which keeps the pickup balanced.

Differential signaling on one twisted pair noise hits both wires B A receiver reads B minus A: above +200 mV is 1, below -200 mV is 0 B-A 1 0 1 1 0 the spike moves both wires together, so the difference does not change
Diagram: the two wires of an RS-485 pair carry opposite copies of the same bit stream. A burst of noise shifts both wires by the same amount at the same moment; the receiver subtracts one from the other, so the noise cancels and the bits come out clean. A difference above 200 millivolts reads as one state and below minus 200 millivolts as the other.

The numbers in the standard reflect that design. A driver must put at least 1.5 volts of difference across the pair when the line is fully loaded and terminated, and a receiver must decide correctly when the difference is as small as 200 millivolts. That leaves a wide margin for losses along the cable. Receivers must also work with each wire anywhere between minus 7 and plus 12 volts relative to their own ground, the common-mode range, which is what lets devices with somewhat different ground potentials share a bus.

The A and B lines, and why they get swapped

The standard names the two wires A and B. In its terms, A is the inverting line and B the non-inverting one, and the idle state, a logic 1, is when B is more positive than A.

Many transceiver makers label their pins the other way round, and some equipment uses D+ and D-, or Data+ and Data-, instead. The result is that A on one device is not always A on the next. Swapping the two wires does no damage; the devices simply cannot understand each other. When a new RS-485 link shows nothing at all, or only garbage, swapping A and B at one device is one of the first things to try, before anything more elaborate.

Two-wire and four-wire RS-485

The usual RS-485 network is two-wire, half-duplex: one twisted pair carries data in both directions, and only one device may transmit at a time. Each transceiver has a driver enable input, and a device switches its driver on only while it is sending, then switches it off so others can use the line. The time a device takes to release the line after its last bit, and the time the other side waits before answering, is called turnaround, and getting it wrong cuts off the end of messages.

A four-wire, full-duplex network uses one pair for each direction: the master transmits on one pair to every other device and listens on the other. It avoids turnaround but doubles the cabling, and it is less common in the field.

“Two-wire” is a slightly misleading name, because a reliable two-wire network needs a third conductor, a signal common that ties the grounds of the devices together. Without it, the ground offset between distant devices can drift outside the common-mode range, and the bus fails intermittently, often only when a large machine starts. Many cables for RS-485 have a twisted pair plus a drain or third wire for exactly this reason.

Wiring the bus: daisy chain, termination and biasing

RS-485 is designed as a single line with devices along it, a bus or daisy chain, and the trunk should run from the first device to the last without branches. Each device connects to the trunk with a stub that is as short as possible. A star layout, with separate cables running out from a central point, creates several cable ends that reflect signals back along the line, and it often works at low speed and then fails when the network grows or the baud rate goes up.

A two-wire RS-485 bus one trunk, short stubs, a terminator at each physical end gateway or PLC the master energy meter address 1 temp controller address 2 A B GND 120 Ω 120 Ω bias resistors, usually at the master, hold the idle bus in a known state the dashed line is the signal common that ties the device grounds together
Diagram: a two-wire RS-485 network. A gateway or PLC and two field devices connect by short stubs to one trunk made of a twisted pair, A and B, plus a signal common. A 120 ohm resistor across the pair at each physical end of the trunk absorbs reflections; bias resistors, usually fitted at the master, keep the line in a defined idle state when nobody is transmitting.

Termination. A twisted pair has a characteristic impedance, around 120 ohms for cable sold for RS-485. When a signal reaches the end of a cable that is not terminated, part of it reflects back and collides with the bits that follow. A resistor matching the cable’s impedance, normally 120 ohms, fitted across A and B at each of the two physical ends of the trunk absorbs the signal instead. Only the two ends get one. Fitting a terminator at every device, which happens when every device has a termination switch and they are all left on, loads the line so heavily that the drivers can no longer produce enough voltage. On short runs at low baud rates, termination matters less, which is why badly terminated networks sometimes work until they are extended.

Biasing. On a half-duplex bus there are moments when no driver is switched on. Left alone, the pair floats, and the receivers may see random noise as data, usually as a burst of garbage before every message. Bias resistors, sometimes called fail-safe or pull-up and pull-down resistors, pull one wire up and the other down just enough to hold the idle line clearly in the logic 1 state. They are normally fitted once on the network, often at the master or built into it. Many current transceivers have fail-safe receivers that treat an idle or shorted line as a 1, which reduces the need for external bias, but mixed old and new equipment still benefits from getting it right.

Isolation and surge protection. Field cables in a plant run past motors and drives and between buildings, and a ground fault or a nearby lightning strike can put large voltages on them. Industrial RS-485 ports are often galvanically isolated, so the bus side floats separately from the device’s own electronics, and long outdoor runs get surge protection at each end. A cheap non-isolated USB adapter on a laptop is fine for a bench test and a poor choice for a permanent connection to a live plant network.

How many devices, how far and how fast

The standard measures load in unit loads. One unit load is a receiver with an input resistance of about 12 kilohms, and a driver must be able to drive 32 of them. Older transceivers count as one unit load each, which is where the familiar limit of 32 devices comes from. Many current transceivers are rated at a quarter or an eighth of a unit load, which allows up to 128 or 256 devices on one segment. Protocols have their own limits on top: Modbus RTU, for example, allows addresses 1 to 247. For more devices, or to go beyond the length limit, a repeater starts a new segment.

Distance and speed trade against each other. The standard does not fix either, but the cable does: long cable rounds off the edges of the bits. Two figures are commonly quoted. At low data rates, up to about 100 kbit/s, a run of about 1,200 meters (4,000 feet) is achievable with good cable. At the other extreme, transceivers can reach 10 Mbit/s or more, but only over a few meters to a few tens of meters. A common rule of thumb is to keep the data rate in bits per second multiplied by the cable length in meters below about 100 million. In practice, most field devices run at 9,600 or 19,200 baud, well inside the limit for any cable run a building is likely to have.

RS-485 vs RS-232 vs RS-422

All three are physical layers for serial data, and the same UART chip can sit behind any of them. The differences are in the wiring.

RS-232RS-422RS-485
SignalingSingle-ended, each signal against groundDifferential pairDifferential pair
DevicesOne transmitter, one receiverOne transmitter, up to 10 receiversMany transmitters and receivers on one bus, 32 unit loads
DirectionFull duplexFull duplex with two pairs; one direction per pairHalf duplex on one pair, or full duplex on two
Typical distanceAbout 15 metersUp to about 1,200 metersUp to about 1,200 meters
Typical useConsole ports, older instruments, point-to-point linksLong point-to-point or one-to-many linksMulti-drop field networks: meters, drives, controllers

RS-232 is still common for a service port on a single instrument or for a console on network equipment. RS-422 suits a single long link where one end talks and several listen. RS-485 is the choice whenever several devices need to share one cable and take turns, which is why it dominates field networks.

Connecting a microcontroller to RS-485

A microcontroller’s UART produces logic-level signals, 3.3 or 5 volts against ground, which would not survive long on a plant cable. An RS-485 transceiver chip converts between the two. The microcontroller’s transmit and receive pins go to the chip’s driver input and receiver output, and one more pin drives the chip’s driver enable, so the firmware can switch the driver on only while it is transmitting. Some UARTs, and some ready-made modules, handle that switching automatically.

The common mistakes at this point are a 5 volt transceiver on a 3.3 volt board, a driver enable that releases the line before the last byte has left the UART’s shift register, which clips the end of each message, and a module with a terminating resistor fitted that is placed in the middle of the bus. Development boards such as those in the microcontroller comparison pair easily with a transceiver module for prototypes; a product meant for a plant needs an isolated transceiver and surge protection on the board.

Reading RS-485 devices from an IoT system

Many of the devices worth monitoring in a building or a plant have an RS-485 port and nothing else: energy and power meters, flow meters, temperature and humidity transmitters, inverters, variable speed drives and older PLCs. Most of them speak Modbus RTU over it. They will not talk to a cloud platform directly, and they are not meant to.

The usual pattern is an edge gateway with an RS-485 port wired onto the bus as its master. It polls each device in turn for the registers it needs, converts the raw values into readings with names and units, and publishes them upward, typically over MQTT to a broker, or through an OPC UA server for the plant’s own systems. The overview of an industrial IoT system shows where that gateway sits, and the OPC UA and MQTT article covers what happens above it. Where a PLC already polls the same devices, it is usually simpler to read the values from the PLC, as described in what a PLC is, than to add a second master to its bus.

Two cautions apply. A two-wire RS-485 bus running Modbus RTU expects one master, so a gateway must not be wired onto a bus that a PLC or a building management system already polls without agreement from whoever owns that system. And the bus has no security of its own: any device on it can send anything to any other. Treat physical access to the cable, and to whatever gateway bridges it to a network, as access to every device on it.

Troubleshooting checklist

When an RS-485 link does not work, the cause is far more often the wiring or the settings than the hardware. Work through these in order.

  1. Settings match. Baud rate, data bits, parity and stop bits must be identical on every device, and each device needs a unique address in the protocol.
  2. A and B. Swap the pair at one device and try again.
  3. Termination. A resistor at each end of the trunk and nowhere else. With the bus powered down, the resistance measured across A and B should be close to 60 ohms, two 120 ohm terminators in parallel.
  4. Biasing. If every message is preceded by a burst of garbage, or the receiver sees data when nothing is sending, the idle line is floating.
  5. Common ground. Connect the signal common between devices, especially across buildings or separate power supplies.
  6. Layout. Look for a star, a long stub or a branch added later, and rewire it as one daisy chain.
  7. Turnaround. If the end of each message is cut off, the transmitter is releasing the line too early; if answers collide with requests, a device is replying before the master has released it.

A cheap USB to RS-485 adapter and a serial terminal on a laptop, connected as a listener, will show whether bytes are moving at all, which splits the problem in two quickly.

Written by the IoT Crest editorial team. Facts in this article follow the editorial policy: only well-established behavior is stated and no figures are invented.

More from Industrial IoT

  1. What is SCADA? How supervisory control works

    What SCADA is and how it works: field devices, RTUs and PLCs, communications, HMI and historian, polling, protocols, SCADA vs PLC vs DCS, and security.

  2. 4-20mA current loop: how the signal works

    4-20mA explained: how a current loop carries a reading, why it starts at 4 mA, loop power and wiring, scaling, fault levels, HART, and reading it into IoT.

  3. IoT gateway: what it does and how to choose one

    What an IoT gateway does: protocol translation from Modbus, Zigbee, BLE and LoRaWAN to MQTT, buffering when the uplink drops, security, and how to choose one.

  4. Modbus RTU explained: frames, registers and function codes

    Modbus RTU explained: how a master polls devices over RS-485, the frame and CRC byte by byte, the four register tables, function codes, and RTU vs TCP.

  5. MTBF vs MTTR vs MTTF: reliability metrics explained

    MTBF vs MTTR vs MTTF: what each failure metric measures, how to calculate them with a worked example, availability, and what an MTBF figure does not promise.

  6. What is a PLC? Programmable logic controllers explained

    What is a PLC: the parts of a programmable logic controller, the scan cycle, the IEC 61131-3 languages, and how PLC data reaches an industrial IoT system.

  7. Edge computing vs cloud computing for IoT: where the work should happen

    Edge computing vs cloud computing for IoT systems: what each means, how latency, bandwidth, reliability and cost differ, and how to split the work.

  8. What an industrial IoT system is made of, from sensors to dashboard

    What an industrial IoT system is made of: sensors and actuators, controllers, gateways, the plant network, a broker or historian, dashboards and alerts.

  9. Predictive maintenance with vibration and temperature sensors: how it works

    How predictive maintenance sensors work: what vibration and temperature reveal about bearings, motors and pumps, where to mount them and how alerts work.

  10. OPC UA and MQTT in factories: where each fits

    OPC UA and MQTT in factories: what each protocol does, how a client-server information model differs from publish-subscribe, and how plants use both.

All industrial IoT articles

Sponsor an article in this topic

Sponsored articles and in-article link placements for IoT vendors, agencies and SEO buyers. Every sponsored piece is labeled, edited to the same standard as the rest of the site, and placed in the hub its readers already visit. Rates on request.

Ask a question

Ask a question

Spotted an error, or want a topic covered? It goes straight to the editors, who reply by email, WhatsApp or SMS.