APLawrence.com -  Resources for Unix and Linux Systems, Bloggers and the self-employed

RS232 Wiring Diagrams

Some material is very old and may be incorrect today

© December 2001 Tony Lawrence

The unfortunate thing about RS232 is that aside from the simplest TD to RD and SG to SG hookups, and computer to modems (essentially straight through because a modem is DCE- just the reverse of a computer), everybody does it differently. For the diagrams below, leave off FG when you don't have it (DB9).

Async modems need FG (if available), SG, TD, RD, CTS, RTS, DSR, DCD and DTR at a minimum. Synchronous modems also need SCTS, STD, TC, RC, RI and (TC).

Meanings of pins in DB25 order:

DB25 Pin DB9 Pin Description
1 FG Frame Ground
2 3 TD Transmit data (Out)
3 2 RD Receive data (In)
4 7 RTS Request to Send (Out)
5 8 CTS Clear to Send (In)
6 6 DSR Data Set Ready (In)
7 5 SG Signal Ground
8 1 DCD Data Carrier Detect (In)
9 +V (In)
10 -V (In)
11 QM (also called SSD- Secondary Send Data)(In)
12 SDCD Secondary Carrier Detect (In)
13 SCTS Secondary Clear to Send (In)
14 STD Secondary Transmit Data (Out)
15 TC Transmitter Clock (In)
16 SRD Secondary Receive Data (In)
17 RC Receiver Clock (In)
18 Unused
19 SRTS Secondary Request to Send (Out)
20 4 DTR Data Terminal Ready (Out)
21 SQ Signal Quality Detect (In)
22 9 RI Ring Indicator (In)
23 Data Rate Select (Out)
24 (TC) External Transmitter Clock (Out)
25 Unused

Meanings of pins in DB9 order:

DB25 Pin DB9 Pin Description
8 1 DCD Data Carrier Detect (In)
3 2 RD Receive data (In)
2 3 TD Transmit data (Out)
20 4 DTR Data Terminal Ready (Out)
7 5 SG Signal Ground
6 6 DSR Data Set Ready (In)
4 7 RTS Request to Send (Out)
5 8 CTS Clear to Send (In)
22 9 RI Ring Indicator (In)

Connecting to other devices

There is tremendous variance in printer wiring. If you don't know how your printer expects to be wired, you'll have to wire it just TD,RD and SG, and rely on Xon/Xiff flow control.

Some printers handshake with RTS and use DTR to indicate on-line or off-line.

Computer Printer (handshake DTR and CTS)

Others use DTR for everything

Computer Printer (handshake DTR)

Okidata printers have an unusual setup:

Computer Okidata Serial Printer

Connecting a computer to another computer needs only TD, RD and SG if you are using Xon/Xoff flow control.

Computer Terminal or Computer

See also Serial Wiring and Serial Printers

Here's a useful Pin-outs site.

If you found something useful today, please consider a small donation.

Got something to add? Send me email.

(OLDER)    <- More Stuff -> (NEWER)    (NEWEST)   

Printer Friendly Version

-> RS232 Wiring Diagrams


Inexpensive and informative Apple related e-books:

Digital Sharing Crash Course

El Capitan: A Take Control Crash Course

Take control of Apple TV, Second Edition

Take Control of High Sierra

Take Control of IOS 11

More Articles by © Tony Lawrence

Don't try to run any serial interface faster than 9600 bps with software handshaking. Above 9600, the time it takes for an XOFF character to reach the sending machine can be sufficient to cause a buffer overflow at the receiving end. Hardware handshaking is infinitely more reliable and will readily support speeds beyond 115.2 Kbps on most reasonable systems.


Depends. You can do it with terminals because most can't
really display above 1600 baud or so - they can draw a line faster, but not a whole screen.

With printers, maybe, maybe not. But I seldom set printers above 9600 baud anyway because few can actually print that fast.


I run my two Wyse 60's at 38.4K, my Oki 395 at 19.2K and my Wyse 160 at 115.2K. One of my clients has a Tally 6100 printer that prints 900 lines/minute, which works out to around 1900 CPS on average (assuming 132 chars per line, which is the default). That unit is run at 38.4K. Anything slower and the printer would be waiting on the server for data.

