Tutorial: Introduction to PCB design with KiCad version 5.1 (Getting Started)

Improve the Schematic

We previously made a simple schematic using only symbols and wires. Now it is time to add more powerful features like power symbols and labels to the mix. We will further look at the handling of multi unit symbols.
As a convenience here the project as it would be so far: first_project_pcb_done.zip (223.4 KB)

Multi Unit Symbols

KiCad can split complex symbols into smaller units that can be placed independently. This feature is called a multi unit symbol. I selected the AD8676 dual OPA as a replacement for our LM321. The AD8676 symbol is split into three units. One for the power supply pins and two for the two OPA units.
First delete the LM321 from the schematic to make place for the new symbol. Use the ‘Del’ key while your mouse is above the symbol.
Now open the add symbol dialog with hotkey a. You do not need to click as this hotkey triggers an immediate action. Use AD8676 as the search string and expand the collapsed library and symbol (The library is collapsed because of a bug when finding only a single multi unit symbol)

Place Unit A where the LM321 was. Place unit B somewhere to the side and place unit C above unit A such that its pins reconnect with the original LM321 power connections. KiCad remembers recently added symbols so you do not need to enter the filter string again. Just expand the virtual recently added library in the symbol chooser and select what you need.

In the end the Schematic might look something like this

Connections Without Wires (Power Symbols and Labels)

KiCad has 3 ways to make connections without needing to draw a wire.

  • Global labels: two (or more) labels with the same name are connected no matter on which sheet they are.
  • Power symbols: These are special symbols that work as a global label
  • Local labels: two (or more) local labels are connected if they are on the same sheet.

There is also a fourths type of label, the hierarchical label. This label is special as it is used to define the interface of a hierarchical sheet. See: Hierarchical or flat schematic design, what is best for me? (How to deal with multi page schematics?)

The following picture shows the 3 label types next to their respective buttons that add them. As with a pin or wire the thin square marker shows where you can connect something to the.
Screenshot from 2021-01-13 22-45-31

Our schematic is a single sheet schematic so the label type does not really matter. We will use power symbols and local labels to show how they work.

First notice that our V- connection is a bit messy with that many things connected by a wire. Let’s clean this up a bit by using the power symbol GND. Using a named net has the added benefit that we can use copper zones in our next iteration of the PCB. To do this we first delete all connections of this single net. Then use the add power symbol button button_power (or hotkey p) to get the add power symbol dialog. Select GND (with the help of filtering) from this dialog.

Place it near every pin that needs to be connected with the V- pin of the OPA and connect the symbol to the pins with short wires. The short wires are needed to allow the highlight tool to work as it only highlights wires not symbols or labels.

Now we remove the wire connecting V+ to the connector and replace it with a local label to show how that works. (Normally one would use another power symbol to connect this.) Adding a local label is done by activating the label tool in the right toolbar button_local_label . Click somewhere on the canvas and use V+ as the label name. Place one such label near the connector pin and one near the V+ pin of the OPA.
local_label

Connect the labels with short wires to their respective pins.

You can now use the highlight tool again to check if everything is still connected as you expect.

Cleanup the Schematic

Right now the schematic looks a bit messy. The Reference and value fields of your symbols overlap with wires or other symbols. The fields can be moved separately from their symbols with hotkey m and rotated with hotkey r.
Move the fields around until you are happy that your schematic looks clean.

Sometimes its necessary to move symbols around to get a clean schematic. You might not want to break the connection between the symbol and its wires with such an operation. The grab tool (hotkey g) exists to fulfil this usecase. Grab any of the symbols with g and observe what happens if you move the mouse around. Compare this to using hotkey m. The hotkey g can also be used on wires and junctions. Yet another thing you might want to experiment with.

Electrical Rule Check

KiCad includes an electrical rule checker (ERC). This is a net based system that checks the electrical types of all pins connected to each other. Every type has a set of pin types it can be connected with and others that result in an error or warning. This error matrix can be changed by the user I would however suggest keeping it as is.

We need to first annotate the schematic as ERC only works on fully annotated ones. So run the annotation tool again. To open the ERC dialog click the button button_erc in the top toolbar. In the dialog click run. We will get quite a few reports. Arrows are added to the schematic to point to the places where KiCad found the error. Every report contains a link to the arrow so click on them and observe what happens.

The 3 pins of unit B are easy to explain and easy to fix. We simply never connected something to them so ERC complains. We simply place no connection flags button_nc to make ERC happy and to show that tool for the purpose of this tutorial. (Normally one would not want unconnected input pins.)

The remaining two errors are harder to explain. Especially as we were “lucky” and triggered two different bugs (wrong pin reported, power symbols should have low priority).

The power supply pins of the OPA should be the source of the error in both cases. These pins are defined as power input pins. Every power input pin must be connected to a power output pin for ERC to know that this pin is correctly supplied.

We supply our board via a generic connector symbol. This symbol does not define its pins as power output. There is a special symbol in the power library that takes care of telling ERC that the net is supplied. This symbol is called PWR_FLAG. Place one near both of the pins of J1 and connect them to the pins. More details see: ErrType(3): Pin connected to some others pins but no pin to drive it
pwr_flag

If we now run ERC again it will come out clean.

Save the schematic again we are done with this section of the tutorial.

5 Likes