Hacker News new | ask | show | jobs
by notthetup 34 days ago
Nice but it’s huge! I’d prefer something smaller like these 3 pin magnetic connectors from Aliexpress. https://a.aliexpress.com/_c4CtK0gj
4 comments

And where do I put Vref, RTS, CTS, and plug detect? That's 7 pins ;)

</jk>

Less of a joke though: those aren't polarized, how do you not accidentally 180° them? Are they magnetically polarized or what?

[ed.: I didn't initially see it, they're mechanically polarized, one "short end" is flat, the other rounded.]

You'll be wanting these: https://www.digikey.com/en/products/detail/edac-inc/686C0731...

And yes, they're magnetically polarized according to the datasheet. To answer the sibling comment, they're through-hole soldered but frustratingly are 2.7mm not 2.54 so you'd be squeezing a little into an existing header (ignoring clearance on the side anyway). I'm not sure why the 7-pin is obsolete, they make up to 5-way active.

Or Adafruit? https://www.adafruit.com/product/5468

Yes, yes :). I was really joking with the 7 pins.

It would be amazing though to make it a hermaphroditic 4 or 6pin connector. With a pinout like this:

  GND TX [VrefTX VrefRX] RX GND
So it always plugs at a 180° rotation, connecting RX to TX. And any cable also rotates 180°. Since you always have an odd total of (connections + cables), you always get the right connection...
Better yet, you could add more pins and switch them to using differential pairs to make it extensible for more use cases. While you're at it, you could have pins on both the top and bottom of the connector, and use a pair of sense pins to detect orientation, so that super specialized use cases can use every single pin available on the connector.

  GND TX1+ TX1- VBUS CC1  D+   D-   SBU1 VBUS RX2- RX2+ GND
  GND RX1+ RX1- VBUS SBU2 D-   D+   CC2  VBUS TX2- TX2+ GND
If only you could buy receptacles for this for like five cents a pop...

(If you do this, make sure that you don't send more than 3.3ish V over a pin, and that you're tolerant of 3.3V incoming, so that you don't explode yourself or victim devices if people randomly plug you into things. https://github.com/google/usb-cereal is a reference design for a UART over USB-C SBU adapter used for Pixel phones)

I noted this in https://news.ycombinator.com/item?id=48079649

I also pointed out in that comment that USB-C debug accessory detection does not support orientation detection - and neither does the Google adapter you linked (it doesn't use debug accessory mode, and doesn't have some other solution either). As they say: "Determine correct orientation - top vs. bottom - the tool operates correctly only when SBU1 pin corresponds to TX and SBU2 pin corresponds to RX."

The fact that you can't detect orientation in debug accessory mode is a direct result of how it works: both CC lines are connected to the peer; normally the cable pulls one of the two to ground which is then your orientation reference for all the other pins. (This is also why you can't use a regular USB-C receptacle for debug accessories, it has to be direct to plug, the 2nd CC line doesn't go through the cable.)

So, if you use the SBU pins, it's not reversible anymore. If I remember correctly, debug accessories must still put USB on D+/D-, so the remaining option is to put serial RX/TX on the high speed pins, twice each on 180° positions.

Frankly I'm amazed that a solution exists that isn't hundreds of dollars. Some of these niche connectors can be really spendy.

I think rotation is a bit extra though. The frustration with the dupont/0.1" headers is that they're not polarized. As soon as you add a key (or a literal magnetic polarity here), that problem goes away.

There are possibly ways to handle orientation in software. If you did a 4-pin and include VCC, the pinout on the pi is hi-lo-tx-rx, so you could look for hi-lo-hi-hi and wait for some period to identify any logic transitions on the tx pin. There should always be a period where that pattern is correct, because either the output is idle (high) or it's sending a bit sequence which will also involve a high somewhere. If you ever see the "2nd" pin high, you know it's not ground. Then your serial transceiver needs some way of setting up rx/tx or tx/rx (either you remap the pins, software serial, or use an analog multiplexer).

For a minute there, I was picturing a connector with an odd number of pins (3), and was actually hoping that they were indeed non-polarized. This would allow for ground to be on the middle pin and for directional signals to radiate outward from there.

So, for example, with 3-wire serial and a non-polar 3-pin connector: TXD and RXD backwards (again) so nothing talks? No worries: Flip the connector 'round 180 degrees, and it works.

Same goes for CTS, RTS, DTR, DSR, and so on.

If you have money to burn, get some LEMO push-pull connectors. They'll run you about $80 for a pair of each gender, but when you use them, you understand why trendy audio gear and instrumentation/optical OEMs use them. Occasionally when I make a project I treat myself and use them. Cheaper options are Mini XLR and Hirose HR10. Molex make a lot of wire-wire, but they're typically not rated for more than 25-50 cycles.

Those magnet couplings are nice. EDAC make a non-Aliexpress version, about $25 a pair.

One side could be flush with an enclosure, but it's not clear how you attach the other side to a cable. There doesn't appear to be any housing to cover soldered wires, for instance.
Do you solder them to a PCB directly?
They have PCB mount versions also I think.