Loading header...

RS-232 — The Voltage Standard Behind Serial Ports

You have almost certainly seen a DB9 connector — the 9-pin trapezoid port on old computers, PLCs, and industrial equipment. That connector carries RS-232, and if you have ever wondered why your microcontroller's UART does not directly connect to it, this page explains why.


The Core Idea — RS-232 is an Electrical Standard, Not a New Protocol

RS-232 does not define a new frame format or a new packet structure. UART framing (start bit, 8 data bits, stop bit) is the same. What RS-232 defines is what voltages represent logic 0 and logic 1.

flowchart LR classDef ttl fill:#dbeafe,stroke:#2563eb,color:#1e3a5f classDef rs fill:#fee2e2,stroke:#dc2626,color:#7f1d1d T1["TTL UART\nLogic 1 = +3.3 V or +5 V\nLogic 0 = 0 V\nShort cables only"]:::ttl R1["RS-232\nLogic 1 = −3 V to −15 V\nLogic 0 = +3 V to +15 V\nUp to ~15 m"]:::rs T1 -->|"Same UART bits\nDifferent voltages"| R1

Notice that RS-232 inverts the logic: a negative voltage is a '1', a positive voltage is a '0'. This is the opposite of TTL.


Why Higher Voltages?

In the 1960s when RS-232 was designed, cables were long, connectors were noisy, and electronics were less sensitive. Higher voltages give more noise margin — a signal that starts at ±12 V can lose several volts to cable resistance and interference and still be recognised correctly at the far end.

Property TTL UART (3.3 V) RS-232
Logic '1' voltage +3.3 V −3 V to −15 V (typically −12 V)
Logic '0' voltage 0 V +3 V to +15 V (typically +12 V)
Max cable length ~1 m ~15 m at 9600 baud
Point-to-point only? Yes Yes
Number of devices 2 (one TX, one RX) 2 (point-to-point only)
Connector None (bare pins) DB9 (9-pin)

The DB9 Connector Pin-Out

RS-232 defines far more signals than just TX and RX. The original standard included hardware handshaking signals that told each side whether the other was ready to receive.

flowchart LR classDef data fill:#dcfce7,stroke:#16a34a,color:#14532d classDef ctrl fill:#fef9c3,stroke:#ca8a04,color:#713f12 classDef gnd fill:#f1f5f9,stroke:#94a3b8,color:#334155 GND["Pin 5 — GND\nSignal ground reference"]:::gnd TXD["Pin 3 — TXD\nTransmit Data (data out)"]:::data RXD["Pin 2 — RXD\nReceive Data (data in)"]:::data RTS["Pin 7 — RTS\nRequest To Send\n'I am ready to transmit'"]:::ctrl CTS["Pin 8 — CTS\nClear To Send\n'You may transmit'"]:::ctrl DTR["Pin 4 — DTR\nData Terminal Ready\n'I am powered and ready'"]:::ctrl DSR["Pin 6 — DSR\nData Set Ready\n'Modem is powered and ready'"]:::ctrl DCD["Pin 1 — DCD\nData Carrier Detect\n'Modem has detected a carrier'"]:::ctrl RI["Pin 9 — RI\nRing Indicator\n'Phone is ringing'"]:::ctrl

In practice, most embedded systems use only TXD, RXD, and GND — the three wires that are actually needed. The handshaking pins (RTS, CTS, DTR, DSR) are often either unused or looped back.


The MAX232 — The Bridge Between Worlds

Your microcontroller runs at 3.3 V or 5 V. RS-232 needs ±12 V. You cannot connect them directly. The MAX232 (and its many variants) is a dedicated chip that solves this: it takes 3.3 V or 5 V power, internally generates ±12 V using a charge pump, and converts TTL logic levels to RS-232 voltage levels and back.

flowchart LR classDef mcu fill:#dbeafe,stroke:#2563eb,color:#1e3a5f classDef chip fill:#fef9c3,stroke:#ca8a04,color:#713f12 classDef conn fill:#fee2e2,stroke:#dc2626,color:#7f1d1d MCU["Microcontroller\nUART TX: 0 V / 3.3 V\nUART RX: 0 V / 3.3 V"]:::mcu MAX["MAX232\nLevel converter\n+3.3 V → −12 V / +12 V\n−12 V / +12 V → 0 V / 3.3 V"]:::chip PORT["DB9 Port\nRS-232 TX: +12 V / −12 V\nRS-232 RX: +12 V / −12 V"]:::conn MCU -->|"TTL\n0 / 3.3 V"| MAX -->|"RS-232\n±12 V"| PORT

Modern USB-to-serial adaptors (FT232, CH340, CP2102) do the same conversion internally — you plug into USB, the computer sees a virtual serial port, and RS-232 levels appear on the DB9 if the adapter includes them.


RS-232 vs RS-485 — Point-to-Point vs Multi-Drop

This is the most important limitation of RS-232: it connects exactly two devices. If you need more than two devices on the same bus, or if your cable is longer than 15 m, RS-232 cannot do it.

RS-232 RS-485
Devices on one bus 2 (point-to-point) 32 to 256+
Max cable length ~15 m ~1200 m
Signaling Single-ended (vs GND) Differential (A vs B wire)
Noise immunity Low Very high
Common use PC serial ports, test equipment Industrial networks, Modbus

When You Will See RS-232 Today

Despite being old, RS-232 is still alive:

  • PLCs and industrial equipment — most PLCs have at least one DB9 RS-232 port for programming and configuration
  • GPS receivers — many GPS modules output NMEA sentences over TTL UART or RS-232
  • Test and measurement — oscilloscopes, power supplies, and signal generators often have RS-232 ports
  • Point-of-sale terminals — barcode scanners, receipt printers
  • Modems — the original purpose of RS-232 was connecting computers to phone-line modems

Key Takeaway

RS-232 is UART with different voltage levels and a standard connector. The framing (start bit, data bits, stop bit) is identical to what you already know from UART. The only difference is the electrical representation of the bits: higher voltage, inverted polarity, designed for cables up to 15 metres long, point-to-point only.

If you need to go further or connect more devices → RS-485.
If you need RS-485 + a software protocol that defines commands and registers → Modbus.