Devious Fish
Music daemons & more
profile for Perette at Stack Overflow, Q&A for professional and enthusiast programmers

Making Printed Circuit Boards

In 2024, my wife and I rehabbed a dead Iceball game (a Skeeball clone) with a missing control board. We replaced it with a Raspberry Pi. I did the hardware side, designing circuits to interface between OEM game, replacement parts we provided, and the Pi.

Contents

1. Slow and Steady Wins The Race

Like with software, I found that slow-and-steady without rushing works well. I designed circuits, made time to prototype them on breadboards. When I was getting confident, I built a few accessories so I could test the central parts more completely. The main `board design took several days, then I spent a week periodically reviewing my work, looking for mistakes, making minor refinements when I saw the opportunities. When I finally printed, etched, drilled and assembled the board, there was one trace missing (two neighboring pins that should have been connected, but weren’t), but that was easy to work around. A few components were too close and didn’t fit well, but I was able to make it work, and the board worked as expected.

I’d been imagining going through multiple revisions before getting it right; a nightmare of troubleshooting, revising and and rebuilding from scratch for another iteration: like software can be. But taking my time, I managed to avoid that. Had I rushed, not only would I have taken longer, but it would have been far more frustrating.

This tizzy of meeting deadlines that modern capitalism produces in the workplace is wholly counterproductive.

2. Tools: DIY Layout Creator vs KiCad

I looked at two board design tools, the first being DIY Layout Creator, which feels like a drawing program that’s specific to doing board design. It’s vector-based (you draw the components, and can pick them up and move them around; you’re not just drawing pixels on a canvas), and has support for common components. Where it lacked, I was able to improvise from others: positioning relays, for example, using the pin-header component.

Learning DIY was effortless. I drew my schematic using the schematic symbols, then laid out the board using the circuit board components. It’s the same software, the same mode, the same behaviors. It’s very manual—after positioning components, for example, one has to manually add all the solder pads, adjusting sizes and holes.

The other software I tried was KiCad. When I first tried KiCad, I was still designing circuits, and faced a problem: with KiCad, I would face its steep learning curve at the same time I was relearning electronic skills I haven’t used in 35 years, and pushing my limits there too. Recognizing these two challenges concurrently would burn me out, I chose not to use KiCad.

Although prototype production went well, and worked okay, we ran into problems getting more input modules we were using (zero delay joystick encoders that detect connect-to-ground: it seems they’ve evolved to all detect connect-to-+5V now). There were also some additional needs (some buttons for control, and a ball return sensor) that the original design didn’t account for. So eventually, a second revision became necessary.

Now, by this time we realized we could turn this into a rehab kit for Iceball machines. Drilling 400 holes in a prototype is doable, but not exactly fun; doing it for production is another. With the possibility of doing many, we wanted to outsource the board, and I’m happy to spending half a day drilling.

KiCad outputs Gerber files, which are what PCB makers need. But to use it, I can’t just redraw the board—I have to redraw the schematics. KiCad understands that the schematics are an equivalent representation of the board, and works to keep the two synchronized. It also does some clever stuff where you can assemble a portion of the circuit into a subcomponent, draw that once, then use it as a black box wherever you need it. All of this should be nice and helpful.

But when it came time to turn the schematic into a board, KiCad took all the components and dumped them into a drawing, with a mess of lines connecting them. I spent several hours sorting them; it felt like trying to undo a badly knotted bundle of string.

And KiCad complained that it didn’t have “footprints” for several components. So, I took a side-trip to learn to build footprints and how they worked, then associated them with my components so I could put them on my board. Footprints conveniently include their own solder pads, holes and outlines—saving time and trouble, and potentially saving me from overlapping components like in my original board.

But in KiCad, things can’t go on the board without a footprint. I ended up making about a dozen footprints for ones that were missing, or where the ones in KiCad were erroneous. By this time, I’m 3 days in. And I wanted to put in 3 fuses for different sections of the board, which in DIY I can do by just putting in 3 fuses where I want them. But in KiCad, I have to rework the schematic with 4 different power rails—the input one, plus one for each of the fused sections—and connect various bits of circuitry to various ones in the schematic. And finally, I cracked: I don’t want to have to explain to the software what I want to do, I just want to do it. KiCad requires I explain everything to it in fine-grain detail. And I still didn’t know how many more components were going to need footprints, too.

So I gave up on it, and went back to DIY. I recognize that KiCad is incredibly powerful, and that what it’s doing should be helpful. On a large scale, it probably would be. But that power also comes with a penalty: it wants to micromanage. It wants me to express every little detail, in a very precise way that it understands. For me, for this one-time project, it just isn’t worth it.

So I bought a license for ImageToPcb, which can convert the 300DPI pictures that DIY outputs into Gerber files. It’s several manual steps, steps that will need to be repeated each time I want to revise the board. But at least it’s not the herculean, days-long (weeks-long) uphill battle that KiCad requires.

KiCad was quickly burning me out. It’s a powerful tool, but it’s also open-source garbage: stuff that’s undocumented (the N key, which I discovered by accident, is actually useful when you figure out what it does, but until then just breaks things), stuff that’s wrong (TE connectivity AMP pin numbering), stuff that’s missing (lots of footprints). Using KiCad feels like like trying to nail together fine cabinetry in a half-stocked, disorganized woodshop where your only tool is a jackhammer: it’s not long before you want to give up trying to make anything

3. Doing it Manually: Quirks, hints and stuff you need to know

3.1. DIY Layout Creator

DIY is in Java, and at least on Linux it’s got quirks:

  • For whatever reason, it can’t see a lot of directories. I have to keep my files in Documents to be able to edit them, and I have a script that copies them into the project.
  • It can’t print. Instead, I need to export files to PDF or PNG, then print from another App.

3.1.1. DIY Silk Screens

You can improvise a silk screen from DIY. A video walkthrough of the process is cover in the second half of this video.

Make a copy of your file, and do the following to it:

  • Make a copy of your file, so you don’t lose the original if you save.
  • Hide board layer.
  • Using the component list (along right edge), search for TRACE and select all. Edit->Edit Selection, and set trace width to 0.25mm. Set trace color to 000000 (black).
  • Repeat for solder pads (PAD), lines (LN).
  • For pin headers (PH), set alpha to 0%. Border is fixed at 000000 and ignores any alpha.
  • For single-letter components, it helps to set the sort order (below the component list) to “Sort by Type”.
  • For resistors, transistors, and most other components, set lead color to 000000, borders to 000000, and either (1) set alpha to 100%, body to ffffff so that the component covers any traces running beneath; or (2) set alpha to 0% so that the body is transparent, allowing traces running beneath to be seen.
  • For diodes, you must set alpha to 100%, border to 000000, body to ffffff, lead color and marker to 000000. (The polarity marker is not shown if alpha is 0%.)
  • Repeat for other components until you have a good-looking silkscreen.
  • You might want to just remove ground fields (GF).
  • When done, export to PNG and open in GIMP. Using color select, remove pin header location markers (blueish). Select all and use Color->Levels to darken the traces/maximize contrast.
  • Export image.

3.2. Using Press-N-Peel

Press-N-Peel is a film that you laser print on, then iron onto your copper-clad board prior to tech. For the prototypes I was building, it worked well.

  • I use GIMP to print PNG files from DIY. Image->Print Size will set resolution (DIY outputs 300DPI). However, GIMP will silently scale if it can’t fit the image on the page within the margins. So, on the print dialog, use the Image Settings tab to check it’s actually going to print at 300DPI.
  • If not, cropping whitespace off the image edge may help.
  • Do not reverse the image for a bottom-side board. You get one image reversal during the ironing, and a second one because the bottom side of the board is reversed relative to the top side of the board where you’re installing components.
  • Press-N-Peel can be pressed onto the non-copper side of the board too, to improvise a silk-screen. The silk screen will need to be mirrored horizontally in GIMP, which will cancel out the mirroring that occurs during the iron-on transfer. Do this after etching is complete. Either place a sheet below your bottom layer, or iron the silk screen after you remove the bottom layer’s resist: it will try to stick to things.

As for the actual ironing:

  • I set my iron on “cotton”, but reading on the 'net suggests people using various settings. I don’t know if this is variety in irons or people; a lot of people just crank their iron to max and claim it works okay. Using too low a setting definitely doesn’t provide good results though.
  • I do it on cutting board used only for non-food purposes. I position the Press-N-Peel, then tape down a sheet of paper over it so the Press-N-Peel is less likely to move/smudge.
  • When the iron is good and hot, place it straight down on the middle of the Press-N-Peel. Press down. Don’t iron like a shirt—iron outward, but let up when moving the iron, so as to avoid smudging, then reapply pressure. (Like compression massage technique.)

3.3. Using ImageToPCB

ImageToPCB is a utility that takes a common image and converts it to Gerbers and drill files for professional manufacturing. It pairs very well with DIY Layout Creator.

A video walkthrough of the following process is also available.

Here’s the process I’ve worked out:

  • Copy your DIY file, so you don’t accidentally overwrite the original.
  • Delete notes, label, everything else not on the board.
  • Edit->Edit Project Settings and set the size of the drawing to the size of the board.
  • Make sure all layers are visible, select all and drag it into the drawing area. Your board should fit precisely in the white, highlighted project size drawing area.
  • If you’ve used trace colors other than black, change them to black. Using the component list (along right edge), search for TRACE and select all. Edit->Edit Selection, and set color to 000000 (black). Cancel your TRACE search.
  • Select the board and Edit->Edit Selection, set color to 00ff00 (green), border to 00ff00 (green).
  • Turn off layers 1, 4, 5 and 6. What is left is your board to be manufactured: traces are black, holes in white, and non-trace areas in green. Look it over to make sure it looks right.
  • Export this image using File->Export to PNG (don’t use File->Trace Mask->Export to PNG, as this will lose the green of the board).
  • If desired, follow the earier instructions to export a silk screen.

Now open ImageToPCB: java -jar ImageToPCB.jar

  • Open your trace mask PNG image.
  • Click the “Set size from DPI” button, and enter “300” into the dialog. If you’re paranoid, double check the values it calculates.
  • I like to enable the “Keep Aspect Ratio on previews” in the lower left, so things display the way I expect.
  • Set drill color to 255, 255, 255 (white). This picks out the holes in the solder pads.
  • Click “Update Previews”. Gerber 1 preview should look like your trace mask. The drill mask should show your drill pattern.
  • Export Gerber1 to board-B_CU.gbr.
  • Export your drill pattern. ImageToPCB will detect the hole sizes, group them by size, and let you tweak the drill size for each group. In my experience, it’s about 80% spot-on, about 20% need to be tweaked by 0.1mm. Export to board.drl.
  • In the lower right is a button “Export Outline”. Use that to save an outline as board-Edge_Cuts.gbr.
  • Open your GIMPed silk screen.
  • Export Gerber1 to board.topsilk.gbr.

KiCad Gerber Viewer can open your resulting files, layering them so you can make sure all looks good.

My sample of 1 PCB manufacturer likes me to:

zip project.zip *gbr board.drl

I use their website to give the manufacturing specs, and upload project.zip. In a week or so, I get my circuit boards, etched, drilled, silk screened and ready to be populated.

4. Going Forward

I acknowledge that exporting from KiCad is more powerful, but using DIY + ImageToPCB (especially with the improvements in ImageToPCB 1.5, and figuring out better ways to make them work together) has a lot less learning curve.

If I was starting from scratch, now that I’m familiar with KiCad, it might be worth using, especially for larger projects and/or if I was expecting to do manufactured boards. But I recognize it would have broken me to try to learn KiCad at the same time I was designing the board. It’s too much to absorb all at once.

For simple etch-at-home jobs, and even simple 1-layer manufactured boards, KiCad can be overkill. If you’re just making a one- or two-off small board, unless you’re already accustomed to KiCad, save your sanity and use DIY Layout Creator, optionally with ImageToPCB. If you’re in it for the long haul, I’m sure the up-front cost of learning KiCad is worth it. For something small, not so much.

5. Board Images


        
Printed circuit board
Trace side of a PCB laid out with DIY Layout Creator, converted to Gerbers with ImageToPcb, and manufactured by PCBway.



        
Printed circuit board
Silkscreen on a PCB laid out with DIY Layout Creator, converted to Gerbers with ImageToPcb, and manufactured by PCBway.