A USB-C connector on a flex PCB

Let's use an ATtiny84A as a structural element!

Similar projects worth following
The plastic tab inside a USB-C port is about 0.7mm thick. Turns out you can make a cursed USB-C port by attaching a 0.6mm tall ATtiny84A (in the BGA package) to a flex PCB.

This is part of an ongoing series of projects involving creative interpretations of the USB mechanical standards. You've probably seen 2.0mm thick PCBs that fit in USB ports, and maybe you've seen 0.6mm thick PCBs that fit in USB-Micro cables. So what about USB-C? The plastic tab inside a USB-C port is about 0.7mm thick. I think [bobricius] has had success using 0.8mm thick PCBs; 0.6mm thick PCBs are way too loose. I haven't found a fab that will do 0.7mm (or 28 mil) PCBs unless you special-order an entire panel.

So, what other ways are there to reach 0.7mm thickness? My original plan was to join an 0.1mm flex PCB and an 0.6mm FR4 PCB, but then I realized: you know what else is 0.6mm thick? The ATtiny84A BGA package. Granted, there are only contacts on one side of the PCB, but that shouldn't matter with the symmetric USB-C pinout, right? ...Right? (foreshadowing)

The 3mm-square ATtiny acts as a stiffener for the flex PCB, and it comes out to 0.7mm on the dot! I only have an imperial set of calipers as seen above. The dial shows 0.0275 inches, which is 0.6985 millimeters. So this is looking pretty promising for a cursed connector.

In a twitter thread, I documented the process of assembling the board I've called "Demo 1 Revision 1" which is featured in the photos above. The design files can be found in the git repo. There are three other demos listed there. I'm not sure if I will make any of them as they currently stand, because of what I found working with this one board. Specifically,

Here are descriptions of the boards found in the git repo:

Demo 1: RGB LED that can't be programmed over USB

Starting relatively simple, this is an RGB LED that juuuust barely pokes out of the USB-C cable plug. The ATtiny84A has to be programmed using that 8-pin FFC connector, and then the FFC connector has to be snipped off in order to use the dang thing. Right now I have one functional board, but I haven't cut the FFC connector yet because I would like some help improving the code.

Issues with this PCB: the RGB LED is not connected to the Fast-PWM-enabled pins on the microcontroller. As a result I have to use binary code modulation to achieve any sort of brightness control. It's working alright, as shown here (and further down that thread).

As you can see there is a large tab sticking out so I can grab and remove the PCB from the cable. However, out of spite for, uh, myself, I have labelled it the "cowards' tab." Past me is encouraging present me to remove that tab and make the board impossible to remove, thereby turning a useful cable into a cute little art piece for all eternity.

Demo 2: RGB LED that can be programmed over USB

It would be nice to use the USB data lines to program the microcontroller! I didn't attempt this for the first revision because I wanted to keep the board as uncluttered and simple as possible. It will result in a denser board that may need more careful soldering, but it should be possible!

As I understand it, I need to add at least five extra components: a pullup for the D- line, small resistors on the D- and D+ lines, and zener diodes as level shifters. This is the low-complexity approach used on the Digispark and its derivatives. I have not attempted to make this board yet. Also, look at the 3d render above; doesn't it look like an owl? I love it.

There is an interesting issue, however. In the USB-C standard, the D+/D- lines are only connected on one side of the plug! It assumes that the USB-C port has D+/D- connectors on both sides, so the plug orientation should not matter. But our USB-C port only has D+/D- connectors on one side. We've reintroduced the classic USB behavior of having to flip the device over 3 times before it works!

Demo 3: Basically a Digispark

In this version, the FFC portion is meant to stay attached! And all the components are 0402-sized with generous spacing so I can worry less when soldering. As a result it can be used in a slightly more...

Read more »

  • Repo updated!

    Sam Ettinger19 hours ago 0 comments

    I've finally gone and pushed some updates to the git repo. Demo 2, the one that's programmable over USB, was not in the repo until now; this is because I completely forgot I hadn't routed the PCB before I published the project! When I did start routing, I didn't find a way to connect all three LED channels, so I've elected to give it green-and-blue LED control only.

    In addition, I've added a fourth demo, which uses two 555 BGA ICs instead of an ATtiny84A. This is thanks to some "Coulda used a 555" comments on the post that made the Hackaday blog. Sadly I couldn't get those boards in time to enter the 555 contest, but it's still worth a go I think.

    I have a few ideas for how to address the short-circuit problems I encountered with the PCB I assembled previously. The obvious solution is to slap another flex PCB on top, which will create a double-sided USB connector. However, that would end up being about 0.85mm thick, which I worry would cause too much downward scraping force on the flex PCBs. There are vendors with thinner polyimide substrates, which I will look into.

  • Some updates

    Sam Ettinger01/01/2022 at 19:38 0 comments

    I failed to maintain a Single Source of Truth for this project—there's this project, the git repo, and a twitter thread. The twitter thread has newer details than the other two, so here's are the highlights!

    After the thread started getting attention, I went ahead and just cut the flex connector off, thereby locking in the code that was on the ATtiny84A at the time. It did nothing when I put it in a USB-C cable connected to a wall wart, I have not tried plugging it directly into a computer at this time. But I did jury-rig a power-only setup using a micro-USB breakout and a USB-C breakout. Red and blue worked, but then something crackled and damaged the red and green LEDs. I know, right? What a surprise, pushing the exposed components against long parallel rows of conductive fingers caused problems! So I soldered a new LED on and applied two layers of conformal coating. That worked great for the duration of one tweet, then red stopped working. The conformal coating that I have is not strong enough to resist the scraping motions of the USB contacts, apparently. But I was left with a very pleasant blue-and-green doodad, which was fine by me. That was a good stopping place and I haven't had the chance to go back to it since then.

    I've since measured the OSH Park PCB to be closer to 0.2 mm (8 mil), thicker than I imagined. This makes it a bit harder to do what I want to do next, which is a """proper""" double-sided port made of two flex PCBs sandwiched around a microcontroller. If the current setup is 0.7mm, putting another 0.2mm board on top will be way too thick. Two possible things to try:

    1. an even shorter microcontroller. Do you know of one? The ATtiny20 in WLCSP-12 is at most 0.53 mm tall, are there any other options out there?
    2. cut a hole in the second flex PCB so the microcontroller can poke through but the other components are shielded. This needs a diagram to illustrate what I mean, I think, but I can't make one at the moment.

View all 2 project logs

Enjoy this project?



Andrew Peters wrote 01/01/2022 at 21:53 point

Do you think this could be used to hide microcontroller malware inside USB connectors? Are devices like these capable of transmitting data to an external IP address?

  Are you sure? yes | no

Sam Ettinger wrote 01/02/2022 at 22:19 point

It could be possible, perhaps, with custom silicon and specialized tooling, but with flex PCBs and off-the-shelf ICs I think it would be extremely conspicuous! Maybe the makers of the o.MG cable would know what to do, but not me.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates