Control track widths with nets

In this chapter I will show you how to wire the tracks on both top and bottom layer of the PCB, and have the width of each track set automatically by Kicad. To make this possible, we will define the desired width of Vcc and GND tracks, as well as the default track width (that is, the width for tracks that are neither Vcc or GND). Then, Kicad will set the width for a track based on this information and the name of the net that the track belongs too. If this sounds a bit complicated, rest assured it isn’t; it will all make sense by the end of this chapter.

In the first project we controlled the width of each wire manually. We did this by creating a custom track width and then we used the track width drop-down menu to manually choose the width of a particular track. What I would like to do now is to get Kicad to automatically set the correct track width.

Here is how this can be done:

Start by bringing up the Design Rules editor from the Design Rules menu.


Go to the Design Rules editor.

You have seen the Design Rules editor in the past, when you created several custom track widths in the Global Design Rules Tab.


We will work in the Net Classes Editor tab.

In this chapter, we will work in the Net Classes Editor tab, instead of the Global Design Rules tab.

There’s a few things to notice here. First, at the top of the editor there is the Net Classes matrix. There is a single net class, “Default”, with the various settings for clearance, Track Width etc.

In the middle of the editor are the Memberships. On the left side, you can see that all the nets belong to the Default class. There is no other class to which any of these nets could have belonged to anyway. You can see the same information on the right side. At the top of each list is a drop down menu. This allows you to filter out nets of a particular class, and only display those in the list. With two lists, one next to the other, you can select nets of a desired class in each list, and then use the four buttons between the lists to move nets from one class to another.

A net is a wire, and it gets its name from the names of the pads that it connects.


A net gets its name from the names of the pads it connects

In the example image above, you can see that the wire that connects any “GND” pads is named also “GND”. The wire that connects the two “sg4” pads is also named “sg4”. If you wish to change the name of a net, you must change the names of the pads that it connects.

To create a new Net Class so that tracks that belong to this class have an individual set of values for their various characteristics, start by clicking on the Add button in the Net Class Editor tab.


To add a new net class, click on Add, give the new class a name, and click OK.

Give the new class its name, Power. Then click OK. Now, edit the values for the Power class. I set those values as per the screenshot below:


The values for the new Power net class.

Great, we have a new net class, for Power. We would now like to assign nets to this class, so that the power  class characteristics are inherited by these member nets.


Make the GND net a member of the Power net class.

To do this, first use the drop down filter menu of the right net list to select the Power class. Then, select the GND net from the left list of nets. With the GND net selected, click on the “>>>” button to move the GND to the right side list. That’s it, the GND net is now a member of the Power class.

Repeat the same process for the Vcc net, and what you will end up with is this:


The Vcc net is also a member of the Power net.

At this point, we have the GND and Vcc nets as members of the Power net class. Let’s see the effect that his has on routing tracks.Let’s connect a couple of wires, starting with the GND pads. Because I prefer to place GND tracks in the back copper layer, select the B.Cu layer first.


We will place the GND track in the back copper layer.

Then click on the green wire button to select it, and connect any two GND pads.


Click on the green wire button to go into the wiring mode.


Wire the connector and 595 IC GND pins. Notice the thickness of the track?

I connected the GND pins between the connector and the left 595 IC. Notice that the new track is thicker than the default thickness. This is an indication that Kicad applied the correct track thickness value best on the membership of the GND net.

Let’s do the wiring for a non-power related set of pins. Let’s connect pin 5 of the connector to pin 11 of the 595 IC. Since this is a normal data signal, not GND, we will switch to the front copper layer.


Select the F.Cu layer in order to do wirings in the front copper layer.

Then do the connection between these pads. This is what you should see:


The red track connects two non-power pads with a net that does not belong to the power net class. It is thinner than the green track because Kicad applied the default track setttings to it.

Notice the difference between the thickness of the green and the red tracks. The red track (indicating it is placed on the front of the PCB) is thinner than the green one. This is because the Data net (the net that connects  pin 5 of the connector to pin 11 of the IC) belongs to the default net class. This class has a thinner value set for he thickness. Again, we didn’t have to do anything specific to apply the thickness value. Kicad used the net class settings to workout the correct thickness for each net.

Let’s continue with the rest of the wirings. I prefer to do my wiring from left to right when possible. Spend a bit of time experimenting with the routing, try to figure out the shortest path from one path to another, and try to  make the tracks as neat as possible. Try to lay the tracks in parallel paths, with adequate space between them. Do an Design Rules Check occasionally to make sure the the design is valid at all times. Usually wiring the back copper layer is easier since it involves mostly the GND pads. Then move to the front layer.

In some cases, you may not be able to find a route between two pads because of obstacles, like existing tracks or pads. You can try to re-arange existing tracks by deleting them and re-drawing. You may also be able to create a route by inserting vias. A via is a small hole that implements an electrical connection between layers. This way, a track that starts in the front layer can continue in the back layer, and then come back to the front to finish a connection. To insert a via, just type “V”. This will create a via representation on the canvas that looks like this:


A via is a connection between layers that allows tracks to move from one layer to another. In this example, a via is used to make allow for a front layer track to continue to the back layer.

My track routes eventually look like in the image below. Yours may be different.


A possible wiring. Your actual routes may be different.

The DRC is also clear:


A clear DRC report!

You can also have a look at the 3D render of your board, and admire the tracks you just created. Look at the back layer to notice how the thicker GND net is clearly visible.


The track are clearly visible in the 3D rendering of the board.

Let’s save the project. In the next chapter, we will add copper fills for Vcc and GND.

Back to top
« « Create a 2 layer PCB in Pcbnew | Add GND and Vcc copper fills » »