Serial Communication: RS-232, RS-422 and RS-485
How a serial character is built, the three electrical standards, DB9 pinouts and null modems, and a correct RS-485 bus.
On this page
- Why serial still matters
- How a serial character is built
- RS-232, RS-422 and RS-485 compared
- RS-232 in practice
- RS-485 in practice
- Wiring an RS-485 bus
- Termination and bias
- Distance, speed and the number of devices
- Grounding, isolation and surge protection
- Settings that must match
- Converters and adapters
- Common mistakes
- FAQ
Why serial still matters
Serial links are old, slow and everywhere. A meter, a drive, a barcode reader, a temperature controller or a PLC programming port very often speaks RS-232 or RS-485, and a USB adapter plus a free program is often the quickest way to find out whether a device is alive. Serial is also the easiest network to understand completely: one pair of wires, one character at a time. If you can troubleshoot serial, the habits (match the settings, check polarity, terminate properly, work from the cable up) carry to every other network.
How a serial character is built
A serial line sends one bit at a time at a speed called the baud rate. There is no clock wire, so each character is wrapped in markers the receiver uses to find the bits: the line idles at logic 1; a start bit (0) announces a character; then the data bits follow, least significant bit first; an optional parity bit allows a simple error check; and one or two stop bits (1) return the line to idle. Both ends must agree on all of these.
| Setting | Meaning | Common values |
|---|---|---|
| Baud rate | Bits per second | 9 600, 19 200, 38 400, 115 200 |
| Data bits | Bits of data per character | 8 (Modbus RTU), 7 (ASCII protocols, some PLC links) |
| Parity | None, even or odd: an extra bit that makes the count of 1 bits even or odd; catches a single flipped bit | Even (Modbus default), none |
| Stop bits | Idle time after each character | 1; 2 when parity is none (Modbus) |
| Flow control | Hardware (RTS/CTS) or software (XON/XOFF) handshake | None for most industrial links |
Character times
| Baud rate | One bit | 8N1 character | 8E1 character | Characters per second (8N1 / 8E1) | Modbus RTU gap (3.5 characters) |
|---|---|---|---|---|---|
| 1 200 | 0.833 ms | 8.333 ms | 9.167 ms | 120 / 109 | 32.08 ms |
| 2 400 | 0.417 ms | 4.167 ms | 4.583 ms | 240 / 218 | 16.04 ms |
| 4 800 | 0.208 ms | 2.083 ms | 2.292 ms | 480 / 436 | 8.02 ms |
| 9 600 | 0.104 ms | 1.042 ms | 1.146 ms | 960 / 873 | 4.01 ms |
| 19 200 | 0.052 ms | 0.521 ms | 0.573 ms | 1 920 / 1 745 | 2.01 ms |
| 38 400 | 0.026 ms | 0.260 ms | 0.286 ms | 3 840 / 3 491 | 1.75 ms |
| 57 600 | 0.017 ms | 0.174 ms | 0.191 ms | 5 760 / 5 236 | 1.75 ms |
| 115 200 | 0.009 ms | 0.087 ms | 0.095 ms | 11 520 / 10 473 | 1.75 ms |
Worked example: how long does a 256-byte message take?
- At 9 600 baud, 8N1, each byte is 10 bits, so 256 bytes are 2 560 bits: 2 560 ÷ 9 600 = 266.7 ms.
- At 19 200 baud the same message takes 133.3 ms. Doubling the baud rate halves the time of the data, but the fixed gaps and the device’s processing time do not shrink, so the whole poll improves by less than half.
- The maximum Modbus RTU frame is 256 bytes, so no single message ever takes more than about 267 ms at 9 600 baud. A timeout of one second is safe for most devices.
RS-232, RS-422 and RS-485 compared
These are electrical standards: they say what voltages represent bits and how many devices may share the wires. They do not define the message format; Modbus, DF1, Host Link and the rest sit on top.
| RS-232 | RS-422 | RS-485 | |
|---|---|---|---|
| Signaling | Single-ended, about ±3 to ±15 V against a common ground | Differential, one pair for each direction | Differential, one shared pair (2-wire) or two pairs (4-wire) |
| Receiver threshold | ±3 V | ±200 mV difference | ±200 mV difference |
| Devices | 2 (point to point) | 1 driver, up to 10 receivers | Up to 32 unit loads (256 with 1/8-load transceivers) |
| Wires | TXD, RXD, ground (plus handshake lines) | 4 wires and a reference, full duplex | 2 wires half duplex, or 4 wires |
| Maximum length | About 15 m at 9 600 baud | About 1 200 m | About 1 200 m |
| Maximum speed | 115 kbit/s typical (up to 1 Mbit/s short) | 10 Mbit/s at 12 m | 10 Mbit/s at 12 m |
| Noise immunity | Poor | Good | Good |
| Typical use | Programming ports, barcode readers, instruments, PC to PLC | Point-to-multipoint, older drives and PLC links | Modbus RTU, PROFIBUS DP, meters, drives, sensors |
RS-232 in practice
| DB9 pin | Signal (DTE, a PC) | Direction | Used for |
|---|---|---|---|
| 1 | DCD, carrier detect | in | Modems; usually unused |
| 2 | RXD, receive data | in | Data from the other device |
| 3 | TXD, transmit data | out | Data to the other device |
| 4 | DTR, data terminal ready | out | Handshake; sometimes used to power or reset |
| 5 | GND, signal ground | The reference for all the signals | |
| 6 | DSR, data set ready | in | Handshake |
| 7 | RTS, request to send | out | Handshake; also RS-485 direction control on some adapters |
| 8 | CTS, clear to send | in | Handshake |
| 9 | RI, ring indicator | in | Modems; sometimes carries +5 V on special ports |
- A PC is a DTE (data terminal), a modem is a DCE. A DTE talks to a DCE with a straight cable (pin 2 to 2, 3 to 3). Two DTEs need the transmit and receive lines crossed: a null-modem cable. Many PLC programming ports are wired as DTEs, which is why a PC needs a crossed cable to some and a straight cable to others. If nothing arrives, try the other type of cable first.
- Only three wires matter for most links: RXD, TXD and ground. Handshake wires are used only when the device manual asks for them.
- RS-232 does not need terminators or bias. It does need a common ground, and it is limited by cable capacitance: about 15 m at 9 600 baud, less at higher speeds.
- Not every DB9 is RS-232. Some PLC ports are RS-485 or RS-422 on a DB9 and carry 5 V or 24 V on spare pins. Read the manual before you connect a PC adapter, or you may damage one of the two ports.
- Connector gender. The PC end is usually a male DB9 (pins) and the device end female, but not always. A gender changer fixes the fit and changes nothing electrically.
- Long RS-232 runs. Past 15 m, convert to RS-485 (an RS-232 to RS-485 converter at each end), use a lower baud rate, or move to Ethernet with a serial device server.
RS-485 in practice
RS-485 carries a bit as the voltage difference between two wires, usually called A and B (or D− and D+). Noise that hits both wires equally cancels out, which is why RS-485 works over long cables next to motors. A line driver turns the signal on and a receiver reads it; on a shared pair only one driver may be on at a time, so each device switches its driver off when it is not sending (direction control).
| Mode | Wires | How it works | Typical use |
|---|---|---|---|
| 2-wire half duplex | A, B (+ reference) | One pair; the master sends, then listens | Modbus RTU, PROFIBUS, most drives and meters |
| 4-wire full duplex | TX pair, RX pair | The master has a transmit pair to all slaves and a receive pair from them; slaves still take turns replying | Older equipment, some serial PLC networks (RS-422 style) |
| Point to point | A, B | Two devices only; still terminate | Drive to PLC, instrument to PC |
- Direction control. A converter or port must enable its driver only while sending. Good USB-RS485 adapters do this automatically; some PLC ports use the RTS line or a configuration setting. A driver left on blocks every other device on the bus.
- Turnaround. After sending, the master must switch to receive quickly enough to catch the reply; a slow adapter or a software delay causes lost responses at high baud rates.
- A and B are not standard. Some makers call the same wire A and others B, and +/− is used as well. If nothing works, swapping the pair on one device is the first test.
Wiring an RS-485 bus
- Daisy-chain, never a star. Run the cable from device to device. Any branch (stub) should be as short as possible: under about 1 m at 9 600 baud, shorter at higher speeds.
- Twisted, shielded pair with 120 Ω characteristic impedance (for example Belden 9841). The twist is what makes the noise cancel; do not use untwisted bell wire or two wires from a multicore cable.
- Terminate both ends, and only the ends, with a resistor equal to the cable impedance (120 Ω) across A and B. Many devices have a switchable terminator; check that exactly two are on.
- Bias once (next section), at one point, so the idle line has a defined level.
- Common reference. Connect the signal grounds of the devices through the third conductor (or the shield through a resistor) so that every receiver sees the signals within its common-mode range (−7 V to +12 V).
- Shield at one end, or through a bond. See the grounding section below and Cabling, Grounding and Noise.
- Keep it away from power cables and VFD motor leads.
- Repeaters extend a bus past the node or distance limit and isolate segments; each segment has its own terminators.
Termination and bias
Two resistors do two different jobs. Termination (120 Ω across the pair at each end) matches the cable’s impedance so that fast edges are absorbed and do not reflect back along the cable and corrupt later bits. Bias (a pull-up resistor from B to +5 V and a pull-down from A to ground) makes the idle line sit at a clear logic level, so receivers do not read noise as data when nobody is transmitting. Termination is needed on both ends; bias is needed once on the whole bus (usually at the master or in the converter).
Worked example: the idle voltage with bias
- Bias resistors of 680 Ω to +5 V and to ground, and two 120 Ω terminators in parallel (the load seen across A and B is 60 Ω).
- The pull-up, the load and the pull-down form a divider: VAB = 5 × 60 ÷ (680 + 60 + 680) = 0.211 V.
- That is above the receiver threshold of 0.2 V, so the idle line reads as a definite logic 1. With 470 Ω resistors the idle voltage is 0.300 V: stronger, but it loads the drivers more.
- Without bias, the idle difference is close to 0 V, inside the undefined band, and noise produces random characters.
- Many modern transceivers have built-in fail-safe (they read an open or idle line as a defined state), which makes external bias unnecessary; check the datasheet. Never put bias in more than one place: the resistors add in parallel and overload the drivers.
| Measurement (power off, bus disconnected from the master) | Reading | Meaning |
|---|---|---|
| Resistance across A and B | About 60 Ω | Two 120 Ω terminators: correct |
| Resistance across A and B | About 120 Ω | Only one terminator |
| Resistance across A and B | Very high (open) | No terminator |
| Resistance across A and B | Below about 40 Ω | More than two terminators, or a short |
| Voltage A to B (power on, idle) | About +0.2 V to +5 V with B positive | Biased and idle; a reading near 0 V means no bias |
Distance, speed and the number of devices
Cable length falls as speed rises, because the cable’s capacitance rounds the edges until the bits blur together. At 9 600 baud the practical limit is the 1 200 m of the standard; at 1 Mbit/s it is around 120 m; at 10 Mbit/s a few tens of meters. Most Modbus RTU systems run at 9 600 or 19 200 baud, which leaves plenty of margin.
Unit loads
The “32 devices” limit counts unit loads, a measure of how much each receiver loads the line. A classic transceiver is 1 unit load, so 32 fit on a bus. Modern transceivers are rated 1/2, 1/4 or 1/8 unit load, allowing 64, 128 or 256 devices; but the cable resistance and capacitance still limit the practical number. Add up the unit loads from the datasheets.
Worked example: is the bus within limits?
- A bus has 10 older devices at 1 unit load each, and 40 modern devices at 1/8 unit load each.
- Total load = 10 × 1 + 40 × 0.125 = 15 unit loads. That is under 32, so the receivers are within the standard.
- The master driver must also drive two 120 Ω terminators and the cable. The standard’s driver is rated for 32 unit loads plus the terminators; check the master’s datasheet for any derating, and use a repeater if the bus is long or the baud rate is high.
- Fifty devices at 9 600 baud is allowed by the numbers, but a poll cycle of 50 devices (see the Modbus page) is slow: split into two buses if you need speed.
Grounding, isolation and surge protection
Two panels often have a different ground potential: a few volts is common, and tens of volts occurs near large drives and welders. A cable that joins their signal grounds carries the difference as a current, adding noise, and a difference above about 7 V puts the signals outside the receivers’ common-mode range, which can destroy the ports.
| Measure | What it does | When to use it |
|---|---|---|
| Isolated transceivers or converters | Separate the signal ground of each device with a barrier (typically 1 to 3 kV) | Whenever two panels, or a laptop and a panel, are joined: the safe default |
| Common reference through 100 Ω | Joins the signal grounds through a resistor that limits ground current | Non-isolated ports on the same bonded system |
| Shield grounded at one end | Stops hum without a ground loop | Low-frequency noise; short runs |
| Shield bonded at both ends | Blocks radio-frequency noise; needs equipotential bonding so that ground current does not use the shield | Heavy drives, long cables, with a bonding conductor beside the cable |
| Surge protectors (TVS or gas tubes) | Clamp lightning and switching spikes on long outdoor runs | Cables between buildings; use fiber where possible |
| Fiber optic link | No electrical connection at all | Between buildings and across large ground differences |
Settings that must match
| Setting | Why it matters | If wrong |
|---|---|---|
| Baud rate | The receiver samples at its own clock; the speeds must agree to within a few percent | Garbage characters, framing errors |
| Data bits | 7 or 8 data bits change where the stop bit falls | Garbage or shifted data |
| Parity | An even-parity receiver rejects characters from an odd or no-parity sender | Parity errors; frames ignored |
| Stop bits | 1 or 2; usually tolerated if the sender uses more than the receiver expects | Occasional framing errors |
| Protocol | RTU against ASCII; Modbus against DF1 or Host Link | No reply |
| Station address | Unique on the bus; valid range for the protocol | No reply, or two devices answering at once |
| Timeout and retries | How long the master waits and how often it tries again | False alarms, or a slow recovery |
Write the settings of every device on a table beside the drawings. A good habit when a link does not work is to put the device back to its factory defaults and use those.
Converters and adapters
| Device | What it does | Buying notes |
|---|---|---|
| USB to RS-232 adapter | Gives a laptop a COM port (DB9) | FTDI or Silicon Labs chips; avoid counterfeit Prolific chips; isolated versions for plant use |
| USB to RS-485 / RS-422 adapter | Screw terminals for A, B and ground | Automatic direction control; isolation; a terminator switch |
| RS-232 to RS-485 converter | Extends or joins networks | Isolation, DIN-rail power, bias and terminator options |
| Serial device server | Puts a serial device on Ethernet (a COM port over TCP) | Raw TCP, Modbus gateway and virtual COM modes; power and surge protection |
| Repeater / isolator | Extends a bus or splits ground | Each side has its own terminators |
| Protocol gateway | Translates, for example Modbus RTU to Modbus TCP or EtherNet/IP | Check the register mapping and the poll model |
The Sniffers, Analyzers and Serial Tools page explains how to use adapters to test and sniff a serial link.
Common mistakes
| Mistake | What you see | Fix |
|---|---|---|
| Straight cable where a null modem is needed (or the reverse) | No data at all | Swap pins 2 and 3, or fit a null-modem adapter |
| A and B swapped on one device | No reply, or the line seems dead | Swap the pair on one device |
| Wrong baud rate or parity | Garbage characters, framing errors | Match the settings at both ends; scan the baud rates |
| Terminators missing or in the middle | Errors rising with baud rate or cable length | Exactly two terminators, at the two ends |
| Star wiring or long stubs | Random errors, some devices fail | Daisy-chain; shorten stubs |
| Two devices with the same address | Garbled replies or none | Give each its own address |
| Bias in several places | Drivers overloaded, weak signals | Bias at one point only |
| No common reference | Works one day, fails the next | Connect the reference or use isolated ports |
| Different ground potentials with no isolation | Intermittent faults, burnt ports | Isolated converters; bond the panels |
| USB adapter not set to the right COM port | Terminal shows nothing | Check Device Manager and the software setting |
Related
- Industrial Communication: the overview of this guide.
- Modbus RTU, ASCII and TCP: the protocol that most often runs on RS-485.
- Cabling, Grounding and Noise: cable types, shielding and routing.
- Sniffers, Analyzers and Serial Tools: adapters, loopback tests and serial sniffers.
- Troubleshooting Industrial Networks: a step-by-step method for serial faults.
- Modbus Frame and CRC Calculator.
FAQ
What baud rate should I use?
Start with 9 600 or 19 200. Higher speeds work on short, clean buses, but long cables, many devices and noise favor lower rates. Every device on the bus must use the same setting.
Do I always need a terminator on RS-485?
On a long cable or at high speed, yes, at both ends. A short bench setup at 9 600 baud may work without, but adding the terminators is good practice and costs nothing.
Can I run RS-485 in a star?
Not reliably. Stubs cause reflections. Use a daisy chain, or put a repeater or hub in each branch so that each branch is its own bus.
Why does my RS-232 cable stop working over 20 meters?
The cable’s capacitance rounds the edges, and RS-232’s single-ended signal picks up noise. Convert to RS-485 or use a lower baud rate and a low-capacitance cable.
What is the difference between RS-422 and RS-485?
RS-422 has one driver and up to ten receivers on separate pairs. RS-485 allows many drivers on a shared pair, and its drivers can be switched off. A device with RS-422 can often be connected to an RS-485 bus in 4-wire mode.
Why do some adapters need an RTS signal?
To switch the driver between transmit and receive. Good adapters do it automatically; with a simple one, the software must raise RTS while sending.
References
- TIA/EIA-232-F, Interface between Data Terminal Equipment and Data Circuit-Terminating Equipment.
- TIA/EIA-485-A, Electrical Characteristics of Generators and Receivers for Use in Balanced Digital Multipoint Systems; TIA/EIA-422-B.
- Texas Instruments, The RS-485 Design Guide (application report SLLA272) and RS-485 Basics: Termination and Bias.
- Modbus Organization, MODBUS over Serial Line Specification and Implementation Guide V1.02 (settings, timing, wiring).
- Belden, Industrial Cable Technical Data: RS-485 and PROFIBUS cables.
Last reviewed: October 2026. Speeds, lengths, node counts and menu names are typical: confirm against the specification and the manufacturer’s documentation for the devices you use.
