Create a 2 layer PCB in Pcbnew
In this chapter we will use Pcbnew to work on the layout and wiring of the second project PCB.
Start Pcbnew. Type the project details for the canvas legend by selecting Page Setting in the File menu. Type in your own details. Here’s an example:
Setting up the Pcbnew project information.
The project information appears in the Pcbnew legend.
Next, let’s import the netlist file. Click on the “read netlist” button, navigate to the netlist file you created in Eeschema, and import it by clicking on the Read Current Netlist button.
All the footprints from the netlist appear one on top of the other in Pcbnew.
Pcbnew will read the netlist file, import the footprints for the project, and place them one on top of the other. You could seperate them by moving each one individually, but with so many components bundled together this is boring work. Instead, we will get KiCad to separate the components.
To seperate the footprints, start by going into the automatic footprint mode.
First, enter automatic footprint mode, a mode that fives you access to several useful features in the Pcbnew canvas. Look for the Mode Footprint button in the image above.
Right-click anywhere in the canvas to bring up the contextual menu, and select “Spread out All Footprints” from the “Global Spread and Place” menu.
Once you enter Automatic Footprint mode, right-click anywhere in the canvas and select “Spread out All Footprints” from the “Global Spread and Place “menu. You will receive a warning that any footprint not locked will be moved. This is ok, as none of the footprints we just imported are locked. Locking a component makes it immovable by Kicad. Notice the Lock Footprint menu item in the contextual (right-click) menu.
Kicad has spread out the footprints. We can now start positioning them.
Click OK to dismiss the warning, and Kicad will spread out the footprint so that none are overlaying any others. We can now start positioning them.
We will be building a two-layer PCB. This means that although the actual parts will be mounted on the front side of the board, the traces will be routed on both the front and the back side. As much as possible, we will try to keep all the GND related wirings in the back copper layer. We will also try to keep the Vcc and data traces to the front copper layer.
Let’s start by by separating the components and putting them approximately to the location that that we would like them eventually to be on the board. We will use the M key (for “M”ove) a lot. Consider changing the grid to something bigger in order to make placement on a grid faster. I set my grid to 1.27 millimeters.
At the end of the placement process, my canvas looked like this:
This is, approximately, the final position of the footprints on the PCB. Also notice the grid setting.
With this placement of the footprints, the 3D viewer rendering looks like this:
A 3D rendering of the board with the current placement of the footprints.
You can see that the silkscreen markings for the resistors (“R1”, “R2”, etc), appear to be misaligned. Let’s put a reminder to adjust the markings so that they are correctly inside the rectangle that denotes each resistor. This is a aesthetic adjustment, so I rather work on it towards the end of this chapter.
The next thing we want to do is to add the edge cuts perimeter for the PCB. This will define the limits of the PCB and therefore is useful to do before we start work on the the wiring. Select the edge cuts layer (Edge.Cuts), and then click on the polygon button. I think that the current grid setting (1.27mm) is appropriate for drawing the edge cut.
Ensure you are working in the Edge.Cuts layer. The select the polygon tool.
From the top right corner of the PCB, start drawing the edge cut.
Start drawing the boundary of the PCB front the top right corner…
…And complete drawing where you started.
Because the price of a PCB depends greatly on its size, try to create a boundary that make it as small as possible. The positions of the footprints, of course, influence the way that the boundary wraps around them.
tart drawing the perimeter.
A 3D view rendering of the PCB, after the boundary is defined.
This looks fine so far. Before we continue with the wiring, I would like to correct the positions of the silkscreen labels, “R1”, “R2” etc. Let’s move them to appropriate positions inside the resistor boxes. Let’s also adjust the positions of the rest of the silkscreen labels so that they are better aligned with the footprints they represent.
Use the “M” key to move the labels around. By the end of this process, your PCB should look a bit like this:
The R1..R8, S1, U1 and P1 labels were moved (in blue).
The 3D rendering of the board shows the new label locations.
With the label positions adjusted, we can continue to the next step: the Wiring. In the next chapter I will show you how to do the wiring so that the track width is automatically set to the correct value based on the net name. Remember that in project 1, I showed you how to control the track width manually.Back to top