Hacker News new | ask | show | jobs
by foresto 42 days ago
FTDI (the company practically synonymous with TTL serial adapters) uses 3.5mm tip-ring-sleeve connectors for this. In other words, a common headphone jack.

I added one to my single-board computer enclosure, following FTDI's wiring. Now I can easily connect whenever I need to use the serial console, and a standard 3.5mm audio extension cable will let me reach across the room without moving my main computer. Replacement parts, if I ever need them, are cheap and easy to find.

Here's the pinout:

https://www.ftdichip.com/Support/Documents/DataSheets/Cables...

4 comments

That really sucks for hotplugging since TRS connectors sliding in basically make random connections before seating properly.

Granted, you shouldn't hotplug TTL serial, but everyone™ does it anyway. (In some situations you're even forced to, to avoid reverse powering something.)

I've been using this ftdi cable too for the last 15 years or so and, while trs isn't a great connector, I haven't had any issues in practice.

It works well for capturing serial logs, a console or software updates in development. The advantage i saw was that I could order 50 cables from a distributor and give one to everyone that works on the device.

If someone needs one on the other side of the world, they can get one from a local suppliers.

Hot plugging hasn't been a problem in my designs, I add a series resistors to the uart net and ESD protection if software developers will use it.

When I use it for other devices, like routers, SBCs and IP cameras I avoid hot plugging and leaving it connected when the device isn't powered.

They're not random connections; they're predictable. I'm not worried about Tx briefly touching Rx or ground in these devices.
Random in the time sense. You'll get junk on your serial line, depending on the scenario that can matter a lot.
My scenario is connecting terminal emulators to getty or u-boot, which I think is a common one. A blip of line noise when plugging in would be barely considered an annoyance, easily cleared by pressing Backspace.

But yes, if someone happens to be using their serial line for some kind of sensitive signaling, then I would agree that choosing a more isolated connector (or just avoiding hotplug) would make sense.

There's a small risk of CPUs and I/O pins getting fried if GND levels aren't equalized first and instead that equalizing force would go through those pins. One could argue that it's hardware designer's responsibility to save users from such things, but then again, using a better connector than TRS can be one of them.
Thing is, for a serial TTL connector to become ubiquitous, it needs to cover at least something like 99% of scenarios. Or maybe 95%. 3.5mm TRS ain't that, and thus just increases general diversity in connectors.
In my experience noise on hot-plugging the serial adapter is a complete nonissue. I'm sure it matters for you, sometimes. But for this kind of embedded work, I'd say it's important far, far less than 1% of the time.
Using a male TRS 3.5mm audio connector is something you should do with care. When you hotplug that connector the plug's tip (T) may first make contact with the sleeve (S) of the receptible, then briefly hit the ring (R) until it finally lands on the tip connector. Same goes for the plug ring (R) which may have contact with the sleeve (S) of the receptible.

So expected are:

  T → T
  R → R
  S → S
  
and what can happen briefly is:

  T → S
  T → R
  R → S  
  
Depending on what you're using the connector for, that can ruin your day. Likely this isn't an issue on serial connections, but I have seen people use that connector for power..

On audio systems this is typically not an issue, since tip and ring carry signals that on any gear worth anything should have an output stage that can easily handle a connection to ground.

Every vendor defines their audio jack connector serial port differently. It is very dangerous to use 3.5mm jack. There is no pinout standard of using 3.5mm.

Even as pure audio jack, the 3.5mm connector has two standards, with the difference on ground and mic.

Well, not every vendor does it differently, because there are far more vendors than possible wiring permutations on a 3-contact connector... but I understand what you mean.

The same issue applies to PCB header pins.

And the same goes for 25-pin D-sub connectors, which have been widely used as RS-232, parallel printer, and SCSI ports.

Voltages vary, too.

This is why we check before wiring them to other things.

Funny - in the retail industry, we use a 1/4" jack instead that runs straight RS232 level traffic (for "DEX" - data exchange - typically sending invoices to a merchant from a route driver, or pulling data from vending machines on a route).

........ and the DEX pinout has Rx/Tx in reverse (our tip receives and our ring transmits) in comparison to the FTDI TTL setup. Wellp!