Creating logos in KiCad
Have you ever wonder how to include your own logos, images or other graphical stuff in a PCB made with KiCad? I have so, as many folks in the open source community!
For this example I didn’t create a logo (I’m not that good, I’m just an Electronics engineer), but a graphical artifacts (MENU, BACK and ENTER “buttons”) instead and my signature:
Some sites have guidelines that are at least 5 years old, and they use a buggy online tool that I couldn’t use properly. So what was the solution? Keep reading.
Open source tools
We’ll need three open source tools:
KiCad includes an utility to convert bitmaps images to modules (components) that can be inserted into the PCB: Bitmap to Component Converter.
But we need first to create the logo/image to SVG format. Then convert this SVG image to bitmap, and finally, convert the bitmap to component.
These instructables are for Linux (Mint), but surely you would also get the same results in other operating systems. Ultimatly, the tools I use exist in all major OSs.
1 Create your logo/image/graphical stuff in Inkscape as vectorial drawing
It’s up to you to create a wonderful logo in Inkscape and save it as vectorial drawing (svg). It’s very important that it is in black and white, without the colors mirrored. Also, the design should be as large as possible, perhaps 5 to 10 times the size you expect in the PCB. The larger the design, the best results when it’s converted to bitmap.
For example, my signature in Inkscape looks like this:
You might notice two things in the above image:
- The logo is very simple, yet too large! (slightly less than 820 x 100 mm). As it’s a vectorial image such big size isn’t a problem.
- The document margins are custom size set to 820 mm width and 100 mm height. I mean, the document margins need to be a little larger than the image. And again, only two colors, preferably black and white.
2 Convert the vectorial drawing to bitmap
Open Gimp and load your svg image. A window will pop out asking you for some parameters:
Don’t edit any of them. If you do, you’ll change the size and proportions of your image. Also, if your drawing don’t have paths, then don’t select the Path Import option; otherwise you’ll get an error. Just accept the given options and click Enter. Your design will look like:
To convert the image to bitmap you need to export it. In the main menu go to File->Export (or for short, ctrl+e). Give it a name and location, and choose the new format, BMP of course (open the menu list located in the bottom right):
(In english it might say something like “All exported images” or so.)
From the list look for and choose “Windows bitmap image (*.bmp)” as shown:
Before you click on the “Export” button I think you must change (or add) the extension of the new file to .bmp (perhaps it’s a Gimp bug), or leave it as is to get “myImage.svg.bmp”. Then click on “Export”.
When a window shows up, choose 24 bit color and “Not to write the color space”. If you failed at the bit color depth (for example you choose any of the 32 bit options) the KiCAD’s bitmap converter utility won’t be able to load your bitmap image.
3 Creating the KiCad component
Now it comes the most critical step in this instructable. Open the converter KiCad utility and load the bitmap:
Don’t worry if the image doesn’t show complete:
In order to scale the image to the proper size for your PCB, you need some basic math or do some trial and error.
Above the “Load bitmap” button you can see that the image “Resolution” can be edited: the larger the resolution, the smaller the component’s size in the PCB. Fortunately it’s a linear relationship. I’ll upload the math later (it’s not a rule of three); for now play with the values ‘til you’re happy with the new size.
For example, to get a component of 30 mm width I might choose DPI=2620. In order to preserve the image ratio, you should capture the same number in both boxes:
As we want a component for the top silkscreen, then we choose the “Pcbnew” option. Of course you can follow the same steps for a logo in your schematics. (If you want your design in the bottom layer, keep reading.)
As our bitmap image is almost perfect and pure, a Threshold with value 50 would work; otherwise play with it ‘til you see the image converted when the “Black&White Picture” sub sheet is chosen.
Before you click the “Export” button be sure the “Negative” box is not selected. The results would be far different from your expectations.
Now click on “Export” and save your new component to a folder in which you can retrieve it as part of some of your own components library.
4 Verify it
Open the Pcbnew program, load your library, look for and place the new component in the board. If the result doesn’t feel your expectations, then repeate step 3. In corner cases, you might back to step 2.
5 Use it
Once you’re happy with your design you can use it in your boards. If you need to place your logo in the back layer, repeat step 4, but before place it on the board, press the key F (for flip). Or if the logo is already placed on the board, click right on it and choose Flip.
For example, this image shows my signature in the back layer:
6 Smaller and bigger versions of your design
Repeat step 3 playing with the DPIs to create your design with different sizes . You might append the sufixes: small, normal, big, etc. You soon will realize that you need the same design smaller or bigger than the first you created.
Let me know if this instructable works for you!