KiCAD is an open-source software to design printed circuit boards (PCB). The documentation exists but is spread around forum posts and difficult to find. Even official contributors admit that the documentation is in a bad state. In this article I describe how to create a very simple PCB based on a BuildElectronicCircuits video.
Here is what we will create:
The installation process documentation is decent, just follow the instructions for you system on the download page. I'll be using the 5.1.5
stable release.
KiCAD can create schematics and PCB layouts. That means we will be manipulating symbols and footprints. KiCAD generally comes preinstalled with a library of symbols and footprints but there are other libraries around that we can import.
In this section we will import the Digi-Key library in a very straightforward way, if you need to know all the internals read this forum post.
Let's create the directory where our library will be stored.
mkdir -p ~/KiCAD/Lib
We download the Digi-Key library :
cd ~/KiCAD/Lib
git clone https://github.com/Digi-Key/digikey-kicad-library
~/KiCAD/Lib/digikey-kicad-library/digikey-symbols
.CTRL+A
to select every file and click Open
.dk_
have been added to the table. Click OK
to exit.The libraries have been imported.
To verify that the library was properly imported, open KiCAD and select the Symbol Editor
.
In the filter search for dk_
if you see something then everything worked.
~/KiCAD/Lib/digikey-kicad-library/
..pretty
and click OK
.digikey-footprints
has been added. Click OK
to exit.Here is a list of other interesting libraries you might want to add:
The advantage of using Github is that we can update the library with a simple git pull
.
We can do the same with the official libraries but this means removing the preinstalled library and modifying some path variables.
KICAD_SYMBOL_DIR
to ~/KiCAD/Lib/kicad-symbols
or wherever you downloaded this library.KISYS3DMOD
to ~/KiCAD/Lib/kicad-packages3D
.KISYSMOD
to ~/KiCAD/Lib/kicad-footprints
.Let's start by creating a new project with File > New > Project... or with the hotkey CTRL + N
. I named the project simple-led.
KiCAD automatically creates three files:
We edit the schematic by clicking on the KiCAD Schematic Editor Icon:
A new window appears where we can insert our symbols and create the wiring.
To insert new symbols press A
and use the search bar to locate the symbol you are looking for:
If you need to edit a symbol, just right-click on it to display a menu of available actions. Here are some hotkeys that will be very useful when editing a schematic:
M
once and moving it with your mouse.R
.E
.Below I created a schematic with:
I also set some values (respectively 9V, 470, and "RED").
To automatically create some annotations select Tools > Annotate schematic and then click on Annotate.
This will automatically add annotations BT1 for the battery, R1 for the resistor and D1 for the LED.
To wire symbols together place your cursor where the wire should start and press W
.
You can left click on the schematic to create "breaks" and turn. The wire stops when you click on the junction of another symbol.
To add footprints select Tools > Assign footprints.
A new window opens where you can select your footprints. The middle column lists the symbols we have added and the footprint assigned to each symbol. Here nothing is assigned yet so the descriptions are empty.
The column on the left titled Footprint Libraries lists the libraries we have imported. If we select one of the libraries the column on the right contains each footprint contained in this library.
For the battery symbol we will select a header pin.
You can preview the footprints with the View selected footprint button next to the gear icon. This opens a new window. On this new window you have the ability to show a 3D preview of the footprint with the 3D Display button (or by pressing ALT + 3
):
Here are my footprint associations:
Symbol | Footprint |
---|---|
BT1 | Connector_PinHeader_2.54mm:PinHeader_1x01_P2.54mm_Vertical |
D1 | LED_THT:LED_D3.0mm |
R1 | Resistor_THT:R_Axial_DIN0411_L9.9mm_D3.6mm_P12.70mm_Horizontal |
To generate a netlist click on the corresponding button in the toolbar. Then in the Pcbnew tab click on Generate Netlist. We save the file as simple-led.net.
We are done with our schematic, we can now create our PCB. We click on the button Run pcbnew to layout printed circuit board in the toolbar to open the Pcbnew interface.
In the new window we click on the Load netlist button to load our previously saved netlist.
We can then select our netlist file and click Update PCB.
Our components are loaded, we just need to click somewhere to place all of them. The commands are identical to those in the schematic editor, except that you have to click on a component to select it before moving or rotating it.
Move and rotate your components to improve their placement and achieve something like this:
To draw the connections between each component we use the Route tracks tool on the right side toolbar.
Start by selecting the layer F.Cu which is the Front Copper layer. Then click on the Route tracks tool or press the hotkey X
. You can now draw the routes between each components:
You can select B.Cu to draw wires on the back of the board.
To draw the outline of the board select Edge.Cuts instead of F.Cu and click on the Add graphic lines button. You can now draw a rectangle around your components; use double-click
to finish.
The board is finished, you can display a 3D view with View > 3D Viewer or with the hotkey ALT + 3
.
KiCAD is a great open-source and free tool for your electronics projects. I am not an expert in electronics and I am just learning. Seeing that there was no good resource to show how to use KiCAD from start to finish I decided to write this blog article. But this doesn't serve as a documentation. If you want to learn more I highly recommend Digi-Key video tutorials.