A lot of it is dependent on the quality of the cable, the quality of the connectors and, most importantly, the quality of the EIA-232 hardware in the server. I've never had any trouble achieving reliable, high speed connections with Equinox hardware. Digi-Board's stuff is another matter.


Oh! Almost forgot. *** DO NOT *** connect frame ground on the printer to frame ground on the host computer if the two are powered by physically separate circuit breaker panels. You may accidentally set up ground plane potential imbalance current flow through the data cable, which will cause the link to generate random errors that will have you muttering to yourself.

As a general rule, you don't need frame ground bonding at both ends. If you are using shielded cable, bond the shield to frame ground at one end only (preferably the host computer) and insulate the shield and its drain wire (if present) at the other end. Never use the shield for signal ground.

If your EIA-232 wiring is through UTP cable the frame ground serves no purpose. Ironically, UTP is far more likely than the shielded stuff to produce reliable high speed operation. If you want the technical explanation as to why this is so, raise your hand. <Grin>


---July 23, 2004

I ALWAYS want the tech explanation :-)


Wed May 18 05:42:31 2005: 533   bkw

UTP? What I've wanted to know for a long time was what's the best way to run rs232 over UTP? That is, which signals can tolerate being in a twisted pair and which should you avoid pairing? I assume it matters, especially if going for high speeds and/or long runs.

I would have thought that wiring diagrams for db9/db25-to-cat5 would be common by now because of the sheer ubiquity of cat5 cable but I don't find much.

