4.1. Using Pcbnew
4.1. Using Pcbnew
- From the KiCad project manager, click on the Pcbnew icon . The Pcbnew window will open. If you get an error message saying that a \.kicad_pcb* file does not exist and asks if you want to create it, just click Yes.
- Begin by entering some schematic information. Click on the Page settings icon on the top toolbar. Set paper size as A4 and title as Tutorial1.
It is a good idea to start by setting the clearance and the minimum track width to those required by your PCB manufacturer. In general you can set the clearance to 0.25 and the minimum track width to 0.25. Click on the Design Rules → Design Rules menu. If it does not show already, click on the Net Classes Editor tab. Change the Clearance field at the top of the window to 0.25 and the Track Width field to 0.25 as shown below. Measurements here are in mm.
Click on the Global Design Rules tab and set Min track width to 0.25’. Click the OK button to commit your changes and close the Design Rules Editor window.
- Now we will import the netlist file. Click on the Read Netlist icon on the top toolbar. Click on the Browse Netlist Files button, select tutorial1.net in the File selection dialogue, and click on Read Current Netlist. Then click the Close button.
- All components should now be visible in the top left hand corner just above the page. Scroll up if you cannot see them.
- Select all components with the mouse and move them to the middle of the board. If necessary you can zoom in and out while you move the components.
All components are connected via a thin group of wires called ratsnest. Make sure that the Hide board ratsnest button is pressed. In this way you can see the ratsnest linking all components.
Note
The tool-tip is backwards; pressing this button actually displays the ratsnest.
You can move each component by hovering over it and pressing the g key. Click where you want to place them. Move all components around until you minimise the number of wire crossovers.
Note
If instead of grabbing the components (with the g key ) you move them around using the m key you will later note that you lose the track connection (the same occurs in the schematic editor). Bottom line, always use the g key option.
If the ratsnest disappears or the screen gets messy, right click and click Redraw view. Note how one pin of the 100 ohm resistor is connected to pin 6 of the PIC component. This is the result of the labelling method used to connect pins. Labels are often preferred to actual wires because they make the schematic much less messy.
- Now we will define the edge of the PCB. Select Edge.Cuts from the drop-down menu in the top toolbar. Click on the Add graphic line or polygon icon on the right toolbar. Trace around the edge of the board, clicking at each corner, and remember to leave a small gap between the edge of the green and the edge of the PCB.
- Next, connect up all the wires except GND. In fact, we will connect all GND connections in one go using a ground plane placed on the bottom copper (called B.Cu) of the board.
Now we must choose which copper layer we want to work on. Select F.Cu (PgUp) in the drop-down menu on the top toolbar. This is the front top copper layer.
If you decide, for instance, to do a 4 layer PCB instead, go to Design Rules → Layers Setup and change Copper Layers to 4. In the Layers table you can name layers and decide what they can be used for. Notice that there are very useful presets that can be selected via the Preset Layer Groupings menu.
Click on the Add Tracks and vias icon on the right toolbar. Click on pin 1 of J1 and run a track to pad R2. Double-click to set the point where the track will end. The width of this track will be the default 0.250 mm. You can change the track width from the drop-down menu in the top toolbar. Mind that by default you have only one track width available.
If you would like to add more track widths go to: Design Rules → Design Rules → Global Design Rules tab and at the bottom right of this window add any other width you would like to have available. You can then choose the widths of the track from the drop-down menu while you lay out your board. See the example below (inches).
Alternatively, you can add a Net Class in which you specify a set of options. Go to Design Rules → Design Rules → Net Classes Editor and add a new class called power. Change the track width from 8 mil (indicated as 0.0080) to 24 mil (indicated as 0.0240). Next, add everything but ground to the power class (select default at left and power at right and use the arrows).
- If you want to change the grid size, Right click → Grid Select. Be sure to select the appropriate grid size before or after laying down the components and connecting them together with tracks.
Repeat this process until all wires, except pin 3 of J1, are connected. Your board should look like the example below.
Let’s now run a track on the other copper side of the PCB. Select B.Cu in the drop-down menu on the top toolbar. Click on the Add tracks and vias icon . Draw a track between pin 3 of J1 and pin 8 of U1. This is actually not necessary since we could do this with the ground plane. Notice how the colour of the track has changed.
Go from pin A to pin B by changing layer. It is possible to change the copper plane while you are running a track by placing a via. While you are running a track on the upper copper plane, right click and select Place Via or simply press the v key. This will take you to the bottom layer where you can complete your track.
When you want to inspect a particular connection you can click on the Net highlight icon on the right toolbar. Click on pin 3 of J1. The track itself and all pads connected to it should become highlighted.
- Now we will make a ground plane that will be connected to all GND pins. Click on the Add Zones icon on the right toolbar. We are going to trace a rectangle around the board, so click where you want one of the corners to be. In the dialogue that appears, set Pad in Zone to Thermal relief and Zone edges orient to H,V and click OK.
Trace around the outline of the board by clicking each corner in rotation. Double-click to finish your rectangle. Right click inside the area you have just traced. Click on Fill or Refill All Zones. The board should fill in with green and look something like this:
Run the design rules checker by clicking on the Perform Design Rules Check icon on the top toolbar. Click on Start DRC. There should be no errors. Click on List Unconnected. There should be no unconnected track. Click OK to close the DRC Control dialogue.
Save your file by clicking on File → Save. To admire your board in 3D, click on View → 3D Viewer.
You can drag your mouse around to rotate the PCB.
- Your board is complete. To send it off to a manufacturer you will need to generate all Gerber files.