keskiviikko 4. huhtikuuta 2018

DIY Virtual COM port cable

Sometimes someone has a need for virtual COM port (VCP) cable for USB port. So had I. However, I found no instruction whatsoever from Internet, about how to build such a cable oneself. I had a basic idea what is needed but I had to find the wiring diagrams.

After finding some miscellaneous pieces of information and asking help from here and there, I was  able to successfully construct such a cable. I decided to publish this how-to in my blog, because I may need the instructions later. And maybe You, dear reader, find these instructions useful. Sharing the useful tips is the basic idea of being a hacker, isn't it?

What you need:
  • TTL to USB Serial Converter
  • regular USB-A to micro-B cable
  • some basic electronics workshop stuff, such as soldering iron, pliers, and insulating tape
That's all!
For TTL to USB Serial Converter cable I purchased TTL-232R-3V3, cost was around 20€ from Farnell. I have a drawer full of USB-A to micro-B cables, it's the one which is the most common charging cable for almost any mobile device nowadays, cost is "next to nothing". Indeed if you buy a high-quality cable from brand store, you need to pay more. Some USB cables contain only 2 wires, so they are only for charging. You need to use one that has 4 wires.

Assembling the cable is an easy task for anyone familiar with soldering iron.  First, peel off a bit (like 5cm) of the micro USB cable from about 30cm from the USB-A end. Leave the red wire (Vcc) untouched. Peel the black (or sometimes it's blue) wire (GND). Cut the white and green wires. Now take the USB/Serial converter cable. Solder the black cables together. Finally solder the green to yellow and white to orange. See the illustration below to understand... it may sound more difficult than it is.


Here is an image from regular USB cable pinout for clarification; Data wires can also be blue/green.




So, after making the connections you should have a three-ended cable. One end is micro-USB. That's the one you connect to the "device under test". And you have two USB-A ends, one with Serial Converter inside for Virtual COM port connection, and another USB-A end with just power wires connected, for occasional charging of the device under test. You may need this in your application, or not. For example, you may want to read the data from the device with charging it at the same time. Anyway the VCP cable itself works just fine also without the power connector.


I made two cables at the same run, black/white and black/black. One for me and another for colleague.

Keywords: VCP cable, Virtual COM port cable, USB COM port cable, USB serial cable, FTDI cable, TTL-232R cable, virtual USB COM cable, USB port COM adapter, COM port adapter for USB, VCP adapter, USB-A micro-B VCP cable,

Ei kommentteja:

Lähetä kommentti

Hei! Blogin asetukset mahdollistavat tällä hetkellä anonyymin kommentoinnin. Toivon silti asiallisuutta. Jos haluat mieluummin antaa suoraa palautetta, mailaa osoitteeseen gemini[at]live.fi. Olisi myös kiva jos anonyyminäkin allekirjoittaisit viestisi tavalla tai toisella, esim. etunimellä tai nimimerkillä.
Kiitos!