I do find at least 3 pinouts for rs232 on rj45, (digi and equinox proprietary pinouts, and rs-232d, but all of them say nothing about the type of cable or the possibility of wires being in twisted pairs, because in reality they are usually using flat phone cable or ordinary shielded serial cable.

I happend to usually want medium speeds and short runs for fax/dialup modems, sometimes from an equinox or digi serial server which already has rj45f jacks in a proprietary pinout. But even when both ends are db9/db25 connectors, it'd be handier for me if I could just stock rj45f-db9f & rj45f-db25m universal adapters and grab or make common ethernet patch cable at will for the actual cable, especially now that it's already in the walls most places.

All I have found are:

This, which could be copied using universal adapters once you buy one,
_if_ one can trust the item description:

Digi themselves don't say what kind of cable about the same part number, and that has always meant flat phone cable, sometimes wired straight-through so pin1 goes to pin8, sometimes with a twist in the cable so that pin1 goes to pin1.

I also found this, which the authors themselves say repeatedly is just a suggestion they pulled out of the air, which I would still have to modify if I wanted to use it. I would lose RI altogether (nothing I do needs it, and digi etherlite boxes don't even supply it), and uncouple DSR & DCD, and I wouldnt't know which one, DCD or DSR, would be the better choice for going onto the wire where RI was.

That page also describes the pinout for the rs232d standard which uses rj45 connectors but says nothing about the type of cable or conductor pairings.

Wed May 18 06:10:36 2005: 536   bkw

No sooner said than discovered. This is pretty unambiguous:

Wed May 18 13:02:00 2005: 538   BigDumbDinosaur

Pair usage generally doesn't matter, in that the voltage transitions are relatively large (+/- 12 Volts, more or less). You have to consider that EIA-232 (not RS-232, which was obsoleted many years ago) is unbalanced to ground, so the pairing in UTP is irrelevant to the functioning of the circuit. Also, as compared to the signal transition rate encountered when UTP is used for networking, the slew rate with EIA-232 is very slow.

We use Equinox (nee Avocent) hardware exclusively, so we've standardized on Equinox's RJ45 to DBxx pinout configuration. It has the added advantage over that used by Digi in that GND, RxD and TxD are on the center RJ pins, which makes it easier to cobble up temporary test cables from standard four conductor telephone line cords.

Mon Jun 20 20:41:59 2005: 674   LostInSignals

Here's the story:

My boss asked me to find an alternative way of printing off of a HMI (Human Machine Interface) then the one printer that the company offered for it. The printer that they offered was a Seiko thermal printer that they were selling for $2000 plus the price of the cable. I talked to Dell and they wanted to set me up with a printer for $750 that could be used with the RS232 signal.

I decided that there had to be a cheaper solution and knowing that the HMI sent out RS232 signal, I ended up finding the Sipix A6 thermal printer which uses the RS232 signal. All I had to do was make a cable... so I thought. When I recieved the printer, I rang out the cable they included so I could figure out where each signal was and then I could make the cable correctly. I needed to make a cable because the HMI had a female RJ45 jack and the Sipix a6 had a female 8 pin mini-din connector.

The problem came when the Sipix A6 used 5 signals (I believe it is the TXD, RXD, GND, DCD, CTS) and the HMI interface only sent out 3 signals (TXD, RXD, GND). The HMI's flow control is set to None and the Printer is supposed to be set to Hardware (the HMI doesn't have the hardware option). All other RS232 settings were abled to be changed to the required ones for the printer. So I thought that I could spoof the 2 signals (the CTS and the DCD) the HMI didn't supply. The sipix a6 does not send out the respective signal partner and there is no connection for their pins on the pcb making it so that I couldn't spoof it that way.

This past friday I was messing with the wires and trying out different combinations, somehow I was able to get the printer to run off of only three wires but when I tryed to do it again, it did not work.

Has anyone run into this problem and have been able to solve it? If so, how?

Does anyone know how to externally spoof the CTS and the DCD by using either another chip on a breadboard or a constant voltage?

I am not an electrical or computer engineer so this stuff is tough for being a mechanical engineering student. Any help will be greatly appreciated. Thanks.

Tue Jun 21 19:29:24 2005: 678   TonyLawrence

This all makes little sense. If the HMI uses only TX, RX and GND, it would have to use software flow control and so would the printer.

Tue Jun 21 21:10:14 2005: 679   LostInSignals

I checked again and under the rs-232 compliance the Keyence LS-7500 series has flow control: No. The printer has the rs-232 flow control as hardware.

Wed Jun 22 14:01:53 2005: 680   anonymous

Does anyone know how to externally spoof the CTS and the DCD by using either another chip on a breadboard or a constant voltage?

Assuming that both devices adhere to the EIA-232 (*not* RS-232 -- that's long gone), you should be able to connect CTS to RTS at both ends of the data cable and both devices will think CTS is asserted. Enable software flow control or reduce the BPS rate to 9600 or less. Asserting DCD shouldn't be necessary -- only a modem normally cares about that signal. However, if either device has to have DCD asserted in order to function, tie DCD to RTS as well. If none of this works, maybe it's time to consider chucking this stuff and getting compliant hardware. <Grin>

When you post for help you need to be more specific about what you're trying to accomplish and the hardware or software with which you are working. I can't speak for Tony or the others who watch this forum, but I'm not a mind reader, and don't know everything about every piece of computer hardware ever invented. I've never heard of these items with which you are working, and I'm not exactly a novice when it comes to this stuff.

Sat Oct 22 02:17:41 2005: 1230   anonymous

You need a signal at the printer end which is high when the printer is ready (that would be DTR for preference, but RTS would also work). You wire that to the printer's DCD, DSR and CTS pins to make it think the is carrier, the modem is ready and were clear to send.

If you don't have a high signal then you can just hook a 6-9v battery between GND and whatever signal(s) you want to raise (CTS, DCD, DSR etc). It should last quite some time as current draw on those pins should be quite low, but if you find it eats batteries, just put a 100k resistor in series to lower the current draw.


Printer Friendly Version

Have you tried Searching this site?

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more.

Contact us

Printer Friendly Version

By understanding a machine-oriented language, the programmer will tend to use a much more efficient method; it is much closer to reality. (Donald Knuth)

Linux posts

Troubleshooting posts

This post tagged:








Unix/Linux Consultants

Skills Tests

Unix/Linux Book Reviews

My Unix/Linux Troubleshooting Book

This site runs on Linode