Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

PCB Layout

Importing the Netlist

It’s finally time to get to work on what you’ve likely been looking forward to this entire tutorial: designing the PCB. To get started let’s open the PCB Editor, the next program in the KiCad suite that we will be using to build our board. If you’re still in the Schematic Editor after following the previous section, close out of it and return to the main KiCad window. Open up the PCB Editor by clicking on its button or by hitting Ctrl+P. After a moment, you should be met with an interface that looks similar to the Schematic Editor’s, except with a black background for the drawing area and and a completely different set of toolbars. To get started we will first have to import our schematic data, called a netlist. Click on the (blue star) Update PCB with changes made to schematic button. This will automatically generate the latest netlist from your schematic and bring it into the PCB Editor. When the corresponding window pops up, just click on Update PCB at the bottom-right. All your components will now appear in the drawing area. To finish up, click Close. When you’re back at the main PCB Editor window, you should see that all the component footprints that you loaded are following your cursor. For now, just place the clump down somewhere in the middle of the drawing area.

Layers

Before we move on, we should get familiar with an important PCB Editor feature: layers. A PCB is a three-dimensional object composed of multiple layers of various materials. The PCB Editor represents this “stack” using its layers system. On the right side of the window you should see the Appearance pane open to the Layers tab. Here you will be able to toggle the visibility of the board’s layers and choose which to edit. If you read through the layer names, you will notice that a lot of them are prefixed by either F. or B.. These prefixes indicate whether the layer is on the front or back of the board, respectively. For instance, the layer F.Cu contains the copper pours and traces on the front side of the board while B.Cu contains those on the back. For this board we will be using a 2-layer PCB layout. These two layers are the front and back of the board. In more complicated PCBs it is common to see more layer sandwiched in between the two outside layers, but two layers is usually enough for most of our designs.

Zoom into the parts you placed previously and try toggling a few of the layers using the eye icon beside them to see what changes. Additionally, you can click on a layer to make it the top-most visible layer to get a better view on it. Note that the layers are color-coded for visibility, and you can even customize these colors if you so desire. Below is a table that gives a run-down of what each layer in the Layers Manager does. Whether the layer will physically exist on the finished board or only exists in the PCB Editor to provide information have also been specified. Layers relevant to us are bolded, as not all of them will be used when designing our board.

Layer Name

Physical?

Description

F.Cu

B.Cu

Yes

Defines the copper layers where the PCB traces and copper planes will exist. Note that footprint pads are on this layer.

F.Adhesive

B.Adhesive

Yes

Defines adhesive areas. Only needed in some cases, such as when components are on the bottom side during reflow soldering.

F.Paste

B.Paste

Yes

Defines the areas to be covered with solder paste in reflow soldering. Also referred to as the stencil layer.

F.SilkScreen

B.SilkScreen

Yes

Defines labelling and artwork on the silkscreen layer. This is the (usually) white text and graphics that you see on a PCB.

F.Mask

B.Mask

Yes

Defines the area free of soldermask, the usually green layer of polymer that coats the board.

User.Drawings

User.Comments

No

Layers to be used for user comments and drawings.

User.Eco1

User.Eco2

No

Custom layers with no specific purpose – can be used for whatever you want.

Edge.Cuts

Yes

Defines the edge of the PCB and/or internal cutouts.

Margin

No

Defines a margin relative to the edge cut.

F.Courtyard

B.Courtyard

No

Defines each component’s “courtyard area”, the boundary that no other component should be placed in.

F.Fab

B.Fab

No

Documentation layers, mostly used for labelling important values such as dimensions, component names, and values.

Now that you have some understanding of what each layer does, zoom into the parts you placed previously and toggle a few layers again, taking a look at what the layers correspond to on the footprints. Perhaps take a bit of time to get familiar with all the layer colors too.

Rough Component Layout

