Design printed circuit boards with KiCad
Boardwalk
KiCad helps you design printed circuit boards with up to 32 layers, checks for optimal placement, and supplies schematics and assembly diagrams in the popular Gerber format for submission to PCB manufacturers.
KiCad was originally launched as simple schematics software; today, it supplies blueprints for components used at the CERN nuclear research center in Geneva, Switzerland. Accordingly, CERN's scientists are actively involved in the development of KiCad, which is available for Linux, FreeBSD, Mac OS, and Windows [1].
Schematics created with this program are suitable for importing into other programs, depending on the format. KiCad comes with numerous features and, unlike the free versions of commercial counterparts such as Eagle Light Edition or Target 3001!, there are no restrictions on its use and scope. See the "Basics" boxout if you are a newcomer to the field.
Basics
In KiCad, you create the schematic first. After checking it carefully, you then design the printed circuit board (PCB), which brings the components and their "footprints" together – footprints being the connection geometries of the various components. Components can be wired (conventional, through-hole devices) or surface-mount devices (SMDs): Wired components are located on the upper side of the printed circuit board, with the soldered side and the conducting paths mirrored on the underside. SMD components are soldered directly on the PCB surface, revealing the circuit diagram in the printed conductors. Information about components can be found in libraries [2] maintained by volunteers [3].
The program is available for many distributions. You can download the latest version from the project page, where you also will find the source code if you want to compile the software yourself.
Users of Debian-based systems who use an older version of the distribution can access backports (see the "Backport" box). The Unstable and Testing branches already contain the latest version of the software.
Backport
As root, add the package source for KiCad to the /etc/apt/sources.list
file; then, update the package data and install the software and the associated help files:
# echo "deb http://httpredir.debian.org/debian jessie-backports main contrib non-free" >> /etc/apt/sources.list # apt-get update # apt-get -t jessie-backports install kicad
Creating a Project
When you run the program (Figure 1), you are prompted to create a PCB design project. To do this, either click on the spiral notepad icon in the toolbar on the left or take the classic File | New Project route.
For the sake of clarity, create a new folder (in Figure 2, this is first
), assign a name to the project (e.g., first
here), and press Save. The left column of the program window contains a tree view of the project and its components with the first set of files (see Table 1), and the individual components are no longer grayed out.
Table 1
Project Files
Extension | Content |
---|---|
.pro |
Entries for project management |
Shared |
|
.kicad_wks |
Adjustments to the worksheet |
.net |
Netlist |
.cmp |
Component assignments in the footprint schematic (create with the Pcbnew board layout editor; import into Eeschema) |
Eeschema (Schematic Editor) |
|
*_cache.lib |
Copies of the parts used in the schematic |
.dcm |
Documentation of the component library (information about components) |
.lib |
Component library with information on design and connections |
.sch |
Schematic file without components |
Pcbnew (Printed Circuit Board Editor) |
|
fp-lib-table |
List of footprint libraries |
.kicad_mod |
Footprint file with description |
.kicad_pcb |
Printed circuit board with board layout |
.pretty |
Directory of the footprint library folder |
Output Files for Printed Circuit Board Production |
|
.drl |
Drilling data in Excellon format |
.gbr |
Gerber file for producing the printed circuit board |
.pos |
Positioning instructions for insertion machines |
Output Files for Documentation |
|
.dxf |
Plot in DXF format |
|
Plot in PDF format |
.plt |
Plot in HPGL format |
.ps |
Plot in PostScript format |
.rpt |
Report file (text) |
.svg |
Plot in SVG format |
In the File menu, you can open existing projects or create new ones. You can also create or read archives. Under Browse, you have the option of editing files with a text editor of your choice, which is determined under Preferences, where you can also configure the language for the user interface and the PDF viewer. Additionally, you can define paths and set up keyboard shortcuts (called hotkeys). Table 2 shows the shortcuts for the main window. Each tool also has its set of hotkeys.
Table 2
Hotkeys
Shortcut | Function |
---|---|
Ctrl+O |
Load project |
Ctrl+S |
Save project |
Ctrl+N |
New project |
Ctrl+T |
New project from a template |
Ctrl+E |
Eeschema – schematic editor |
Ctrl+L |
Schematic library editor |
Ctrl+P |
Pcbnew – printed circuit board editor |
Ctrl+F |
PCB footprint editor |
Ctrl+G |
GerbView utility |
Ctrl+B |
Bitmap2Component utility |
Ctrl+C |
PCB calculator |
Ctrl+Y |
Pl editor |
KiCad manages projects and calls up a number of tools, which you can access either from the Tools menu or directly in the toolbar (Table 3). The Help menu offers a manual and a tutorial for beginners.
Table 3
Components
Symbol | Task |
---|---|
Eeschema schematic editor |
|
Schematic library editor |
|
Pcbnew printed circuit board editor |
|
PCB footprint editor |
|
GerbView |
|
Bitmap2Component utility |
|
PCB calculator |
|
Pl editor |
Small Circuit
A design for a small 5V power supply is a good example of how to trace all the important work steps. Click on the new project you just created and start Eeschema. If you see any error messages, they only appear on the first call, so you can simply ignore them.
Click on the first icon, Page settings, and set up your project (Figure 3). To fill the desktop with components, you can either click Place | Component or choose the third symbol from the top in the right vertical toolbar.
Click in the schematic sheet to position the component. You will now see the Choose Component selection dialog (Figure 4). Click OK to position the component. Each component used appears in the History of the Choose Component window, making it easy to reuse components. To find a component, enter a search term in the Filter field.
As long as you hold the component with the mouse cursor while placing, you can rotate it through 90 degrees by pressing R. If you insert an incorrect component, you can remove it by pressing Ctrl+Z or right-click and choose Delete Component.
You can edit components you have already positioned by selecting the element with the left mouse button and then right-clicking to open a context menu (Figure 5). A prompt often appears (Clarify Selection) asking what exactly you want to edit. In this dialog, select the component.
Adding the required data for the components you place uses the context menu, as well. Select Edit Component, and enter the reference and the value (Figure 6). For example, for a resistor, you might choose Resistor: R1, 100 Ohm. These entries appear later in various lists and in the layout for assembly.
Once all the components are on the desktop, connect them either by selecting Place | Wire or by clicking the fifth icon from the top in the right-hand toolbar. KiCad shows some weaknesses here: You always need to drag from an unconnected pin on one component to an already otherwise connected component.
Where three lines meet, the program creates a node. If two connections cross and you want to connect them, you click Place | Junction. If the component labeling is not to your liking, you can right-click, select Move Value, and place the text in a better place.
Make sure all components in the schematic are completely referenced and provided with values before using Tools | Annotate Schematic and Tools | Generate Netlist File to generate the result. If necessary, print or plot the schematic from the File menu.
In the next step, use Tools | Assign Component Footprint to merge the components with their footprints. These geometric properties include the assignment of the connections and housing dimensions. The program returns error messages the first time it is called, but you can continue working after restarting this step.
On the left-hand side of the window are the component classes and in the middle are the components from the schematic; on the right-hand side you can select the matching footprint element (Figure 7). If you want to view the dimensions and contacts of a component when selected, click on the third symbol from the left side of the window (View selected footprint). Figure 8 shows a diode used in the example.
Make sure you process all components before saving your work and closing the assignment window. To be on the safe side, click on Tools | Generate Netlist File again and then click on Tools | Layout Printed Circuit Board.
Now set the grid, the units of measurement, and the grid width. To do this, use the Show grid/Hide grid icon (second down on the left) and the Units in millimeters icon for metric dimensioning (fifth from the top). The grid width can be changed under Dimensions | Grid or with the Grid drop-down along the top of the schematic window.
The next step is to determine the size of the board. To do this, start the layer manager (left toolbar, second icon from bottom). Set Edge.Cuts as the current layer by positioning the arrow to the left of the entry; the corresponding checkbox must be filled (Figure 9).
Now draw the outline of the board. You can find this function under Place | Line or Polygon or by clicking on the eighth symbol from the top right of the layer manager.
To read the schematics data, use the Tools | Netlist | Read Current Netlist or the Net symbol at top. The components can be found as a bundle on the desktop. Now switch to Footprint mode (top toolbar, fourth button from the right).
Right-click in the free workspace to open the context menu and select Global Spread and Place | Automatically Place All Footprints. The program now arranges the components more or less sensibly within the frame. To make your corrections, you might need space for heat sinks or wires.
To move a component, again choose Footprint mode (Figure 10) and right-click the component in question. A menu opens in which the top entry always starts with Footprint. Expand this menu item to move the component or drag, rotate, flip, and so on.
Always be sure to use the correct layer when using wired devices – use the bottom layer (B.Cu) when dragging the conducting paths. You can change the thickness of the conducting paths or insert ground areas later (Figure 11).
Results
To print or plot the results, use the File menu. With the GerbView tool, you can create a true-to-scale proof (Figure 12). Place the components on top of it and check that they match the conducting paths, drill marks, and other elements. After this quality control, send the Gerber files to a PCB service provider. To check the correct position of critical parts in advance, create a Gerber plot (File | Plot) in Pcbnew.
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
Latest Cinnamon Desktop Releases with a Bold New Look
Just in time for the holidays, the developer of the Cinnamon desktop has shipped a new release to help spice up your eggnog with new features and a new look.
-
Armbian 24.11 Released with Expanded Hardware Support
If you've been waiting for Armbian to support OrangePi 5 Max and Radxa ROCK 5B+, the wait is over.
-
SUSE Renames Several Products for Better Name Recognition
SUSE has been a very powerful player in the European market, but it knows it must branch out to gain serious traction. Will a name change do the trick?
-
ESET Discovers New Linux Malware
WolfsBane is an all-in-one malware that has hit the Linux operating system and includes a dropper, a launcher, and a backdoor.
-
New Linux Kernel Patch Allows Forcing a CPU Mitigation
Even when CPU mitigations can consume precious CPU cycles, it might not be a bad idea to allow users to enable them, even if your machine isn't vulnerable.
-
Red Hat Enterprise Linux 9.5 Released
Notify your friends, loved ones, and colleagues that the latest version of RHEL is available with plenty of enhancements.
-
Linux Sees Massive Performance Increase from a Single Line of Code
With one line of code, Intel was able to increase the performance of the Linux kernel by 4,000 percent.
-
Fedora KDE Approved as an Official Spin
If you prefer the Plasma desktop environment and the Fedora distribution, you're in luck because there's now an official spin that is listed on the same level as the Fedora Workstation edition.
-
New Steam Client Ups the Ante for Linux
The latest release from Steam has some pretty cool tricks up its sleeve.
-
Gnome OS Transitioning Toward a General-Purpose Distro
If you're looking for the perfectly vanilla take on the Gnome desktop, Gnome OS might be for you.