Edit – I decided that it was time to just make a video of this post and put it up onto youtube, which covers much of the same stuff.
I really, really, really, truly, absolutely, can’t stand the holidays.
Every year I throw money at my holiday problem, and hope everything works out. I even suffer emotional trauma when I see people opening the gifts I gave in front of me. Who knew that my mom wouldn’t enjoy a Bob Dylan Christmas album, or that my sister-in-law would hate this Justin Beiber hoodie? This year, however, I’m not going to do that. I’m going to make gifts for people. And they’re going to be thoughtful and meaningful!
There’s only one problem with this plan. I have to answer the question of “what can I make that people will like?” Yeah, such an easy question to answer.
Sure, some people have hobbies that are almost universally appeciated, like making beer, christmas cookies, or delicious smothering sauces. Unfortunately for me, most of my family doesn’t even know what I do. I’m pretty sure they think I “do stuff with computers.”
So that’s what this post is all about. Not breaking the bank, making cool stuff, and giving something to people that they might actually enjoy.
Importing art into KiCAD isn’t anything new. People have been doing it since the invention of fire and use of bone tools. There are even tools out there that automate the process quickly. I only think you’d want to automate something like this if you’re going a bit crazy with the cheese whiz, so for right now I’m going to go over how to do this manually. First, let’s look at what I expect a necklace to look like (according to OSHPark)
Hmmm, looks nice! Surely the doctor that I’m giving this to will think it’s pretty!
Steal Graphics From The Internet
This should go without saying, but the internet is a cornucopia of free stuff. I found black and white SVG files of these two graphics and saved them to a working location. It’s important that you grab SVGs for this process though because you are probably going to have to resize everything to fit whatever you decide to make.
This plague doctor was pretty cool, so I went with that.
Size up your Project
I tried to keep this project as simple as possible in that I wanted a “general shape” more than a precisely measured product. To do this, I just drew out my sketch on a piece of paper, and then used calipers to measure it out.
As you can see, I had the width measured out around 17mm and the height was measured at ~24mm, but since I wanted “the golden ratio” I decided to just multiply 17*1.618 and get roughly 27mm for the height. Not exactly scientific, but hey, I’m just eyballin’ it. It’s jewlery so it just needs to look nice. Eventually, I’d ditch all of these measurements anyway and just go with a rectagle.
Open Up Inkscape
Now that we know our measurements, we can take our SVG and open up Inkscape. What we want to do is go into File->Document Properties…
And change the Page Size to a Custom size. Since we’re working in milimeters, you’ll want to change the Units to mm.
My measurements were:
While the Document Properties window is still open, you need to change the background color to solid white like so:
When you’re done with that screen simply close it out. You may or may not have noticed that the black border around your image has changed. That border is now the size we’re expecting the image to be when we’re done. Simply resize your image to fit within the page now.
It’s not centered yet, and its colors are inverted. Let’s fix the centering first. From the menu, click Object->Align and Distribute… A panel like this should pop up:
For our purposes we want to Align relative to the Page, so make sure that drop down menu says Page. Click the Center on Vertical axis and Center on Horizonal axis buttons. This should center the image to the page:
For my purposes I want the plague doctor to come out as only a silhouette and not have the black border around him, so I’ll just invert him. With your object selected click the menu Extensions->Color->Negative and you should see this:
Alright! We can now export the SVG to a usable file for KiCAD.
Click File->Export PNG Image… This panel should appear:
The next few steps are VERY important. Select Page, as that will export the entire page. Make sure that you set the name of your file. Set your DPI setting to at least 600! If you don’t take these steps your soldermask or silkscreen might come out looking bad, or you might not get your entire image as your didn’t export the full page.
Now click the Export button! You should now have a black and white png ready for import into KiCAD!
Make a KiCAD Part
Open up KiCAD and Click the Import Bitmap tool button. Load your .png image, and it should look something like this:
My OS has a weird theme, but you can see that my resolution is 600dpi. Anyway, if you want to have a solder mask (it will look gold and shiny) part made you should use the configuration you see here. If you want your part to be the silkscreen (it will look like white paint) then you need to select Front Silk Screen.
I’m using the Negative checkbox because black is where I want the solder mask to NOT be.
Export your .kicad_mod file to a folder where you don’t mind putting artsy stuff. We’ll include that directory in the PCB designer next.
Open up the PCB designer for KiCAD. It’ll be the circuit board button in the main KiCAD window.
From the PCB designer menu click Preferences->Manage Footprint Libraries… and then select the Project Specific Libraries Tab
Browse for where you created your KiCAD kicad_mod file and add it to the list of project specific libraries.
Now let’s add our foot print onto the board. Click OK for this window and go back to the PCB Designer. Our library should now be available to us.
Click the Add Footprint button and your cursor should turn into a cross hair which you can click on your design pretty much anywhere:
By default solder mask footprints will look like this color of purple in KiCAD.
Now that we have our footprint, we have can focus on everything else. Since I’m making a necklace, I’m going to put in some edge cuts so cut out the PCB and a through hole that will be big enough to have a ring go through it so that it can attach to a necklace.
Select the edge cuts layer, click the add graphic lines tool, and box in the solder mask image. In my first pass at this, I simply created a rectangle. For the final product I went back and added rounded edges, which I won’t cover, but it’s super simple, you just use the add graphic arc tool. I’m sure you can figure it out.
This is what it should look like:
Now we want to add a through hole that will attach to the necklace. Simply drop in a through hole using the Add Vias button (the round button in the side panel shown above) and then double click on the via when you’ve placed it.
I can’t remember what the exact values were for my via, but there were probably close to this:
With that out of the way, let’s take a look at the thing in 3D to make sure we didn’t miss anything:
Well, it looks pretty dull, and I’m not seeing a copper plane. We’ll need to add a copper plane if we want the solder mask to show metal.
Using the Add Filled Zones button in the side menu, create a rectangle for inside the edgecuts, but covering the soldermasked part. You should have something like this:
You might get a prompt asking you to tie a later to tie a netlist to your copper plane. Just make sure that you’re on the correct layer, F.Cu in my case, and you should be ok.
Now let’s look at it:
That’s much more shiny.
I personally did more tweaks to get my final design with a front and back copper planes, two designs, and rounded corners. To get another design on the back of your PCB you’ll have to repeat all of the steps above for creating a kicad_mod file, and then click on the footprint in the PCB designer, right-click on it and use “flip” to put it on the back plane.
Once you’re happy with your design we’ll get it ready for manufacture!
Send it to Fab
We now have to generate our gerber files that our board manufacturer will use to create a physical product. There is a plot button in the PCB designer. Click it and you should see a popup. Create a directory that you will want to keep your project’s gerber files. Make it look like the following:
Most things are the default value in this screen, but a couple of important things to note are 1. Make sure you output Gerber files and 2. I intentionally am NOT tenting my vias. Basically I want the little gold rings to show up on my PCBs and not be covered with solder mask.
Now click the Generate Drill Files button and make that look like this:
Also makes sure that this file is outputting Gerbers. Click Generate Drill file in this screen, and Click Plot in the other screen.
You should have all of your files ready. Navigate to where you output these files and put them all into a zip file.
I personally use OSH Park for my PCB projects because you can literally click and drag your project to completion at this point.
With OSHPark your solder mask color options are limited, but they are really really easy to work with. At this point you just drag your zip file over onto their webpage and you can review and order your board. The picture I had at the very beginning of this project was actually a picture that OSHPark generates when you upload your project.
Generally, you can expect to wait a couple weeks for OSHPark to create your PCB and ship it to you.
I had to go out and find a necklace that matched the electroless nickel immersion gold color of the PCB, but it wasn’t too difficult. This is what you can expect.