You will learn how to create the board acourding to the schematics connectivity information by using traces to connect the pads of footprints. We will also look at how visibility options can be used to improve your KiCad expirience.
For convenience here the project at the stage after finishing the schematic.
first_project_schematic_done.zip (221.2 KB)
Starting the editor
Open the layout editor (Pcbnew) from the main window via the third large button.
If you open Pcbnew for the first time then a pop-up will come up asking you if you want to enable hardware accelerated graphics. You can select
Enable Acceleration unless you have reason to think that your computer can not handle accelerated graphics. You can always change your mind later on.
An empty layout will open for you. I have annotated the important parts of Pcbnew in the screenshot such that you know how i refer to the different parts of Pcbnew. In this tutorial we will mostly use tools from the right and top toolbar. All KiCad tools are reachable via hotkeys and of course the menus.
Zooming and Panning
Pcbnew has the same default behaviour as EESchema so this is nothing new to somebody who already followed the schematic tutorial. Still, a reminder: Use the mouse wheel to zoom. The middle mouse button is used to pan. The default zoom behaviour might need a bit getting used to as it centers your view around where the cursor currently is. This is a very powerful feature that allows very efficient navigation of the canvas. If you however find it is too disorientating then you can turn it off in the preferences dialog (Menu bar: preferences -> preferences -> Common -> Center and Warp on zoom)
Getting the Schematic Information into Pcbnew
We need to tell KiCad that we want to get the information contained in our schematic into Pcbnew. For that use the update PCB from schematic button of the top toolbar (alternative: Menu Bar: Tools->Update PCB from Schematic…). The update dialog will pop up. We can use the default settings so press Update PCB and check that there is no error message reported. Assuming there was no error then press close. (If there is ask on the forum for help)
There should not be a number of footprints attached to the cursor. You can move them around and place all of them with left click. The footprints are still selected so click anywhere in empty space or use the ESC key. Notice the colour change. Play around a bit selecting and deselecting footprints. (all done with the left mouse button). Get a feel for where you need to click to select the footprint and where you need to click to select the reference designator.
If you have the schematic editor open then you can see that the corresponding symbol is highlighted similarly to when we worked with the assign footprints tool. This also works the other way round. You can select a symbol in the schematic and the corresponding footprint will be selected in the layout. (Select a symbol by left clicking on it. There is no visual feedback in the schematic but the footprint will be highlighted.)
Handling Layer and Item visibility
The view is a bit cluttered for my taste. For now, we do not need to see the values nor the silk layer. Managing layer visibility is done in the right sidebar. The meaning of layers is described in the FAQ.
Every entry in this sidebar is identified by its name to the right and has a coloured square next to it. This square shows the current colour of that entry and can also be used to change the colour by double clicking. Next to the square is the visibility checkbox. Deselect
F.SilkS and observe what changes. Switch to the items tab and deselect
Values. Be prepared to experiment with layer and item visibilities during your work with KiCad. Everyone has their own preferences, so I really can not give you a rule for when to use which layers.
One layer has a blue triangle next to it. This is the currently active layer. Any tool you choose will start on that layer (if the tool can work on that layer, otherwise it chooses the nearest fitting layer.) The KiCad renderer works like a stack. The active layer is rendered on top, then all other layers of the same side followed by the layers of the opposite side (So if you have any back layer active all back layers are rendered on top of the front layers.). Layers can have transparency but the default KiCad colour scheme does not use that feature. You might therefore want to look into custom colour schemes sometime later on.
The thin white lines that connect different pad centers are called ratsnest lines (sometimes also Airwires). These show which points need to be connected to complete the circuit to the schematic’s specification. Note however that they are always drawn between the nearest points of a net that are not connected. It might not always be the case that one makes the connection following this suggestion.
Organizing the Footprint Placement
Right now the footprints are placed kind of randomly. A big part of good layouts is deciding on where to place which footprint. I find that investing time into good placement is worth it and spend typically 50% of my layout time with this task. This of course varies widely depending on number of footprints and complexity of the connections. Good placement reduces the number of ratsnest crossings and keeps parts close together that need to be close to each other.
To move a footprint select it with left click and then use hotkey
m to move it and
r to rotate it. You can also do this without first selecting the footprint but I find it easier to get the right thing when I first select it. Play around a bit with the location of the parts until you are happy with it. You can of course take inspiration from the screenshot below.
Movement is done with respect to the grid. It might be the case that the selected grid is a bit too coarse. Use the drop down button in the top toolbar to select the grid you want (alternatively also found in the right click context menu.) I typically use 0.5 mm grid for drawing the board outline and copper zones, 0.25 mm grid for arranging footprints and 0.05 mm for laying down traces.
The board outline
The board outline is defined using graphic elements on the edge cuts layer. The edge cut must consist of closed shapes but there can be inner cutouts defined. To get a closed shape every elements endpoint must be within 0.01 mm of the next elements point.
To draw the outline select the graphic line tool from the right toolbar. Click where you want one of your boards corners and then move the mouse to where your second corner should be. Holding the Ctrl key while doing this will enforce orthogonal lines. Click when you are happy with your second corners position and continue on to the third point. Repeat until you are back at the first point and double click to end the tool.
If you want to edit a line then select it and squares should appear at its endpoints. You can drag these endpoints but be aware that the current version of KiCad does not move the next lines endpoints as well. Complex board outlines might therefore be best made in a parametric CAD program and imported into KiCad as step or you could use freecad plus stepup
We can now start to add traces as the footprints are now placed in a well organized manner. Select the route tracks tool from the right toolbar . With that tool active click on
pad 1 of
R2. Notice how all pads hat need to be connected to this pad are now highlighted.
Now move the mouse and you will see you are followed by a trace. KiCad has a powerful semi-automatic routing engine the so-called interactive router or also push and shove router. By default, the router is in walk around mode, so I suggest you move around your mouse to anywhere on the PCB and observe what the router does.
Notice that the trace has a dark grey envelope. This is the required clearance set in the netclass. Similarly, every footprint pad has a thin line around it which also shows the clearance set in either the pad, footprint or netclass. How all of this is setup will be handled in other tutorials for now just be aware what these graphics mean.
Using this router engine will require a bit of practise to get the most out of it so for now just connect the trace that should still start with
pad 1 of
pad 2 of
R1 by left clicking on the latter.
If you ever want to cancel a trace use the ESC key. You can help the interactive router find the route you prefer by fixing some points of a route. A left click will however not fix the current end point but the previous corner. You can also fine-tune existing traces by dragging parts of them using the hotkey
d. If you do not like a trace then delete it with hotkey
Entf. Now lay down the rest of the traces but play around a bit to get a feel of the different features. In the end your board could look something like the screenshot below. I placed everything on the top copper layer. Handling of different copper layers as well as copper zones will be done in the next tutorial (coming soon).
Check the Board
KiCad comes with a so-called design rule check tool. This tool is used to check if the design can be produced as drawn. (assuming the rules are setup correctly.) The DRC is useful even in our case where we did not really setup the rules. At least it can check that the outline is made correctly, there is enough space between components and that we have connected everything. We can even check the clearance against KiCads default settings which are very conservative and should therefore allow any board house to manufacture our board.
To start DRC select click the button in the top toolbar . In the dialog that opens click the list unconnected button to find out if everything is connected. If nothing is reported then you have connected everything as required by the schematic. After that click the run DRC button to see if there is any problem. If nothing is reported then you are done with this tutorial. Otherwise, use the DRC message and the placed marker to find out what to do. You can also ask for help on the forum.
Inspect the Board in 3D
KiCad includes a 3d viewer. Some of the footprints shipped with kicad come with 3d models. In this particular case all used footprints have a 3d model. The 3d viewer is found under them menu bar entry view -> 3d view or hotkey alt+3.
Save the layout, we are done with this section of the tutorial.