RJ45 Wiring Conventions

From Artisan's Asylum

(Difference between revisions)
Jump to: navigation, search
m (Added "Resources" category)
Line 149: Line 149:
[[Category: IT]]
[[Category: IT]]
[[Category: Conventions]]
[[Category: Resources]]
[[Category: Electronics and Robotics]]
[[Category: Electronics and Robotics]]

Current revision as of 17:54, 5 January 2016

Pins go from left to right while the plug is "belly up"

Cat5 & RJ45 can make wiring very tidy. You can run ethernet, serial, and even USB over it (adapters exist), and since you crimp your own ends (or just push them into breadboard), it comes in every length you want. The patch panels are all ready-made, including Keystone Hardware.


Ethernet Wiring

Straight-through (most common)


Although it can be tempting to put all 4 pairs side-by-side since "they go straight through anyway", it's important to notice that the pattern is slightly different. Think of it as

  • far left pair (orange)
  • far right pair (brown)
  • center pair (blue)
  • straddling pair (green)

The dashed white wires go to the left of their solid-colored counterparts.



A crossover cable has one end that is identical to a straight-through cable. The other end has its green and orange pairs swapped. In other words:

  • far left pair (green)
  • far right pair (brown)
  • center pair (blue)
  • straddling pair (orange)

Power over Ethernet


Standardized PoE

Power over Ethernet is a defined standard that uses the normal patch cable to deliver power. There are several sub-standards that concern the specifics of this; some run it on top of the signal cables, some run it in the "spare" cables.


You must never mix a homebrew PoE system with any other Ethernet infrastructure. Yes, even through a hub, router, or switch as an intermediary -- your hacked-together PoE must be completely quarantined from any other Ethernet installations, for the safety of the organization's equipment and yourself.

In the Asylum DIY PoE convention, we use both brown wires for Ground and both blue wires for Positive.

Serial Wiring

Most common mistake: not remembering that from the back (where you'll ultimately make the connections), the pin positions are mirrored

Serial ports have 9 signal wires:

  1. DCD - Data Carrier Detect
  2. RxD - Receive Data
  3. TxD - Transmit Data
  4. DTR - Data Terminal Ready
  5. GND - Ground
  6. DSR - Data Set Ready
  7. RTS - Request To Send
  8. CTS - Clear To Send
  9. RI - Ring Indicator

2 types of devices use serial ports: Something like a computer, referred to as "Digital Terminal Equipment" (DTE), or something like a modem, referred to as "Digital Communications Equipment" (DCE). The signal wires on DTE-DCE connections connect to each other straight-through, but for DTE-DTE connections, you need a null modem cable -- swapping RxD/TxD, DTR/DSR, and RTS/CTS. (This is similar to a crossover cable, but with some extra signals.)

Adapting Serial to RJ45

Although serial ports have 9 pins, the number of devices making use of the "Ring indicator" pin has fallen off sharply in the past 2 decades. This leaves only 8 pins, so conversion to an RJ45 connection is very common in practice.



The straight-through serial cable uses a standard RJ45 patch cable, with two RJ45/DB-9 adapters whose pin mapping (based on Cisco's console cable wiring) is as follows:

DTE Signal DB-9 Pin RJ45 Patch In RJ45 Patch Out DB-9 Pin DCE Signal
CTS 8 1 1 8 CTS
DTR 4 2 2 4 DTR
TxD 3 3 3 3 TxD
Gnd 5 4 4 5 Gnd
5 5
RxD 2 6 6 2 RxD
DSR 6 7 7 6 DSR
RTS 7 8 8 7 RTS
RI 9     9 RI



The null-modem cable uses the same RJ45/DB-9 adapters as the straight-through cable, but uses a "rollover cable" to properly swap the pins. Notice that the rollover cable can be thought of as a regular patch cable, but with one connector on "upside down".

DTE Signal DB-9 Pin RJ45 Rollover In RJ45 Rollover Out DB-9 Pin Remote DTE Signal
CTS 8 1 8 7 RTS
DTR 4 2 7 6 DSR
TxD 3 3 6 2 RxD
Gnd 5 4 5 5 Gnd
5 4
RxD 2 6 3 3 TxD
DSR 6 7 2 4 DTR
RTS 7 8 1 8 CTS
RI 9     9 RI

USB Wiring

TBD. Cat5 "USB Extenders" exist, and although there is no standard for how the signal is adapted to the 4 pairs in Cat5, many of these pick a pair each for +5 and Ground. In practice, intercepting the power and running a higher voltage over the wire (stepping it down at the far end for added current) is feasible.

Recommended Tools

RJ45 Crimpers

This style of crimper is one of the best in terms of reliability and ease of use, for roughly $20

Crimping RJ45 takes practice, but no amount of experience can overcome a poorly-designed tool. Avoid any crimp tool that features replaceable dies (meant to accommodate a wide range of modular jacks); stick to the ones that do one job -- crimp RJ45 -- and do it well.

Wiring Tester

A $2.99 "keychain Cat5 tester"

For our purposes, the best cable tester that you can get is most likely the cheapest. Sophisticated cable testers have a handheld and a remote end, show you wiring maps, and can even tell you the positions of any breaks in the individual cables.

You just want one that lights up to show you -- one pin at a time -- how the wires are connected (if at all).

Flowchart for Identifying and Dealing With Cables

Personal tools
Wiki Maintenance