Fork me on GitHub

Project Notes

#510 USB to RS-232 Adapter

Building a USB to 3-wire RS-232 adapter with the CH340G and MAX3232 chipsets.

Build

Notes

This project implements a USB to 3-wire RS-232 adapter by combining two chips and their supporting components:

  • CH340G USB to TTL UART
  • MAX3232 TTL to RS-232

As a cheat, I’m using a MAX3232 adapter module - widely availably from aliexpress/ebay sellers. The module connects two TTL to RS-232 lines with all the supporting capacitors per the datasheet.

MAX3232ESE_adapter

I’ve sketched the actual layout of the module here. I didn’t measure all the capacitors, but I assume they are 100nF or thereabouts.

MAX3232ESE_adapter_layout

Construction

Breadboard

Schematic

For a prototype, I’m using a CH340G on a SOP-16 DIP adapter, and a MAX3232ESE adapter board. Here’s the protoboard layout I used:

UsbToRs232_layout

To complete the build, I’ve used a mini USB connector on one end, and a female DE-9 on a short IDC strip with connector to the board - so I could for example, swap it with a male DE-9 or other connector.

UsbToRs232_protoboard_build

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.wchusbserial1420 device, so a screen session is started with the command:

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

…and communication is up and running without any problem:

console_connected

Credits and References

About LEAP#510 RS232SerialUSB

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

Project Source on GitHub Return to the LEAP Catalog
About LEAP

LEAP is my personal collection of electronics 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.

Projects are often inspired by things found wild on the net, or ideas from the many great electronics podcasts and YouTube channels. Feel free to borrow liberally, and if you spot any issues do let me know or send a pull-request.

NOTE: For a while I included various scale modelling projects here too, but I've now split them off into a new repository: check out LittleModelArt if you are looking for these projects.

Project Gallery view the projects as an image gallery Notebook reference materials and other notes Follow the Blog follow projects and notes as they are published in your favourite feed reader