Fork me on GitHub

Project Notes

#633 USB to RJ45 Adapter

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



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


The connector on my cat5 cable:



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.



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:


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, 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 (IMHO!).

The projects are usually inspired by things found wild on the net, or ideas from the sources such as:

Feel free to borrow liberally, and if you spot any issues do let me know. See the individual projects for credits where due. There are even now a few projects contributed by others - send your own over in a pull request if you would also like to add to this collection.