4.1. Using Pcbnew

4.1. Using Pcbnew

  1. From the KiCad project manager, click on the Pcbnew icon pcbnew_png. 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.
  2. Begin by entering some schematic information. Click on the Page settings icon sheetset_png on the top toolbar. Set paper size as A4 and title as Tutorial1.
  3. 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 RulesDesign 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.

    Design Rules Window

  4. 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.

  5. Now we will import the netlist file. Click on the Read Netlist icon netlist_png 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.
  6. All components should now be visible in the top left hand corner just above the page. Scroll up if you cannot see them.
  7. 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.
  8. All components are connected via a thin group of wires called ratsnest. Make sure that the Hide board ratsnest button general_ratsnest_png 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.

  9. 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.

    gsik_tutorial1_080_png

  10. 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.

  11. 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 add_dashed_line_png 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.
  12. 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.
  13. 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.

    Select the Front top copper layer

  14. If you decide, for instance, to do a 4 layer PCB instead, go to Design RulesLayers 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.

  15. Click on the Add Tracks and vias icon add_tracks_png 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.

    pcbnew_select_track_width_png

  16. If you would like to add more track widths go to: Design RulesDesign RulesGlobal 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).

    custom_tracks_width_png

  17. Alternatively, you can add a Net Class in which you specify a set of options. Go to Design RulesDesign RulesNet 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).

  18. If you want to change the grid size, Right clickGrid Select. Be sure to select the appropriate grid size before or after laying down the components and connecting them together with tracks.
  19. Repeat this process until all wires, except pin 3 of J1, are connected. Your board should look like the example below.

    gsik_tutorial1_090_png

  20. 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 add_tracks_png. 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.

  21. 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.

    place_a_via_png

  22. When you want to inspect a particular connection you can click on the Net highlight icon net_highlight_png on the right toolbar. Click on pin 3 of J1. The track itself and all pads connected to it should become highlighted.

  23. Now we will make a ground plane that will be connected to all GND pins. Click on the Add Zones icon add_zone_png 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.
  24. 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:

    gsik_tutorial1_100_png

  25. Run the design rules checker by clicking on the Perform Design Rules Check icon drc_png 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.

  26. Save your file by clicking on FileSave. To admire your board in 3D, click on View3D Viewer.

    pcbnew_3d_viewer_png

  27. You can drag your mouse around to rotate the PCB.

  28. Your board is complete. To send it off to a manufacturer you will need to generate all Gerber files.