Main Content

Isolated USB null modem

Connect two hosts via a serial connection, but with total galvanic isolation

I needed a way to connect two USB hosts via CDC devices. You could do so by just buying a pair of USB-RS232 dongles and connecting them with a null modem, but that still winds up connecting the two hosts’ grounds together. If their grounds are not equipotential, the result could be disastrous.

As you look at the schematic, note that there are two 5 volt rails and two grounds. Nothing is allowed to cross over the isolation barrier at all (except light inside the isolators). We need to move 3 signals in each direction. The TLP2270 is a logic level isolator pair, so we need 4 of them for 6 signals (wasting one channel). Take careful note that two of the isolators are upside down relative to the other two. That’s because each host needs a pair of primary and a pair of secondary sides.

The primary side of each isolator is just an LED, but in this case the forward current of the LED is quite low - the absolute maximum is 8 mA. By using a 1 kΩ series resistor we wind up with something like 3.5 mA, which is both comfortably above the minimum activation threshold and below the maximum The output is a simple logic output that’s compatible with the inputs on the UART chip. The tricky part is in understanding that the secondary side shares the 5 volt and ground of the host it talks to, but the matching primary side shares its ground with the other host.

The wiring of the null modem is TXD->RXD, CTS->RTS and DTR->DSR+DCD, which is a fairly standard configuration.

The USB UART chips are the Cypress CY7C65213. They present a standard CDC interface over USB. The USB connectors are USB C 2.0 types. They can connect to USB C hosts or to legacy hosts via an A->C cable.

The last note is that you should take careful note of the fact that the groundplane for each host stops just beyond the line of isolator pins. Under the isolators there is no copper at all. While the TLP2270 has an isolation voltage spec of 5 kV the two ground planes are only 6.3 mm or so apart, which gives you up to 2 kV, depending on what pollution degree you choose. Still, for the ordinary use case, this should be plenty. Two hosts close enough together to reach via USB that have a ground potential difference more than a handful of volts would already be a fairly dangerous situation.”

Link to article