Let’s get started on our board by first moving around our clump of footprints into something that we can work with. You’ll notice that there are white lines connecting footprints. This is called the ratsnest and it displays the electrical connections that you will need to make between pads on the board. If you cannot see the ratsnest or want to turn it off at any time, click on the (blue star) Show board ratsnest button on the left toolbar.

The ratsnest is extremely useful when doing the initial layout for your components as it shows what connections you will have to make in the trace routing step. With it enabled, board layout is just a fun game where you untangle the ratsnest and make the lines as short as possible. Let’s get to work on this by moving your footprints around. The hotkeys to move footprints are pretty much the same as those in the schematic editor. For instance, you can hover over a part and press M to move it around or R to rotate it. One major difference is that if you press F on a part, it will flip it onto the other side of the board. We will use this to move our battery holder to the back of the board to keep it out of view and give all the other parts a bit more space.

Additionally, you may notice that there’s a bit of snapping to the positions of footprints when you move them around. The grid that the snapping occurs on can be changed through a dropdown at the top:

Currently, the grid snapping values might be in increments of inches or mils (1/1000 in). To switch to the vastly superior metric system, you can switch the units to mm by clicking on the (blue star) Use millimeters button on the left toolbar. The button to change back to mils is right above. For your information, the reference board was designed in mils. Additionally, you can temporarily disable snapping while placing down a part by holding down the Ctrl key.

There’s one important tool that should be mentioned before you get on your way: the 3D Viewer. This tool allows you to see a 3D preview of what your board looks like. This comes in handy quite a lot as it’s sometimes difficult to figure out what your board design is like with just a 2D view. To open the 3D Viewer, just go to View > 3D Viewer or press Alt-3. If you do this now, you will notice that all the components are laying on a very small square PCB. This is because you have not yet defined the board’s edges, but we’ll get to this later on. Also note that not all of your components have 3D models. Some, such as the PIC microcontroller, the programming header, and battery holder only have the pads visible. This should be fine, as all we need to know during layout is what things look like on the board itself.

Another quick thing to note is that when you move a component to the back layer, it flips the entire footprint. Because of this, it may be tricky to work with such components as everything is backwards. Fortunately, there’s an easy solution to this. You can flip the entire board, essentially viewing its other side, by going to View > Flip Board View.

Lastly, we need one more footprint for the PCB that we will manually add from the PCB Editor, and that is the hole for the keychain. Note that if you don’t want to use your PCB as a keychain then you can skip this part.

This process is very similar to adding a symbol in the Schematic Editor. Click on the (blue star) Add a footprint button on the right toolbar or hit A. Your cursor will then go into footprint placement mode. which you can exit by pressing Esc or clicking on the (blue star) Select item(s) button on the right toolbar. Once you have entered footprint placement mode, the Choose Footprint window will open. Search for the MountingHole_3.2mm_M3_Pad footprint through the filter, select it, and place it on the drawing area.

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: (blue star) Draw a line and (blue star) 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.

Draw a line

This is the simplest of the tools to work with. Simply click on one point to start the line and click somewhere else to finish it. When you’re placing a line and your cursor is near the end of another line segment or the center of a circle/arc, a hollow circle will pop up to indicate the location where the line can be connected to. This can be used when you’re connecting up lines to create a polygon. To terminate a line without connecting it to another, just double-click. You may notice that this process is very similar to laying wires in the Schematic Editor.

Draw an arc

As with any CAD program that allows you to create an arc, KiCad makes this process somewhat annoying. Start off by clicking to pick the center of the arc. Next, click to specify the radius of the arc. Now here’s the important part, move your mouse around to specify how long the arc extends clockwise.

Now that you’ve gotten your KiCad graphic design crash-course, let’s draw the outline of our board. Below is a dimensioned drawing of the outline that we used, but you are free to design it however you like. The only requirement is that the board is large enough to fit all the components and be a reasonable enough size to use as a keychain if you want to use it as such.

Component Layout

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.

  • No labels