Make Your Own PCBs with a 3D Printer
Conceived on Feb 14, 2020
Series: sideprojects, cad, hardware
Listen, anyone can make a PCB at home, it’s easy. All you need is a laser printer, some glossy magazine pages, print your circuit onto the page, use a clothes iron to transfer the toner onto your copper clad, if that doesn’t work use some water and some lacquer or something, I don’t know, I stopped reading at that point because the last time I saw a laser printer, a magazine and a clothes iron was in the nineties.
Until recently, the only ways I knew to make PCBs was to practice the dark art above, to pay $10 and wait three weeks to get professional-looking PCBs from China, or to pay $60 and wait three days to get professional-looking PCBs from Europe. It was “cheap, fast, actually doable by a human person, choose two”.
That always bugged me, it shouldn’t be like that, I have always been of the opinion that there shouldn’t be things you can’t make when you have a 3D printer, but PCBs have consistently eluded me. I yearned for them, I wanted to be able to make them at home, but it seemed impossible.
One day, everything changed.
That One Day When Everything Changed
One day, I thought it would be fun to mount a pen onto my 3D printer and got it to draw stuff on paper. If you don’t know how a 3D printer works, now would be a good time to skim my 3D printer primer, but in summary a 3D printer cuts an object into 2D slices and prints them on top of each other.
If I could take just one of these slices and tell the printer to print higher, then the nozzle wouldn’t be touching the bed, I could mount the pen lower and put a piece of paper under it, and it would draw on the paper. Getting the printing software (called a slicer) to create a 3-dimensional shape out of a photo was easy, as you can just import a drawing and it will automatically convert it to a solid.
I rubber-banded a Sharpie onto a holder I quickly designed, and, a few lines of code later, my printer produced this gem (excuse quality of potato):
I felt so proud of the completely useless thing I had created, I immediately ran to share it everywhere. A friend saw it on Twitter and replied that this was a good way to make PCBs.
I was immediately intrigued.
Making PCBs with Markers
Apparently, all that black magic about printing and transferring and magazines and lacquer above is just a way to keep the etching acid from dissolving the copper. You see, when you’re etching a PCB, you’re basically getting acid to dissolve the copper on your copper clad (the blank PCB). Except, you’re putting something (toner) over the copper on the parts you want to keep, so the acid can’t get to it, which leaves you with copper traces.
It turns out you don’t really need to do all that stuff with the toner and printer, since you can cover the copper much more easily just by drawing over it with a permanent, waterproof marker (I used an Edding 140 S 0.3mm). I had inadvertently created a plotter, which can be used for painting a circuit onto a PCB.
I rushed to dig out the files for one of my old, small PCBs, which you can see on the right, and ran it through my improved drawing process. I had the printer draw it on paper, just to see what it would end up looking like, and the results were pretty encouraging.
The paper somewhat absorbed the ink, as paper is wont to do, so there was some seepage, but overall the results looked like they should definitely work on copper. This is that first attempt:
This looked very promising.
The Improved Drawing Process
The original process (where I exported stuff to an image and then converted the image to a 3D model with the slicer) worked well enough, but it was meant for working with 3D models, not circuits. As such, it could sometimes lose accuracy, which doesn’t really matter if you’re printing a figurine, but does matter if it means your circuit is no longer working.
Fortunately, there is an excellent open source project called pcb2gcode, which converts Gerber files to Gcode for various CAD tools to execute it. The Gcode that pcb2gcode outputs wasn’t compatible with my Marlin-style printer, so I adapted my script from above to turn the output to something my printer can run.
My script does various things:
- It removes commands that are incompatible with or unsafe to run on my printer (e.g. drilling commands, as it has no drill, temperature and extrusion commands, as I don’t want it to heat up or extrude, etc).
- It rewrites comments so that they are compatible with my printer (pcb2gcode comments use parentheses, my printer uses semicolons).
- It makes sure all movements are within some specified coordinates, so the print head can’t go too low or too high by mistake.
- It allows me to offset all drawing commands by some distance, so I can print exactly where I want to.
Unfortunately, as you can see on the photo of the paper drawing above, pcb2gcode has a bug where traces that are too narrow disappear, but the author is actively working on it and I worked around it in the mean time just by setting a lower marker tip diameter.
Once everything was done on the programming side, and with lots of help from my friend Andrew, it was time to actually try and draw on copper. Here’s a video of the attempt:
[Drawing a PCB on Copper Clad Video Link]
Etching
Surprisingly (and as my friend Josh rubbed in with what I imagine to be considerable glee), the actual etching part wasn’t as easy as I thought. It wasn’t hard, but it also didn’t consist of just throwing the PCB in acid and waiting.
I’m still in a trial-and-error phase, as I’ve only etched two PCBs, but it seems like 100 grams of water with the appropriate amount of sodium persulfate dissolved in it is only good enough to etch a tiny PCB. If that’s true, it will take a lot of acid to etch a larger one, but I’ll have to experiment and see what happens.
UPDATE: Some commenters on HN pointed out that the reason this took so long was that I didn’t have a copper plane. I decided against that