The situation
The cable of my Logitech webcam is about 1 m too short to use it comfortably with my desktop computer.
Common "USB extension cables" are too flimsy, i.e. the voltage drop over these wires is too high when the camera is in use.
The idea
I have several cables with USB Type-B connectors around - this is the type of cable that is used to connect devices such as desktop printers and scanners. These cables are much beefier than standard USB cables since they often supply power to the connected device.
My idea was to use such an unused USB Type-B “power” cable and add the standard USB Type-A port. This cable would be “fat" enough to supply the webcam with power.
A little trick is that this case is a single part, and the adapter is embedded during the print 😎


The electrical part
I had several USB plugs for PCB mounting of Type-A and Type-B around, so the obvious solution was to use a Type-B plug and connect it back-to-back to a Type-A plug. The most difficult part was to figure out the pinouts ;-)
The plugs are mounted on a short strip of perfboard, according to these photos:


Test this rig before embedding it into the 3D printed case:
- When you plug in a USB device (e.g. your webcam), you should get messages with detailed information about the device in /var/log/messages
- If you see a message like "low speed USB device", this means that you need to cross the white and green wires.
Printing
The part is oriented so that the perfboard can be inserted during the print:
- In PrusaSlicer, introduce a colorchange just before the last layers (at 14.5 mm, see screenshot below).
- Start printing.
- At the colorchange prompt, insert the PCB.
- Continue printing.
The exact height of the color change is crucial: even if you are just one layer too low, parts of the plug assembly will “stand out”, the printer nozzle will run into it and the print will crash.
Note: you could also “pause print” by inserting a M601 command into the file. However, I went with the colorchange because it was the fastest option at the time.

I printed this on my Prusa MK3S+ in black PLA, 15% infill, 0.2 mm layer height, “Quality” setting in PrusaSlicer. No supports needed.
The whole print takes barely 40 min.
Tags
Modellquelle
