3.1. Using Eeschema

3.1. Using Eeschema

  1. Under Windows run kicad.exe. Under Linux type kicad in your Terminal. You are now in the main window of the KiCad project manager. From here you have access to eight stand-alone software tools: Eeschema, Schematic Library Editor, Pcbnew, PCB Footprint Editor, GerbView, Bitmap2Component, PCB Calculator and Pl Editor. Refer to the work-flow chart to give you an idea how the main tools are used.

    KiCad Main Window

  2. Create a new project: FileNew ProjectNew Project. Name the project file tutorial1. The project file will automatically take the extension “.pro”. KiCad prompts to create a dedicated directory, click “Yes” to confirm. All your project files will be saved here.

  3. Let’s begin by creating a schematic. Start the schematic editor Eeschema, Eeschema. It is the first button from the left.
  4. Click on the Page Settings icon Sheet settings icon on the top toolbar. Set the Page Size as A4 and enter the Title as Tutorial 1. 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 project: FileSave Schematic Project
  5. We will now place our first component. Click on the Place component icon Add component Icon in the right toolbar. The same functionality is achieved by pressing the Place component shortcut key (a).

    Note

    You can see a list of all available shortcut keys by pressing the ? key.

  6. Click on the middle of your schematic sheet. A Choose Component window will appear on the screen. 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.

    Choose Component

  7. Double click on it. This will close the Choose Component window. Place the component in the schematic sheet by clicking where you want it to be.

  8. Click on the magnifier icon to zoom in on the component. Alternatively, use the mouse wheel to zoom in and zoom out. Press the wheel (central) mouse button to pan horizontally and vertically.
  9. Try to hover the mouse over the component R and press the r key. The component should rotate. You do not need to actually click on the component to rotate it.

    Note

    If your mouse was also over the Field Reference (R) or the Field Value (R?), a menu will appear. You will see these Clarify Selection menu often in KiCad, they allow working on objects that are on top of each other. In this case, tell KiCad you want to perform the action on the Component …R….

  10. Right click in the middle of the component and select Edit ComponentValue. You can achieve the same result by hovering over the component and pressing the v key. Alternatively, the e key will take you to the more general Edit window. Notice how the right-click menu below shows shortcut keys for all available actions.

    Edit component menu

  11. The Component value window will appear. Replace the current value R with 1 k. Click OK.

    Note

    Do not change the Reference field (R?), this will be done automatically later on. The value inside the resistor should now be 1 k.

    Resistor Value

  12. To place another resistor, simply click where you want the resistor to appear. The Component Selection window will appear again.

  13. The resistor you previously chose is now in your history list, appearing as R. Click OK and place the component.

    Component history

  14. In case you make a mistake and want to delete a component, right click on the component and click Delete Component. This will remove the component from the schematic. Alternatively, you can hover over the component you want to delete and press the del key.

    Note

    You can edit any default shortcut key by going to PreferencesHotkeysEdit hotkeys. Any modification will be saved immediately.

  15. You can also duplicate a component already on your schematic sheet by hovering over it and pressing the c key. Click where you want to place the new duplicated component.

  16. Right click on the second resistor. Select Drag Component. Reposition the component and left click to drop. The same functionality can be achieved by hovering over the component and by pressing the g key. Use the r key to rotate the component. The x key and the y key will flip the component.

    Note

    Right-ClickMove component (equivalent to the m key option) 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. We will see later on why this is the case.

  17. Edit the second resistor by hovering over it and pressing the v key. Replace R with 100. You can undo any of your editing actions with the ctrl+z key.

  18. 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-ClickGrid select. In general, it is recommended to use a grid of 50.0 mils for the schematic sheet.
  19. We are going to add a component from a library that isn’t configured in the default project. In the menu, choose PreferencesComponent Libraries and click the Add button for Component library files.
  20. You need to find where the official KiCad libraries are installed on your computer. Look for a library directory containing a hundred of .dcm and .lib files. Try in C:\Program Files (x86)\KiCad\share\ (Windows) and /usr/share/kicad/library/ (Linux). When you have found the directory, choose and add the microchip_pic12mcu library and close the window.
  21. Repeat the add-component steps, however this time select the microchip_pic12mcu library instead of the device library and pick the PIC12C508A-I/SN component.
  22. Hover the mouse over the microcontroller component. Press the y key or the x key on the keyboard. Notice how the component is flipped over its x axis or its y axis. Press the key again to return it to its original orientation.
  23. Repeat the add-component steps, this time choosing the device library and picking the LED component from it.
  24. Organise all components on your schematic sheet as shown below.

    gsik_tutorial1_010_png

  25. We now need to create the schematic component MYCONN3 for our 3-pin connector. You can jump to the section titled Make Schematic Components in KiCad to learn how to make this component from scratch and then return to this section to continue with the board.

  26. You can now place the freshly made component. Press the a key and pick the MYCONN3 component in the myLib library.
  27. The component identifier J? will appear under the MYCONN3 label. If you want to change its position, right click on J? and click on Move Field (equivalent to the m key option). 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.

    gsik_myconn3_s_png

  28. It is time to place the power and ground symbols. Click on the Place a power port button add_power_png on the right toolbar. Alternatively, press the p key. In the component selection window, scroll down and select VCC from the power library. Click OK.

  29. Click above the pin of the 1 k resistor to place the VCC part. Click on the area above the microcontroller VDD. In the Component Selection history section select VCC and place it next to the VDD pin. Repeat the add process again and place a VCC part above the VCC pin of MYCONN3.
  30. Repeat the add-pin steps but this time select the GND part. Place a GND part under the GND pin of MYCONN3. Place another GND symbol on the right of the VSS pin of the microcontroller. Your schematic should now look something like this:

    gsik_tutorial1_020_png

  31. Next, we will wire all our components. Click on the Place wire icon Place wire on the right toolbar.

    Note

    Be careful not to pick Place a bus, which appears directly beneath this button but has thicker lines. The section Bus Connections in KiCad will explain how to use a bus section.

  32. Click on the little circle at the end of pin 7 of the microcontroller and then click on the little circle on pin 2 of the LED. You can zoom in while you are placing the connection.

    Note

    If you want to reposition wired components, it is important to use the g key (grab) option and not the m key (move) option. Using the grab option will keep the wires connected. Review step 24 in case you have forgotten how to move a component.

    gsik_tutorial1_030_png

  33. Repeat this process and wire up all the other components as shown below. To terminate a wire just double-click. When wiring up the VCC and GND symbols, the wire should touch the bottom of the VCC symbol and the middle top of the GND symbol. See the screenshot below.

    gsik_tutorial1_040_png

  34. We will now consider an alternative way of making a connection using labels. Pick a net labelling tool by clicking on the Place net name icon add_line_label_png on the right toolbar. You can also use the l key.

  35. Click in the middle of the wire connected to pin 6 of the microcontroller. Name this label INPUT.
  36. Follow the same procedure and place another label on line on the right of the 100 ohm resistor. Also name it INPUT. The two labels, having the same name, create an invisible connection between pin 6 of the PIC and the 100 ohm 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.
  37. Labels can also be used to simply label wires for informative purposes. Place a label on pin 7 of the PIC. Enter the name uCtoLED. Name the wire between the resistor and the LED as LEDtoR. Name the wire between MYCONN3 and the resistor as INPUTtoR.
  38. You do not have to label the VCC and GND lines because the labels are implied from the power objects they are connected to.
  39. Below you can see what the final result should look like.

    gsik_tutorial1_050_png

  40. Let’s now 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.

  41. Click on the Place no connect flag icon noconn_png on the right toolbar. Click on pins 2, 3, 4 and 5. An X will appear to signify that the lack of a wire connection is intentional.

    gsik_tutorial1_060_png

  42. Some components have power pins that are invisible. You can make them visible by clicking on the Show hidden pins icon hidden_pin_png on the left toolbar. Hidden power pins get automatically connected if VCC and GND naming is respected. Generally speaking, you should try not to make hidden power pins.

  43. It is now necessary to add a Power Flag to indicate to KiCad that power comes in from somewhere. Press the a key, select List All, double click on the power library and search for PWR_FLAG. Place two of them. Connect them to a GND pin and to VCC as shown below.

    gsik_tutorial1_070_png

    Note

    This will avoid the classic schematic checking warning: Warning Pin power_in not driven (Net xx)

  44. Sometimes it is good to write comments here and there. To add comments on the schematic use the Place graphic text (comment) icon add_text_png on the right toolbar.

  45. All components now need to have unique identifiers. In fact, many of our components are still named R? or J?. Identifier assignation can be done automatically by clicking on the Annotate schematic icon annotate_png on the top toolbar.
  46. In the Annotate Schematic window, select Use the entire schematic and click on the Annotation button. Click OK in the confirmation message and then 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.
  47. We will now check our schematic for errors. Click on the Perform electrical rules check icon erc_png on the top toolbar. Click on the Run button. A report informing you of any errors or warnings such as disconnected wires is generated. You should have 0 Errors and 0 Warnings. In case of errors or warnings, a small green arrow will appear on the schematic in the position where the error or the warning is located. Check Create ERC file report and press the Run button again to receive more information about the errors.

    Note

    If you have a warning with “No default editor found you must choose it”, try setting the path to c:\windows\notepad.exe (windows) or /usr/bin/gedit (Linux).

  48. The schematic is now finished. We can now create a Netlist file to which we will add the footprint of each component. Click on the Generate netlist icon netlist_png on the top toolbar. Click on the Generate button and save under the default file name.

  49. After generating the Netlist file, click on the Run Cvpcb icon cvpcb_png on the top toolbar. If a missing file error window pops up, just ignore it and click OK.
  50. Cvpcb allows you to link all the components in your schematic with footprints in the KiCad library. The pane on the center shows all the components used in your schematic. Here select D1. In the pane on the right you have all the available footprints, here scroll down to LEDs:LED-5MM and double click on it.
  51. It is possible that the pane on the right shows only a selected subgroup of available footprints. This is because KiCad is trying to suggest to you a subset of suitable footprints. Click on the icons module_filtered_list_png, module_pin_filtered_list_png and module_library_list_png to enable or disable these filters.
  52. For IC1 select the Housings_DIP:DIP-8_W7.62mm footprint. For J1 select the Connect:Banana_Jack_3Pin footprint. For R1 and R2 select the Discret:R1 footprint.
  53. If you are interested in knowing what the footprint you are choosing looks like, you have two options. You can click on the View selected footprint icon show_footprint_png for a preview of the current footprint. Alternatively, click on the Display footprint list documentation icon datasheet_png and you will get a multi-page PDF document with all available footprints. You can print it out and check your components to make sure that the dimensions match.
  54. You are done. You can now update your netlist file with all the associated footprints. Click on FileSave As. The default name tutorial1.net is fine, click save. Otherwise you can use the icon Save icon. Your netlist file has now been updated with all the footprints. Note that if you are missing the footprint of any device, you will need to make your own footprints. This will be explained in a later section of this document.
  55. You can close Cvpcb and go back to the Eeschema schematic editor. Save the project by clicking on FileSave Whole Schematic Project. Close the schematic editor.
  56. Switch to the KiCad project manager.
  57. The netlist file describes all components and their respective pin connections. The netlist file is actually a text file that you can easily inspect, edit or script.

    Note

    Library files (\.lib*) are text files too and they are also easily editable or scriptable.

  58. To create a Bill Of Materials (BOM), go to the Eeschema schematic editor and click on the Bill of materials icon bom_png on the top toolbar. By default there is no plugin active. You add one, by clicking on Add Plugin button. Select the *.xsl file you want to use, in this case, we select bom2csv.xsl.

    Note

    The *.xsl file is located in plugins directory of the KiCad installation, which is located at: /usr/lib/kicad/plugins/.

    Or get the file via:

    1. wget https://raw.githubusercontent.com/KiCad/kicad-source-mirror/master/eeschema/plugins/bom2csv.xsl

    KiCad automatically generates the command, for example:

    1. xsltproc -o "%O" "/home/<user>/kicad/eeschema/plugins/bom2csv.xsl" "%I"

    You may want to add the extension, so change this command line to:

    1. xsltproc -o "%O.csv" "/home/<user>/kicad/eeschema/plugins/bom2csv.xsl" "%I"

    Press Help button for more info.

  59. Now press Generate. The file (same name as your project) is located in your project folder. Open the *.csv file with LibreOffice Calc or Excel. An import window will appear, press OK.

You are now ready to move to the PCB layout part, which is presented in the next section. However, before moving on let’s take a quick look at how to connect component pins using a bus line.