The USB Null Modem Cable Is Now A Thing

The classic serial null-modem cable was, among other things, used to connect two computers together for communications and file transfer. Largely eliminated in daily use by the advent of home networking, there are still fringe applications where such a thing can come in handy. [Nick Sayer] needed just such a tool, but one that would work in a modern USB environment. Enter the isolated USB null-modem.

The device consists of two USB Communication Device Class, or CDC chips, creating a USB serial port for each attached computer. The TX and RX lines are cross-connected to allow communication between the two sides. Rather than directly connect the lines, however, they pass through an opto-isolator. This is important, as it allows two computers at different ground potentials to be safely connected to each other without damage.

[Nick] originally created the device to solve a specific problem at his day job, but community response was large enough that he was kind enough to share the project online. Expect to see devices available on Tindie in future for those that need a hookup. While it’s not something everyone will need, for those that do, it should come in handy. If you’re looking for other useful applications for USB-serial devices, there’s plenty – you can even try your hand at software-defined radio!

87 thoughts on “The USB Null Modem Cable Is Now A Thing

    1. Yes, but the important concept here is that it is opto [ ground loop ] isolated. I’ve lost a pair of computers because the ‘grounded’ outlets they were plugged into ended up with one non-grounded, so it sat at half line voltage [about 60VAC], and the other with a proper earth ground. There was an interesting spark when the grounds of the two computers connected via the shield conductor of the cable

        1. Did you read the article about the project itself? There’s a link to it in the current article and it’s almost entirely and completely about making the thing safe. #eeyore

        2. A difference in ground potential is not necessarily an issue at all. Most modern ungrounded electronic devices with metal chassis (laptops, tablets, hifis, etc etc) can float you well above local ground potential when you touch them. Ever felt a tingle from your laptop when you touch it and a ground at the same time?

          Safety issues only arise when the internal resistance of such a source is sufficiently low to drive significant currents.

          So, from that perspective, your comment is somewhat uninformed, not to mention downright rude.

          Given that RS232 / 422 / 428 etc are more than capable of handling this sort of scenario, the more interesting questions are therefore around the application:

          * Why weren’t existing commercial products sufficient?
          * What is causing the safety concern –> This is actually the biggest concern. If there is a device which has such a high ground potential, and is capable of sourcing sufficient current to be dangerous, then I’d be significantly more worried about the safety of the operator
          * Is the need specifically for serial, or will something else (eg Ethernet) which has inherent isolation suffice?

      1. That being said, it’s exceptionally dangerous to *leave* a computer like that, so in some sense, using an opto-isolated setup commonly like this isn’t a good thing: it’s better to test the ground potential between two devices first if you’re worried your electrician was an idiot.

        1. Uh, you should realize that any device plugged into the wall with just a 2-wire (no ground wire) cord does exactly this: the chassis is coupled to both hot and neutral through stray capacitance, and tends to float at around the halfway point.

          If you touch that “live” chassis and provide a path to ground, you’re shunting that half line voltage to ground. It’s pretty low current, limited by that stray capacitance. With the capacitance in the line filters in modern SMPS, it amounts to 10-20 microamps. Definitely detectable if you’re paying any attention, but not hazardous.

          Macbooks in particular are an egregious example of this: if you use the “travel” adapter with no ground the computer’s metal chassis wrist pad floats at 50-60V and you get a persistent low-level tingling effect. Most people don’t notice it until you explain it. Maybe they attribute the tingly effect to owning an Apple product, I dunno.

          Another offender is electric blankets: they capacitively couple to you, and if you reach out to touch a grounded object or a partner not under the blanket, you get a tingly feeling in the fingertips. Annoying. Especially to said partner.

          1. “Most people don’t notice it until you explain it. Maybe they attribute the tingly effect to owning an Apple product”

            Why must you ruin the magic with reality? That is just cruel.

          2. You Americans got the nice end of the deal. I curse Steve/Tim every day as I think a tingly 115 V is just bad design. Definitely not the “Swiss finish” I am accustomed to (and paid for when obtaining this mbp…)

        2. For low frequency, the amount of capacitive coupling isn’t much as the impedance is inverse proportion to frequency. It become more of a problem for a high frequency SMPS.

          A friend of mine told me that his SMPS is tripping GFI, so it is more than tens of uA. I even have him sent me the internal pictures and there wasn’t any irregularity of short cuts on components. Let’s say there are some dangerous ones around.

          Since OP did not specify the cause of the voltage, I do not try to make any non-safe assumptions. If there are sufficient current tohave sparks, then it is more than tens of uA.

          1. The operating frequency of the SMPS is irrelevant, since that frequency does not appear on either the line or the output. SMPS are relevant here only because they usually require much more filtering on their AC input lines than their linear brethren, so typically have much more capacitance between line and chassis ground.

            A GFCI measures only the AC line (source) current difference between the hot and neutral. The SMPS operating frequency has nothing to do with that.

            A GFCI shouldn’t trip at less than 5 mA difference between hot & neutral. If a typical small SMPS is tripping a GFCI then one of them is faulty.

          2. The leakage current is redirected current from EMI filter (common mode choke and Y caps) back to Earth ground. The operating frequency *is* important as you are talking about Y caps may be at tens of nF. If it were switching at 60Hz like transformer, you wouldn’t have this issue.

            You might want to read up on EMI filter design for SMPS to fully understand on this subject. I have done my share.

            The one my friend has a Earth connection and the leakage current flowing into the Earth causes the unbalances that trips the GFI. Don’t assume faulty components when there can be faulty designs out there (i.e. uncertified SMPS).

          3. It’s probably an Arc Fault Circuit Interrupter. These pesky devices are required in new home construction. They attempt to detect arcing and flip when they sense a wave on the line that looks like arcing. Anything that puts the frequency and characteristic that looks like arcing on the line will trip the bastards. A crummy switching wall wart will do it. I had to build a filter for the AC plug line by looping it through a ferrite ring 6 or 7 to stoop the nussance flipping.

      2. So very few know the issues associated with ground potential. This is an age old problem in electronics that date as far back as the tube era.

        Today this is exassorbated by laptops and wiring to electrical outlets, breaker boxes and variations in XO grounding. As for the USB issue. It is complicated by a laptop to laptop or desktop. Presently there are no methods of ensuring both devices are subject to the same ground potential.

        The Optoisolator is the most eloquent solution to this problem. This is brilliant. And just in time for Thunderbolt 3 and 4. Where transfer speeds can reach as high as 40Gbps.

        1. Even having a 3 prong laptop power supply is no guarantee your laptop itself will be grounded. I measure no continuity from the negative output to the power supply ground. I guess the ground is only taken to the power supply for noise/transient suppression and shock safety is provided by double insulation.

        2. Alas, this particular iteration is CDC based, so the transfer rates won’t exceed one or two mbps.

          In principle you could make an isolated thunderbolt cable, but I’m not sure you’d use optical isolation to do it. In any event, going beyond USB 2 goes above my pay grade, I’m afraid.

  1. Seems like a handy thing to have in a toolbox, just in case. The nice thing about null modems was that it didn’t require a switch or ton of infrastructure. I was a little surprised that USB didn’t have this ability, natively.

    1. Apple computers with Firewire had the ability to boot as an external drive and network over Firewire, both of which should definitely have been standard features in USB. Better yet, my iMac has the ability to act as an external display over displayport – which should be a feature in HDMI-connected AIOs and botebooks, imo.

      1. Have you tried using your iMac as a DisplayPort-display? It a hardly-supported mode and only works with a handful of Apple-computer on the other end of the cable. And the iMac needs to run full tilt “behind the curtains” for this to work. It’s a rather poor implementation they’ve made unfortunately. Lenovo have some Thinkcentre’s that have bi-directional HDMI-ports, and will work as a monitor while the PC part is shut down. That’s how it should be done.

        1. It was intended to allow you to make use of the very nice display in an iMac once the iMac itself was getting old.
          Given that my 10 year old imac is Only now nearing replacement (but still has more poke than my new windows laptop), that was probably over engineering…

          1. … Except that Thunderbolt / USB-C (at least the implementation in Apple’s machines) supports peer-to-peer mode just like FireWire (look up Target Disk Mode).

    2. Zarthrag said: “…I was a little surprised that USB didn’t have this [auto-crossover] ability, natively.”

      FYI I think Ethernet has it provided your port has an “X” at the end of the specification, such as 100BASE-TX (i.e. 100B-TX) versus 100BASE-T (i.e. 100B-T). If memory serves the formal name for it is “Autonegotiation”. So if at least one of the two ports being connected together with a typical (e.g. CAT-5) Ethernet cable has autonegotiation, then you do not need a special physical “cross-over” cable. But I’m not sure how it works if both ports being connected together both have autonegotiation – how do they avoid a glare condition? I guess that’s what the “auto” part means in autonegotiation. So yeah, if Ethernet can do it easily, why can’t USB?

      1. USB is designed with host/client in mind, Power providing is way more difficult if you make it peer to peer, that’s why the PoE devices are more complicated than just an ethernet-interface.
        Thanks to this, USB has been as useful as it was. Nowadays it is becoming more simplified then ever, but back in the days…

      2. And even though USB is host/peripheral, it does support auto-negotiation for role selection when one or both sides support dual role. It’s what the ID pin does on USB 2.0 micro and mini connectors and all 3.0+ connectors.

  2. You can make a fairly nice one of these from a couple of cheap serial adapters and jumper wires, you probably already have everything you need just lying around the junk pile. I use one for debugging serial protocols, it’s very nice to have both ends of the conversation happening on the same computer.

    1. I made one myself out of a Quad RS232-USB converter.
      It’s really useful for connecting two programs on a platform that has no proper null-modem emulators/virtual serial ports.
      Such as *nix and Win9x.

      By using that USB null-modem, I was able to connect UI-View with MixW2’s TNC emulation,
      for example.

      Other use cases might be connecting
      DOSBox and other emulators via null-modem connection.

      That way, I can bypass all the trouble with TCP/IP connections. No blocked ports, no firewall issues etc.

    1. I have encountered cheapo $3 USB Ethernet adapters that do not have any isolation inside. They bypassed the transformer and connect directly to the chips.

      I wouldn’t recommend those even when they have transformer installed as the 0603 resistor pads violates isolation rules. You’ll need at least 1206 with ~2mm spacing between pads to get to 1000V.

        1. One of my hub+media reader uses silicon diode drop as the 3.3V “regulator”. The chip blew up when I move it directly to the USB port and the higher than expected voltage (closer to 5V) blew up the chip. Any real engineer *should* knows that the USB has a large input range and should never assume it to be fixed.

          If only they actually used a zener and diode. Not to say that the tolerances and proper loading of the zener diode would be done properly either.

        2. Actually, a zener and a resistor can be a *very* practical and cost effective regulator – – for the right load.

          And if designed correctly, it will fail undervolt in case of of excess current draw.

          That being said, a pass transistor can be had for 3 cents, and a real requlator for a dime so yeah, you should probably use better regulation in a real design

  3. Ahh, the joys of asynchronous serial communications. So many ways for it not to work. The mysteries of RTS/CTS Ring detect carrier detect, baud rate, software flow control or hardware flow control, how many bits, what kind of parity

    1. I used to have a box full of null modem adapters for different applications, plus some that had pin breakouts for custom wirings.

      I see a lot of people mentioning “LapLink” cables. LapLink was a very specific cable/application for connecting two Windows PC’s together. It didn’t work well in other environments. No support for Mac OS, no support for Linux, etc.

      Also it seems like a lot of people are missing the point of this, it can handle transfer when the electrical characteristics of the two systems don’t match. Something I never had to deal with.

    2. Reminds me of the time I tried to decipher the one-wire serial signal of Sony Ericsson walkman phones that were used for complex add-on devices, from about 15 to 20 years ago.
      Keyword is “tried” because my hardware adapter worked fine, but they did some arcane magic to the serial communication.

        1. What he said.

          There is something to be said for the potential to moot baud rate and word format issues. You could use two chips that implement the CDC protocol that ignores the baud rate set on the USB side, but use a standard (and very high) baud rate over the isolation barrier. That would mean using a microcontroller and a software implementation of CDC. Very doable, but just buying the Cypress Semi chips is vastly more convenient.

  4. I used something like this a couple of years ago for a security application where we had a sensitive isolated network but still had to move files quickly to/from the public network.

    We had side-by side machines on each network with something like this in between as the only link. The files moved over the serial link via an old-school serial file transfer program running on each machine.

    A security professional wouldn’t call it bulletproof, but we felt a lo-fi system that had to be manually set up on both sides for each transfer was more secure than physical USB devices and way more convenient than burning endless CD roms.

    1. I can’t see a reason for having BOTH machines connected to their respective networks at the time of transfer? At that point you DON’T have a “sensitive isolated network”.

      1. If neither computer can accept commands from the other side, it’s not any more networked than swapping a USB flash drive back and forth makes you (though you could view that as a sneaker network, if you were so inclined.)

  5. People have mentioned the old “double bulk pipe” device from the 90s that was designed to do this job. And, indeed, there are still Linux and FreeBSD drivers that can be used with those chips to make point-to-point network interfaces.

    I went with CDC for this use because I specifically needed them to be serial ports for my application. The original version of this wasn’t isolated, but as the project sort of blew up on Twitter, I had a lot of people specifically pining for isolation and for inclusion of the flow control pins (which weren’t used on the prototype), so here we are.

  6. I have a USB A to A device hanging on my cable hooks that does exactly this from ten ish years ago. It even emulates a USB drive on both PCs so you can install some additional built in software that gives you more functionality like the ability to control the PC on the other in with a VNC like server/client app. Still works great though it’s only USB 2.0 so speeds aren’t that impressive.

        1. That USB A-to-A device is often called a “double bulk pipe” because of how its functionality is actually implemented in USB (a pair of bulk pipes on each end, one in each direction, cross-connected in the middle).

  7. The old codger in me wasabout to say, just use an ethernet crossover but then I remembered most laptops don’t have wired ethernet. So yeah, good idea. I would be tempted to have the two sides connect via ethernet so files can be transferred faster. Also appreciate the comments around isolation. Probably better than my strategy of just using an old cheap laptop :)

  8. It’s really useful for connecting two programs on a platform that has no proper null-modem emulators/virtual serial ports.
    Such as *nix and Win9x.

    I am pretty sure that tee is available on every *nix, even things like busybox base distros usually have it. Worst case you can do a bit of piping and use cat.

  9. I remember transferring a crap ton of files from a Win95 486 machine to it’s replacement 400mhz Win98 machine back in the dial up days with one of those USB PC-link cables. Worked as advertised, but 1 gig of data moves really slow over USB 1.
    I got fed up and just pulled out some CAT5 and made my own “twist” cable and let it eat. Not many people had home networks then, and wifi was pretty exotic and still as slow as USB, so I thought I was pretty slick.
    I never even gave a thought to a ground potential issue, lucky I’m blessed with good wiring I guess. But I would have thought the shield on the USB cable would have balanced that before the internal pins connected, no?

    1. Reading between the lines, it sounds like you used TP Ethernet. The magnetics that are on each end of the TP line offer galvanic isolation, so you were good.

      My particular application requires CDC, so I couldn’t use Ethernet.

          1. Got it. Sorry, to me that’s like saying “hose pipe”, so it doesn’t register.
            The ground potential question was only referring to the USB cable.

  10. I remember seeing one of these USB Null Modem contraptions that was truly isolated via one Analog Devices Inc. (ADI) ADUM3160 galvanic USB isolator chip:

    Working from memory: You only need one of the galvanic USB isolator chips because the two back-to-back USB/UART chips and only one side of the galvanic USB isolator chip are powered by one of the two USB connections. The other USB connection powers the other side of the galvanic USB isolator.

    The ADI ADUM3160 galvanic USB isolator chip isolates both ends of a straight-through USB connection using on-die signal transformers. The ADUM3160 provides 2.5 kVrms of isolation while the ADI ADUM4160 provides 5 kVrms isolation. Both parts provide 12 Mbps of data throughput per direction. The ADUM3160 is $3.13 @ 1k while the ADUM4160 is $5.04 @ 1k.

    N.B. I am not affiliated with Analog Devices Inc.

    1. I am going to experiment with a similar chip to replace the optoisolators. The isolation voltage isn’t quite as high, but it’s certainly enough for this application. The benefit is that they’re a LOT cheaper.

      As for double-bulk-pipe style devices, for my application is *has* to be CDC.

  11. Very cool. I’m curious though, why go through all this for USB? I’d argue that it is just as common for any computer with USB to also have a hard wired Ethernet port. In which case, a single cable between the two computers would give the same result. Modern computers don’t even need a crossover LAN cable.

    1. At the Day Job there was a specific need to connect two things via a pair of null-modem’d CDC devices. In this particular case, the manufacturer recommended two USB serial dongles with an RS-232 null modem, but I came up with a consolidated design. I posted that on Twitter and to my surprise there was a lot of interest.

  12. If isolation is what we need, I believe a pair of USB to Ethernet adaptors can achieve the same thing at much higher speeds, since Ethernet endpoints are magnetically coupled.

    1. Upon reading your reply to other comments, I realise that your requirements are quite different. Still…. If latency is not an issue and it does not have to be USB-CDC specifically, maybe Serial over LAN could work out for you. Anyways great project! Despite the alternatives, it definitely makes senses why one would need an isolated serial null modern.

  13. I (and many others) always dfd that by using two PL2303 (or similar) USBTTL cables and just crossing rx and tx and connecting the others straight. Considering each costs about $2 I fail to see the adavntage of having a device you use only with that. Meh.

  14. What about this? Just have one person sit in a room looking at a screen displaying the data from the first system to be transferred in hex. That person uses a flashlight to blink out the data using morse code. There is another person in another room watching for the light flashes that enters the data into the second system using voice to text.

    Oh, wait, you said this was a thing you did to solve a specific problem with a work thing that you just shared because it was interesting.

    And, gosh you guys, all the other comments related to floating grounds and live laptop chassis were all very scary to read. I had no idea that all electronics are so poorly designed that even looking at them funny will let the smoke out AND electrocute me. I will never, never, never again look at two electronic things funny at the same time.

  15. Laptops as mentioned are only grounded on the AC side of the supply, not on the SELV side , you only need to look at the headphone type Jack to see the continuity to earth ground is lost. Grab your old school VOM lol aka multimeter. You’d be surprised how inconsistent AC power level are across the USA and even worse in other countries and how often ground floats high. You’ll start wearing rubber socks at all times

  16. Congrats on the device. But like so much today, one already exists.

    Such a gadget has been available by on Tindie for quite some time. It’s less than $7 US, available now. It’s made by same gentleman in England who makes the ClusterHat (and variations). His store has sales from time to time. I used the $5 Royal postal rate and received my purchase is just over a week.

    He offers several other USB Serial adapters for Raspberry Pi that are unique and really slick — like his push-pin one which can have it’s pins de-soldered so you can “flush mount-it” to the underside of any Raspberry Pi preventing interference with any Hat.
    The product page also lists the baud’s miss rates – which is super helpful.

  17. Device exists! already been done! sure but this has built in Setec Chips hacled by a Chinese shaped country (installed in tiawan to ensure lower failure rates) ,much more than two tin cans and oh wait that was unclassified right??

    RoffHELL. ]:o)

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.