Introduction: DIY DB9 Male Socket
I needed a DB9 male socket for a project, but (a) I didn't want to spend money and (b) I didn't want to have to wait for it to come. The pin spacing on standard 0.1" header is close enough to the DB9 pin spacing, and so I made a socket basically by 3D printing a shell and gluing in header.
Ingredients and tools:
- 3D printer and filament
- soldering iron
- heat shrink tubing
- non-conductive epoxy (I used JB Weld)
- 0.1" header
Step 1: Print
Print the shell using [my design](https://www.thingiverse.com/thing:4015358). I used ABS, but PLA should work as well. You may need to tweak the tolerance settings so your header is nice and snug in the slots.
Step 2: Solder
Solder wires to the short ends of the header. Be careful as the pins will want to move. Holding them in a vise will help a little. What I found worked best was to put a bit of solder on the header pin and a bit on the wire and then heat them up until they joined. Heat shrink tubing helps make it all stick in place.
Straighten the pins as needed and ensure they stick out an equal amount from the plastic spacers.
Step 3: Glue
Glue the headers in. I used JB Weld. I also put a lot of JB Weld around the heatshrink holding the soldered connections to make the pins stay solidly in place. (Header pins move easily in the plastic spacers.)
After the JB Weld was a little bit set but still not solid (several hours), I used a female socket to ensure straightness. (Of course, you have to make sure the socket doesn't get glued on!)