Fork me on GitHub

Project Notes

#633 USB to RJ45 Adapter

Building a USB to RJ45 adapter with the CH340G and MAX3232 chipsets.

Build

Notes

Occasionally one will run into a device that uses an RJ45 serial connector instead of the old DE-9 connectors. They are still carrying RS-232 serial

A RJ45 connector is a modular 8 position, 8 pin connector used for terminating Cat5e or Cat6 twisted pair cable.

RJ45 connectors used in this way are generally 8 position, 8 pin connector modular connectors used for terminating Cat5e or Cat6 twisted pair cable. The wiring usually follows the T568A or T568B assignments that are defined in ANSI/TIA-568.

I am using RJ45 T568B cables in this mini project.

The EIA/TIA-561 standard describes the use of 8P8C connectors for RS-232 serial interfaces.

However it appears many vendors have their own proprietary wiring schemes, which would explain why cables dont always work as expected! The table below shows the T568B wiring color scheme with EIA/TIA-561 pin assignments, compared with SGI Onyx2 pin assignments, and finally the pin assignments for the device I grabbed to test with (Nomadix AG2400).

Pin T568B color EIA/TIA-561 Serial SGI Onyx2 Nomadix AG2400
1 white/orange stripe RI RTS RTS
2 orange DCD DSR DTR
3 white/green stripe DTR DCD TXD
4 blue SG RXD SG
5 white/blue stripe RXD TXD SG
6 green TXD SG RXD
7 white/brown stripe CTS DTR DSR
8 brown RTS CTS CTS

RJ45-Pinout-T568B

The connector on my cat5 cable:

RJ45-T568B-connector

Construction

The construction builds upon a previous project LEAP#510 USB to RS-232 Adapter, adding as RJ45 adapter made from a spare length of Cat5 with RJ45M connector. A strip of 10-wire IDC cable is used to connect the RJ45 adapater to the main USB to RS-232 Adapter subsystem.

bb

schematic

Connecting with Screen

NB: the CH340G may require drivers to be installed - see [LEAP#406 UsbUartCH340G] where I covered this in detail.

I’m using MacOSX, so (as with Linux) the most handy console utility is screen.

The device I am connecting to for a test requires 9600 baud, with 8 data bits, no parity and 1 stop bit. The CH340G adapter was connected on /dev/tty.wchusbserial1410 device, so a screen session is started with the command:

$ screen /dev/tty.wchusbserial1410 9600,cs8,-parenb,-cstopb,-hupcl

…and communication is up and running without any problem:

console_connected

Credits and References

About LEAP#633 RS232SerialUSBRJ45
Project Source on GitHub Project Gallery Return to the LEAP Catalog

This page is a web-friendly rendering of my project notes shared in the LEAP GitHub repository.

LEAP is just my personal collection of projects. Two main themes have emerged in recent years, sometimes combined:

  • electronics - usually involving an Arduino or other microprocessor in one way or another. Some are full-blown projects, while many are trivial breadboard experiments, intended to learn and explore something interesting
  • scale modelling - I caught the bug after deciding to build a Harrier during covid to demonstrate an electronic jet engine simulation. Let the fun begin..
To be honest, I haven't quite figured out if these two interests belong in the same GitHub repo or not. But for now - they are all here!

Projects are often inspired by things found wild on the net, or ideas from the many great electronics and scale modelling podcasts and YouTube channels. Feel free to borrow liberally, and if you spot any issues do let me know (or send a PR!). See the individual projects for credits where due.