Let’s Play KiCad 7: Basic Operations (Part 4)

Have you ever noticed that KiCad’s box selection behaves differently if you go left to right versus right to left?  Today’s exercise will cover this and more basic operations for creating your first schematic.  By the end, you will know how to add any default symbols, position them exactly as you see fit, and then wire them together.

Notice of Non-Affiliation and Disclaimer: As of the publication date, we are not affiliated with, associated with, authorized by, endorsed by, compensated by, or in any way officially connected with the KiCad project, or its owners, subsidiaries or affiliates.  The name KiCad, as well as related names, marks, emblems, and images are trademarks of their respective owners.

External Links: Links to external web pages have been provided as a convenience and for informational purposes only. Unboxing Tomorrow and Voxidyne Media bear no responsibility for the accuracy, legality or content of the external site or for that of subsequent links. Contact the external site for answers to questions regarding its content.

Prerequisites                                   

Previously in part 2, we learned how to adjust the canvas view.  In part 3, we customized Kicad with keyboard and mouse preferences.  You will know you’re ready for this exercise if you can navigate around the canvas just like in part 2.

Create a New Project

Open the Kicad application.  Then create a new project by navigating to: File -> New Project.

Give your new project a memorable name and location (for example: “Wilson-current-mirror”).  Then open the schematic editor by double-clicking the file ending in .kicad_sch.                                              

Recall from part 2, that the 50-mil grid is the grid most compatible with KiCad’s default symbol libraries.  You can configure the schematic to use the mil unit of measurement by clicking the “mil” icon on the left-hand toolbar.  Then, prepare to press the “N” key until the status bar at the bottom reads: “grid 50 mils.”

Operations Overview

On the right-hand side, you’ll see a vertical list of operational icons.  They are (from top to bottom):

  • Select
  • Net highlight
  • Add symbol
  • Power Port
  • Wire

These 5 tools are the bare minimum required to build almost any schematic.

Select Tool

The select tool is the only tool able to move symbols and wires around the canvas.  This makes it the most important tool on the right-sided toolbar by far.  Clicking the select tool directly will activate it, however the escape (ESC) key is generally the fastest method.

Net Highlight Tool

Net highlight causes any net you click on to glow magenta for easy identification.

Add Tool                                            

The add tool (when activated) will invoke a large dialog box consisting of all symbols in KiCad’s global library.  To view this dialog: click the “add symbol” icon, or press “A” as in “Add symbol.”

In KiCad, every symbol is part of a larger library.  The add symbol dialog features a search bar at the very top that accepts Regular Expressions (RegEx).  Consider the popular through-hole 2N3904 transistor, which has a surface-mounted counterpart called MMBT3904.  Per RegEx syntax: you can search for both at the same time by entering 2N3904|MMBT3904 or even by entering (2N|MMBT)3904.

Even if you’re not familiar with RegEx syntax, entering a single partial part number will often suffice. Provided it exists within KiCad’s default table of libraries, that is.

Regular Expressions for Searches

For now, it’s time to select a generic transistor that has no pre-assigned pin numbers or footprint.  Clear any search criteria from the add symbol search bar.  This will once again show every possible library.              

Click once anywhere in the resulting list, then press the up or down key until you locate a library called “Device.”

Expand the Device library view by clicking the arrow next to the name “Device,” or by pressing the right arrow key on your keyboard.

The part we want today is a generic transistor symbol named Q_NPN_BEC.  KiCad’s syntax for generic transistors of this type is as follows…

  • Q indicates it’s a transistor
  • NPN is the transistor type

…BEC means base-emitter-collector.  In other words, pin 1 is the base, pin 2 is the emitter, and pin 3 is the collector.  Other combinations such as BCE, CBE, and CEB also exist; and this naming convention may also apply to the other transistors and transistor-like devices the Device library has to offer.

To accept Q_NPN_BEC, you can either double-click its name or click the “OK” button at the bottom of the dialog window.  Either way, doing so should return you to the schematic and the canvas.

Placing a Symbol

By now the transistor should follow your cursor around the canvas.  Click the center of the canvas to place the transistor down.

By default, KiCad 7 will automatically assign the REFERENCE “Q1” to the part.  Unlike KiCad’s previous releases, KiCad 7 performs sequential numbering automatically.  But you can optionally use the left-sided toolbar to disable this feature and have KiCad 7 behave like its predecessors.

How to Change Reference Designators

Note that the reference “Q1” is sometimes called a “reference designator” by other programs.  Other names it may go by include “RefDes,” “Customer reference,” or (rarely) “instance name.”  Regardless, every symbol in your project must have a unique reference field so they can be uniquely identified.

To change a reference manually, click the body of the symbol to highlight it.  Then press the U key on your keyboard.  KiCad 7 includes a built-in tool for automatically generating references based on the symbol’s location on the schematic or the circuit board, so there is rarely a need to alter a reference field manually.

How to Change Value Fields

KiCad components also include a second text field called a VALUE field.

Normally the value field will be the symbol’s part number, or a measurement (such as resistance or capacitance).  To change the value field, first highlight the symbol.  Then press the V key on your keyboard.

Adding a Resistor

Click the add symbol button or press “A”.  Clear away any previous search criteria from the search bar if any appear.

In the search bar, type in “r_small”. 

Locate the exact match, then double-click it to select or click OK.

How to Copy and Paste

To copy any symbol on the canvas, first enter select mode by pressing the ESC on your keyboard, then click the body of the symbol so that it glows blue.

  • Press CTRL + C to move it to the clipboard.                                   
  • Press CTRL + V to paste.  This will attach the duplicate to your crosshair cursor.
  • Click to place it down.

