Eeschema is KiCad’s schematic capture and annotation tool; this is where you’ll be drawing your schematics by placing components and hooking them up. If you haven’t already, start or open a project to hold the schematic.
Before stepping through this tutorial, download the teensy.lib
symbol library from https://github.com/XenGi/teensy_library.
The keyboard shortcuts you’ll be using most frequently for schematics are:
Let’s begin by creating a schematic. Start the schematic editor Eeschema, . It is the first button from the left.
Click on the ‘Page Settings’ icon on the top toolbar. Set the appropriate paper size (‘A4’, ‘8.5x11’, etc.) and enter the Title as ‘Tutorial’. You will see that more information can be entered here if necessary. Click OK. This information will populate the schematic sheet at the bottom right corner. Use the mouse wheel to zoom in. Save the whole schematic: File Save
We will now place our first component. Click on the ‘Place symbol’ icon in the right toolbar. You may also press the ‘Add Symbol’ hotkey a.
Click on the middle of your schematic sheet. A Choose Symbol window will appear on the screen. Note that several thousand schematic symbols may be loaded, so make frequent use of search.
We’re going to place a resistor. Search / filter on the ‘R’ of Resistor. You may notice the ‘Device’ heading above the Resistor. This ‘Device’ heading is the name of the library where the component is located, which is quite a generic and useful library.
Once you use a symbol, it will be listed at the top with other recently used symbols, making filling in passives easier.
Double click on it. This will close the Choose Symbol window. Place the component in the schematic sheet by clicking where you want it to be.
Try to hover the mouse over the component ‘R’ and press r. The component should rotate. You do not need to actually click on the component to rotate it.
Sometimes, if your mouse is also over something else, a menu will appear. You will see the Clarify Selection menu often in KiCad; it allows working on objects that are on top of each other. In this case, tell KiCad you want to perform the action on the ‘Symbol …R…’ if the menu appears.
Do not change the Reference field (R?), this will be done automatically later on. The value above the resistor should now be ‘1k’.
To place another resistor, simply click where you want the resistor to appear. The symbol selection window will appear again.
The resistor you previously chose is now in your history list, appearing as ‘R’. Click OK and place the component.
In case you make a mistake and want to delete a component, right click on the component and click ‘Delete’. This will remove the component from the schematic. Alternatively, you can hover over the component you want to delete and press Del.
You can also duplicate a component already on your schematic sheet by hovering over it and pressing c. Click where you want to place the new duplicated component.
Right click on the second resistor. Select ‘Drag’. Reposition the component and left click to drop. The same functionality can be achieved by hovering over the component and by pressing g. r will rotate the component while x and y will flip it about its x- or y-axis.
Right-Click Move or m is also a valuable option for moving anything around, but it is better to use this only for component labels and components yet to be connected. This is because Drag keeps wire connections to the component attached while moving, while Move simply moves the components, leaving the wires behind. Both can be useful, but Drag is more often what you want.
Edit the second resistor by hovering over it and pressing v. Replace ‘R’ with ‘100’. You can undo any of your editing actions with Ctrl+Z.
Change the grid size. You have probably noticed that on the schematic sheet all components are snapped onto a large pitch grid. You can easily change the size of the grid by Right-Click Grid.
In general, it is recommended to use a grid of 50.0 mils for the schematic sheet.
We are going to add a Teensy to our circuit, which does not have a symbol natively in KiCad. Copy teensy.lib
into the KiCad project folder. In the Eeschema menu, choose Preferences
Manage Symbol Libraries. In the Symbol Libraries window you can see two tabs: Global Libraries and Project Specific Libraries. Each one has one sym-lib-table file. For a library (.lib file) to be available it must be in one of those sym-lib-table files. If you have a library file in your file system and it’s not yet available, you can add it to either one of the sym-lib-table files. We will now add the Teensy library.
Select the Project Specific table. Click the Browse Libraries… button below the table. Since you placed the library in the project folder, you should be able to choose and add the teensy.lib
library and close the window. It will be added to the end of of the list. If you wish you can click its nickname and change it, but ‘teensy’ is fine for now. Close the Symbol Libraries window with OK.
Repeat the add-component steps, however this time select the ‘teensy’ library instead of the ‘Device’ library and pick the ‘Teensy-LC’ component.
Hover the mouse over the microcontroller component. Notice that x and y again flip the component. Keep the symbol mirrored around the Y axis so that pins 5 and 6 (3_RX1_PWM_Touch
and 4_TX1_PWM_Touch
) point to the right.
Repeat the add-component steps, this time choosing the ‘Device’ library and picking the ‘LED’ component from it.
Add another component, this time Conn_01x03_Male
. This is a generic 3-pin connector.
Organize all components on your schematic sheet as shown below.
Conn_01x03_Male
label. If you want to change its position, right click on ‘J?’ and click on ‘Move Field’ (equivalent to m). It might be helpful to zoom in before/while doing this. Reposition ‘J?’ under the component as shown below. Labels can be moved around as many times as you please.It is time to place the power and ground symbols. Click on the ‘Place power port’ button on the right toolbar. Alternatively, press p. In the component selection window, scroll down and select ‘VCC’ from the ‘power’ library. Click OK.
Click above the pin of the 1 kΩ resistor to place the VCC part. Click on the area above and to the left of the Teensy. In the ‘Component Selection history’ section select ‘VCC’ and place another to the left of the microcontroller. Repeat the add process again and place a VCC part above pin 1 of the connector. Move references and values out of the way if needed.
Repeat the add power symbol steps but this time select the GND part. Place a GND part under pin 3 of the connector. Place another GND symbol below and to the left of the microcontroller. Your schematic should now look something like this:
Be careful not to pick ‘Place bus’, which appears directly beneath this button but has thicker lines and is blue. For more on how to use bus connections refer to the full KiCad Documentation.
If you want to reposition wired components, it is important to use g (to grab) and not m (to move). Using grab will keep the wires connected.
We will now consider an alternative way of making a connection using labels. Pick a net labelling tool by clicking on the ‘Place net label’ icon on the right toolbar. You can also use l.
Click the wire connected to the resistor which we connected to pin 6 of the microcontroller. Name this label ‘INPUT’. The label is still an independent item which you can for example move, rotate and delete. The small anchor rectangle of the label must be exactly on a wire or a pin for the label to take effect.
Follow the same procedure and place another label on the wire to pin 2 of the connector. Also name it ‘INPUT’. The two labels, having the same name, create an invisible connection between pin 2 of the connector and the 100 Ω resistor. This is a useful technique when connecting wires in a complex design where drawing the lines would make the whole schematic messier. To place a label you do not necessarily need a wire, you can simply attach the label to a pin.
Labels can also be used to simply label wires for informative purposes. Place a label on pin 5 of the Teensy. Enter the name ‘uCtoLED’. Name the wire between the resistor and the LED as ‘LEDtoR’.
You do not have to label the VCC and GND lines because the labels are implied from the power objects they are connected to.
Below you can see what the final result should look like.
Sometimes it is good to write comments here and there. To add comments on the schematic use the ‘Place text’ icon on the right toolbar.
All components now need to have unique identifiers, so let’s rename all of those components still named ‘R?’ or ‘J?’. Identifier assignation can be done automatically by clicking on the ‘Annotate schematic symbols’ icon ~annotate symbols icon on the top toolbar.
In the Annotate Schematic window, select ‘Use the entire schematic’ and click on the ‘Annotate’ button. Click ‘Close’. Notice how all the ‘?’ have been replaced with numbers. Each identifier is now unique. In our example, they have been named ‘R1’, ‘R2’, ‘U1’, ‘D1’ and ‘J1’.
If you’re just capturing the schematic for documentation purposes, this schematic is now finished. Hit Ctrl+s to save, and you’re done! If you want a PDF version, either select ‘Print’ and print to a pdf printer, or select ‘Plot’ and set the output format to PDF.
KiCad can also run an electrical rules check (ERC) to catch obvious mistakes; to do this, we need to make some more annotations to tell KiCad what we’re doing.
First deal with unconnected wires. Any pin or wire that is not connected will generate a warning when checked by KiCad. To avoid these warnings you can either instruct the program that the unconnected wires are deliberate or manually flag each unconnected wire or pin as unconnected.
Click on the ‘Place no connection flag’ icon on the right toolbar. Click on the unconnected pins. An X will appear to signify that the lack of a wire connection is intentional.
It is now necessary to add a ‘Power Flag’ to indicate to KiCad that power comes in from somewhere. Press a and search for ‘PWR_FLAG’ which is in ‘power’ library. Place two of them. Connect them to a GND pin and to VCC as shown below.