...
Now go ahead and get untangling! For now, you don’t need to worry about exact positions so just place them in an area such that it untangles the ratsnest as best as possible. On the next page is a view of the finished board with only the components visible. Note that I have made some layers hidden to make the footprints easier to see. You can identify the components by taking a look at its corresponding refdes on the silkscreen layer. Use this to get a bit of an idea of where you should be putting things. You don’t have to copy this board exactly though, try taking some creative liberties and perhaps learning a thing or two in the process.
...
Creating Board Edge Cuts
Now that we have a rough idea of where our components are going to be and how much space it’s going to take up, let’s define our board’s shape. This can be done by drawing polygons on the Edge.Cuts
layer. To enable drawing on a layer, click on it on the Layers panel. You should then see a small blue arrow that indicates that you are currently working on that layer. The tools you will be using to draw your board edges will be on the right toolbar: Draw a line and Draw an arc. If you’re well-versed in CAD then you should feel right at home with these tools. Let’s quickly go through how each one works.
...
Now that we’ve gotten the board shape specified, start laying out your components within its confines. Shown below are two views of the finished board with the components visible along with the board’s edge. Use this as a guideline to do your own layout or go wild and design it how you like. Just remember to keep the ratsnest untangled and components rotated to how they should be. It always helps to use the 3D Viewer occasionally to see how things look.
...
...
Pouring Planes
Now that we’ve finalized the layout of our components, it’s now time to electrically connect them up. On top of using the standard electrical traces to hook up our pads, we will also be using two copper pours, one on each side of the board, to make our power connections. While electrical traces are very specific in what they connect, usually being a connection between a few pads, a copper pour is more of a “to whom it may concern”. Creating a pour fills up the areas on of the PCB that don’t have any traces with a massive plane of copper. These copper planes can be used to conduct electricity and connect a large number of component pads. Pours are most commonly used to easily connect power and ground to components on the board, as almost all components require these connections. We will be using our two copper pours to connect up our ground and 3.3V source.
Creating a copper pour is fairly simple. Just click on the Add a filled zone button on the right toolbar and click on a point that you want to use as one of the corners of the fill area. Anywhere outside the board edge should be fine. The Copper Zone Properties window will open. The first copper pour we want is for the 3.3V net on the top layer of the board. Select F.Cu
in the Layer panel, +3.3V
in the Net panel, and then click OK. The first vertex for your copper pour will be selected, just select the other three vertices to create a polygon that covers the entirety of the board. On the selection of the last point, double-click to complete the shape. Let’s repeat this process of for the other copper pour that we want: a ground plane on the bottom layer of the board. When creating this filled zone, select B.Cu
in the Layer panel and GND
in the Net panel. This zone should also cover the entire board. Depending on which view mode is toggled, you should now either have no indication that a filled zone has been created except for the polygon surrounding the board, or your entire board should be filled by the copper layer. If the former is the case, you can take a look at the pours that you have created by clicking the Show filled areas of zones button on the left toolbar. Click between the F.Cu
and B.Cu
layers on the Layers Manager to see both the planes and make sure that everything looks okay. Note that the filled zones have automatically connected to any relevant component pads, so you don’t need to worry about that. Usually you don’t want to see the filled areas when you’re doing your trace routing so just turn it off for now by clicking on the Show only zone boundaries button.
Before we move on, there’s a very important note that you should keep in mind while you’re routing your traces. Whenever you route traces on top of a pour you need to refill the zones afterwards to update them so they give clearance to the traces. Otherwise, your traces will be merged with the copper pours and that’s likely a bad thing. To refill all the copper pours on the board, go to Edit > Fill All Zones or simply hit B. You should do this every time you place some new traces. Hit the button as frequently as (I hope) you hit the save button, which should be quite frequently.
Routing Best Practices
As an aside, the electrical team has compiled a PCB design best practices document, found here. This document not only goes through the dos and don’ts of PCB layouts, but also all other aspects of electrical design that the team does work in. Since that document is several pages on its own, I’ll tell you all you need to know to finish your board in the next few sections. Do take a look at that document along with the rest of the Electrical Standard sometime down the road though, as it contains a plethora of helpful information, reference material, and learning resources.
Trace, Via, and Constraints Setup
Have you played any of those games where you have to connect multiple pairs of nodes with “wires” without having any of the wires overlap? Well, routing traces is pretty much just that. As you may know already, traces are just lines of copper on the PCB that conduct electricity between pads. You will use these to connect everything that you haven’t already connected using your power and ground planes.
Before we start, we’re going to want to change up a few settings so that the board is optimized for our manufacturing constraints. Since the KiCad defaults for trace width and via size are quite generous, we can definitely decrease these a bit to make our routing more compact. Start off by changing the current unit to mils by clicking on the Use mils button on the left toolbar. Next, go to File > Board Setup…. If you’re not already in the section, click on Pre-defined Sizes under Design Rules on the left panel. Three lists of pre-defined tracks, vias, and differential pairs should pop up. Under the Tracks section, click on the Add button close to the bottom. A new entry will be added to the list above. We should be fine to make our track widths 8 mils, so set the new entry to that value. Next, click on the Add button under the Vias section. In the new entry set the Size to 30 mils and the Drill to 15 mils.
Next, go to Constraints under Design Rules on the left panel. Under Copper, set the value for Minimum clearance to 8 mils, the value for Minimum track width to 8 mils, and the value for Minimum via diameter to 15 mils.
And there we go! The values have been entered and all we need to do now is select our pre-defined sizes for use. Click OK to close out of the Board Setup window and set our traces and vias to our new pre-defined values through the first and second drop-downs at the top of the window:
...
Select our 8 mil trace width from the first drop-down and the 30/15 mil via size from the second.
Vias
Before we get to routing, it would be helpful to know what electrical vias are. As you know, our PCB consists of two different layers, one on the front and the other on the back of the board. You can use traces to route between two points on a single layer, but how would you make connections between the two layers? Vias are exactly what you need to do this. A via consists of two pads on different layers of a board that are connected together by an electroplated hole that tunnels through the PCB’s non-conductive middle. All you need to do to make a multi-layer connection is route traces (from the same net, of course) to a via on both sides.
Routing Traces
Now, it’s finally time to get routing! To do so, there’s only two tools that you will need: Route tracks and Add free-standing vias, both on the right toolbar. The hotkey for routing is X, and while you are routing you can press V to easily place a via.
Routing a trace is quite similar to placing a wire in the Schematic Editorx: click on one point to start the trace and then click again to finish that trace segment. If the trace doesn’t terminate at a pad, double-click to end it. One thing to be noted is that which layer you place your traces on, the front or back layer, depends on whether you have B.Cu
or F.Cu
selected in the Layers panel for the back or front of the board respectively. You can quickly switch between these layers by using the Page Up and Page Down keys. Also note that when you’re placing down traces, they angle snap at 45 degrees. In routing it’s usually best practice to have the traces be this way.
All you’ll need to do for your routing is create traces between the pads that need to be connected up, indicated by the white lines in the ratsnest. When you start creating a track from an existing track or a pad, the entire drawing area will darken except for traces and pads that are on the same net as the trace and/or pad that you are working with. These are the only locations that you can connect your current trace to. This is very helpful when you have a spaghetti mess of traces going everywhere and just want to know where you can hook things up. As mentioned before, every time you’re done placing some traces remember to refill your copper pours. Doing so frequently can cause less headaches in the future, as you will immediately be able to know if one of your traces has cut off a copper pour to a pad that requires it, and will be able to fix it right away. Finally, when doing your routing there is one golden rule that you should try to follow: avoid making 90° angles. When connecting traces together or creating bends, avoid right angles and instead opt for 45-degree angles. Below are some alternatives to right-angle traces that you may see yourself needing on your board.
...
Placing a via is as simple as selecting the tool and clicking somewhere on the board. You can either place down a via and route your traces to it or directly click somewhere on a trace, creating a connected via at that location. Remember that vias exist on both layers of the board, so make sure that you’re not accidentally connecting together two different nets together when you place one. Another useful application of vias is to “hop” over traces. If you want to route a trace in a path that intersects with another and this blocked path will makes detours messy, you can simply place vias on both sides of the blocking trace and route your trace to one of the vias, route between the two vias on the other layer, and continue on the original layer.
Shown below is the trace layout of the finished reference board. Don’t forget to use vias, as those are what will be connecting the ground net from the copper pour on the back to components on the front of the board. Also, don’t worry about routing traces over the silkscreen layer as in the manufacturing process the silkscreen will be applied as the top layer of the board anyway. As always, feel free to be a bit creative in the routing process if you so desire. This is definitely the stage at which you can really make things look quite pretty and unique.
...
Design Rules Checker
Well, that’s the PCB routing done. I hope you had a lot of fun doing it as this is my personal favorite part of the PCB design process. Just like we did when we finished up wiring our schematic in the Schematic Editor, we’re going to use an automated rules checker to verify that everything is hooked up properly and that no clearance issues exist. Click on the Show the design rules checker window button on the top toolbar. Click on Run DRC over on the bottom left. If the Violations and Unconnected Items tabs do not display any errors (warnings are fine), then you can close the window and continue on. If a few issues do exist, take a look at what the errors say and fix the offenders. Keep doing so until the DRC stops complaining when you run it.
Silkscreen Labels
To finish off our board and this exceedingly long tutorial, let’s pretty up the board by arranging our silkscreen labels and adding more where they are required. Let’s start off by organizing our refdes labels. If you want to follow the reference board, use the trace layout pictures from the last two pages to get everything where they need to be. If you want to do things yourself, here are a few guidelines to make sure that everything looks as nice as possible:
Make sure that labels are do not overlap each other or any component pads.
Try to avoid overlapping with vias, as soldermask will not be applied on their exposed metal. It’s not that big of as issue though so ignore this rule if you have to.
Make sure that all labels are rotated to face the same way.
Make sure that the refdes labels are close to their footprint and that it’s clear as to which component it corresponds to.
Change up the snapping grid size to make labels line up better. Don’t make the grid too fine though, as silk-screening can only be so accurate.
Once you’re done, let’s add all the silk-screening that we will need to finish up our board. We’re mostly going to be using the Add a text item tool for this, which can be found on the right toolbar. This tool is very similar to the Place text tool in the Schematic Editor, so not much explanation is needed. Let’s start off by adding a label to the first pin of the programming header to indicate that it’s the MLCR (Master Clear External Reset) pin. With the tool enabled, click anywhere on the drawing area to start the label-making process. Before anything else, ensure that we’re going to be creating labels on the front of the board by choosing F.Silkscreen in the Layer drop-down. Don’t worry about label width, height, and thickness values, as we can change these up after we place it down. Specify the text that you’d like to use in the Text text-area, in our case “~MCLR~ 3.3V”. Note the tildes, which you can use to put a bar over “MCLR”. The first pin of the programming header will be indicated by a shaded-in box on its silkscreen. Place a label near it with the text. Just like the Schematic Editor, you can hover over a feature and press R to rotate or E to open its properties and modify its settings to make it look nicer if you’d like. Repeat this process to add the rest of the silkscreen text to the front of the board.
To finish up the front, we can add a Waterloo Rocketry logo silkscreen. The footprint library that we downloaded from GitHub has many silkscreened logos that we can use exactly for this purpose. Click on the Add Footprints button on the right toolbar and click somewhere on the drawing area. Once the Choose Footprint window appears, find the Tutorial_Footprints
library and expand it. You should now see a few logo footprints. You can preview any one of them by clicking on one. Choose a logo to use, making sure that it is a silkscreen logo as opposed to a solder-mask logo, as indicated by the name. Logo_SilkScreen_15mm
was used on the reference board. Place the logo wherever you see fit, making sure to not have it overlap with any footprint pads and preferably any vias.
That’s all for the front silkscreens. Let’s take a look at what they look like on the reference board:
...
The last silkscreen labels that we will be inserting are the ones on the back layer of the board. To make it easier on ourselves, let’s first flip the board – recall that the option to do so is in View > Flip Board View. There’s not much to add except for a Waterloo Rocketry logo and some board information.
Starting with the Waterloo Rocketry logo, we can repeat the steps used previously to insert the Logo_Horizontal_Silkscreen_10mm
footprint. Make sure that you’re creating this label on the B.Silkscreen
layer. Once that's done, All that’s left is to add a label to provide some info about the board, such as board name (both official and nickname), creation date, and designer name. There’s not much to this, just place down a label with the board name, “2022 Electrical Tutorial”; its nickname (we named ours’ “Achievement Get!” but name it whatever you want), The designer name (first and last name, or first initial and last name), and the date of creation in YYYY-MM-DD
format.
Below is what the reference board silkscreens look like on the back layer after following the above instructions:
...
Congra-wait, before that, save the board. Okay now, congratulations on creating your first board in KiCad, entirely from scratch! Take a bit of time to marvel at the masterpiece you have created, whether it be in 2D or through the 3D Viewer. At this point you’re pretty much done with this tutorial. If you’re eager for some extra learning or would like to know how you can turn this design into files that can be used by a manufacturer to actually create the board, the next, completely optional bonus section is just for you!