Optionally, to repeat: press CTRL + V again.

As a side note, when you paste a symbol into a text editor, you will paste KiCad’s human-readable S-expression code.  This makes it easier to copy symbols from project to project or do a deep inspection of any given symbol.

How to Select and Deselect Symbols

To select and deselect symbols, first enter select mode once again.

Perform a box selection by moving your mouse near the area of interest.  Then click and drag the left mouse button to sweep the selector box over the item.

The left/right direction of your box selections will alter the selection behavior…

  • Move in a left-to-right motion to highlight anything that is completely inside the box.
  • Move in a right-to-left motion to highlight anything that touches the box, even slightly.

To de-select a selected symbol, first hold the CTRL key on your keyboard (or the Cmd key for Apple devices).  Then click the symbol you want to de-select. 

How to Delete a Symbol                                   

To delete a symbol, first enter select mode by pressing the ESC key on your keyboard.  Then highlight the symbol(s) you wish to delete.  Press the delete (Del) key on your keyboard, and the symbol will be removed.

How to Rotate a Symbol                                  

To rotate a symbol, first enter select mode by pressing the ESC key on your keyboard.  Then highlight the symbol you wish to rotate.

Press the R key on your keyboard to rotate the symbol in 90-degree steps.

How to Mirror (Flip) a Symbol                                   

Many component symbols have “chirality” or “handedness,” so no amount of rotating can flip it properly.

To mirror a symbol, first enter select mode by pressing the ESC key on your keyboard.  Then highlight the symbol you wish to mirror.

  • Press X to mirror the left and right
  • Press Y to mirror the top and bottom

Power Port Tool

Now it’s time to add a ground symbol.

On the right-sided toolbar, click the power port button or press “P” as in “Power.”                                            

This works much like the “Add symbol” dialog, but the results will be pre-filtered to only include symbols that possess the “power symbol” attribute.

Search for a ground symbol by typing “GND” into the search bar.

Double-click a suitable result to accept.  Click the canvas to place it down.

Power Ports vs. Ordinary Symbols

In Kicad, the power ports differ from ordinary symbols in several ways…                                

  • Power ports can only have 1 pin.
  • Power port VALUE fields are read-only.
  • Power ports do not appear on the bill of materials (BOM).
  • If you connect a wire to a power port, the wire will inherit the power port’s pin name.

Finally, power ports cannot have footprints.  If you wish to associate a footprint with a power port, your best option is to place down a symbol called a test point.  Wire the test point to the power net of interest, and then you can assign a footprint to the test point instead.

Wire Tool                              

There are several ways to draw a wire in KiCad 7…

  • Click the “wire” icon on the right-sided toolbar;
  • or press “W” while already in wire mode;
  • or click the very tip of any unwired pin.                         

To stop wiring, you likewise have several options…

  • Double-click anywhere;
  • or click on another wire;                      
  • or click on a device pin.

Symbol Variations in KiCad

Today, we have added KiCad’s default r_small symbol.  But there are other variations of this symbol in the Device library…                               

  • The regular R symbol is 300 mils long…
  • …whereas r_small is 200 mils

The resistor shape is based on Europe’s industry standard: IEC 60617-12.  This standard has been integrated into other standards: EN 60617-12:1999 the in European Union, BS EN 60617-12:1999 in the UK, and DIN EN 60617-12:1998 in Germany.

Because I am based in North America, I usually use an alternate resistor shape called r_small_us.  This version is based on North America’s ANSI Y32.2 symbol standard.  Another standard relevant to North America is ANSI/IEEE Std 91-1984 and its supplement: ANSI/IEEE Std. 91a-1991.

For capacitors…                                               

  • C_Polarized follows the IEC convention.
  • C_Polarized_US follows the ANSI convention.

Diodes (including light-emitting diodes) can have their triangles either filled or unfilled.

Move vs. Drag in KiCad

Let’s look at how KiCad distinguishes moving from dragging.  Press the ESC key to activate select mode.  Then select a wired symbol anywhere on the canvas.

  • To reposition the symbol such that the wires stay connected, press the G (draG) key on your keyboard.
  • To reposition the symbol such that the wires get left behind, press the M (Move) key on your keyboard.

Operations on Groups

Finally, many of the basic operations such as move, rotate, and mirror also work if multiple symbols and wires are selected.  Simply highlight all components of interest.  Then press…

  • R to rotate
  • X or Y to mirror
  • M or G to reposition
  • Del to delete

Notice that REFERENCE edit (U key) and VALUE edit (V key) do not work on entire groups.  To edit large numbers of symbols at a time, consider KiCad’s “Bulk Edit” feature. 

Upcoming Work

I highly recommend exploring KiCad’s Device library, because it is well-designed.  In part 5, we will explore KiCad’s wires and nets in greater detail.  In part 6, we will cover intermediate operations using net labels and a new KiCad feature called net class directive.                                             

Important Notice: This article and its contents (the “Information”) belong to Unboxing-tomorrow.com and Voxidyne Media LLC. No license is granted for the use of it other than for information purposes. No license of any intellectual property rights is granted.  The Information is subject to change without notice. The Information supplied is believed to be accurate, but Voxidyne Media LLC assumes no responsibility for its accuracy or completeness, any error in or omission from it or for any use made of it.  Liability for loss or damage resulting from any reliance on the Information or use of it (including liability resulting from negligence or where Voxidyne Media LLC was aware of the possibility of such loss or damage arising) is excluded.