Recitation 10 - Symbol and Footprint Creation - KiCad Version

In this recitation, we're going to show you how to create symbols and footprints from scratch so that you can use them even if somebody else hasn't already created the ECAD models.

Recitation 10 Recitation 10 - Altium Version

Introduction

This is intended to be an interactive recitation. Follow along on your own laptops and feel free to ask questions at any point.

So far in lab, whenever we’ve needed a symbol or footprint, we have either used the models from the KiCad built-in libraries or the models from the libraries we gave you. When you are designing you own PCBs, you are going to want to use parts that don’t exist in these built-in libraries, and you won’t have somebody else to create parts for you (unless you are working in a company that has a dedicated librarian). So, we need to figure out how to do these things for ourselves.

As a reminder, a symbol is the thing that we put on a schematic that indicates its electrical connectivity, while a footprint defines the physical features of how the board is made.

A super simple example

Creating a symbol library

First we need to create a library for all of our examples to exist in. Open up the Symbol Editor (Tools->Symbol Editor). Now hit File->New Library. Choose to create a Project library.

Create a project-specific library

Name it something useful. Trying to change the name of this later might cause issues. Pro tip: you can pin a library by Right click->Pin Library and it will always be at the top of the list.

Pin a library

Creating a symbol

We’re going to start off with a trivially simple part: a simple, 2 pin SMD capacitor. Make sure that you have the library that you just created selected and press File->New Symbol. We will name it cap-2pin-unpolarized and give it the default reference designator C. Also uncheck the Show pin name text and Pin name inside options. Hit OK to proceed.

Create a new symbol

First, let’s draw out the graphical part of the symbol. We will just draw a typical capacitor symbol using the line tool (on the right toolbar or Place->Draw Lines). It might take a while to figure out what is a reasonable sizing. Here, I am going to aim for a total length of 250 mils.

Barebones capacitor graphic

If we used just this graphic, it would be a bit difficult to make out. Let’s fix that by increasing the line width of the lines that symbolize the capacitor plates. Select both lines and increase the line width in the Properties panel. A value of 0 just indicates the default value. If you don’t have the Properties panel (usually on the left side of your screen), make sure it is enabled by going to View->Panels->Properties.

Properties Panel modify line width

We’ve completed the graphics for our symbol, but we are still missing the most important part: the pins. The pins are the actual connection points for the wires. Go to Place->Draw pins or press P. Now configure the Pin Name and Pin Number to 1, and set the Electrical Type to Passive. We’ll talk more about the electrical type in a more complex example, but it essentially just gives the ERC information to catch potential mistakes. Now place the pin and repeat with Pin 2.

Pin Properties

Final symbol

The last step is to configure the symbol properties. Deselect everything by hitting ESC then Right Click->Symbol Properties. The properties are very useful for giving the user specify information about a part. Here, let’s add a Voltage property by clicking the + symbol. We can leave the value blank so that the user can specify the voltage when they place the symbol. Also, check the Show option so that this value will appear on the schematic.

Edit Symbol Properties

Now, make sure to save your part and if you wish, you could place this into your schematic.

Footprint creation

Let’s move on to creating a footprint. We’ll stick with a simple SMD capacitor, specifically an 0603 part. Open up the Footprint Editor. This is accessible through the top bar, or if you are in the PCB Editor, through Tools->Footprint Editor.

Again, we must first create a library. Hit File->New Library. Choose to create a Project library. While a symbol library exists as one file in KiCad, a footprint library is actually just a folder that contains a collection of footprint files. Now, do File->New Footprint to create a new footprint in our library. Right click->Rename and rename it something useful such as cap-0603.

We will begin by placing a pad (from the right toolbar or Place->Add Pad). Place this anywhere. Now, we must size it correctly. We will size it based on this recommended land pattern from a Murata datasheet.

0603 Capacitor Footprint Drawing

In the Pad Properties set the X size and Y size appropriately. With a little bit of math, we can figure out that the pad width is 1.0 mm. If you have your units set to mils instead of mm, you can just type mm in the box and it will automatically convert.

Pad properties

The rest of the settings are fine for now, so click OK and place the pad on the origin to make it easier to figure out the placement of the next pad. Duplicate it, change the new pad to number 2, and place it according to the footprint drawing. This requires us to place it 2mm to the right of the 1st pad, which we can achieve either by using the grid or directly entering coordinates in properties.

Two pads placed

Finally, we will add any remaining info to the footprint, starting with the courtyard. The courtyard indicates the area that is taken up by the component + some clearance. The KiCad Library Conventions contains great recommendations how to use this (as well use other good conventions for creating symbols and footprints). Based on this, we will add a rectangle that is 0.25mm larger than the outline of the pads, which is easy to do if your pads are on-grid and you set your grid spacing to 0.25mm. Do this on the F.Courtyard layer.

Courtyard placed

We can also add a couple of lines on the F.Silkscreen layer to help indicate how the resistor should be placed.

Optional Silkscreen

Great! We should be done now. Run the Footprint Checker Tools->Footprint Checker to ensure that KiCad doesn’t see anything wrong with it.

Importing External Models

The process we just went through is kinda annoying, and would be hugely time consuming if we had to do if for every part we use on a board. Luckily, a lot of time there are freely available models online. Let’s look at how to import models using the op-amp we used in lab AD8592 on DigiKey.

On DigiKey (and some other supplier websites), you can click the link listed under EDA/CAD Models to get these models. Click that link and download the UltraLibrarian models. Then extract the ZIP folder. You’ll notice that there is a KiCad symbol, as well as a folder with 3 footprints. We could theoretically leave this as a separate library, but that becomes messy, so let’s merge these into our project library.

Symbol

Open the Symbol Editor, make sure you have your symbol library selected, then File->Import Symbol. This will bring the symbol into our library, at which point we should immediately check that it matches the datasheet. If you notice, this symbol is just a rectangle, as opposed to the much more readable op-amp symbol that we provided you with in lab. Electrically, it is the same, but it takes much more time to digest and understand. If you were using this part in one of your projects, it would be a good idea make your own, likely using multi-unit symbols. From here, we should at the very least edit the Footprint property and pin types (discussed in Example 2), though you are free to edit whatever you like to suit your project’s needs. Make sure to save it when you are done editing.

KiCad Symbol Import

The pin type for all of the unspecified pins is probably best set to passive. Although some of these are inputs/outputs, when the ERC runs it will look to see "Is this input connected to an output?" or "Is there only one output connected to this net?" etc. Because op-amps are typically used in analog circuits, they are frequently going to just get connected to pins with pin type passive, which may generate unnecessary warning/errors. It's worth playing around with, but over-specifying pin types can lead to a bunch of annoying warnings and errors when you run the ERC.

Footprint

Follow a similar process to import the footprint from the Footprint Editor. Notice that there are 3 different footprints that were provided by UltraLibrarian. These are just intended for different densities, so they have different clearances around them. We can use the one without the “-L” or “-M” ending. Then save it to your footprint library. The first thing you should do is check that the footprint matches the datasheet! Then, you can make any edits you might need. For example, we recommend getting rid of the asterisks for the pin 1 marking and replacing them with a dot.

KiCad Footprint Import

Example 2

Frequently, it is useful to grab existing symbols and footprints to modify them. We won’t do this with a symbol in this example, though we easily could. So that we can play around with more of the symbol editor’s features, let’s use a fake part that we’ll call the ASoPD LT9999. This part has an SOT23-6 footprint, and the following pinout:

Pin Name Pin # Description
VIN 1 Supply voltage
VOUT 2 Output voltage
PG 3 Power good (open drain)
SCL 4 I2C clock
SDA 5 I2C data
GND 6 Ground

Creating the symbol

First let’s create the symbol for this. We’ll zoom through the first part since we did this earlier. Set the symbol name to the part number (LT9999) and leave the Default reference designator as U. This time, we will enter the pin definitions in the Pin Table (located on the top toolbar). We will add a row for each pin. Set it up as show in the image.

Example 2 Pin Table

Here’s a quick summary of what the Electrical Types are doing here (mostly for the ERC):

  • Power input: This tells KiCad that this pin will be expected to be connected to 1 power output
  • Power output: This tells KiCad that this is the “source” of some power net. Should only be one of these per net
  • Open collector: Same as Open Drain. This is used when the pin can pull down a net, but it needs an external resistor to pull it up.
  • Bidirectional: Used when there is Bidirectional information flow (SCL can be bidirectional because of clock stretching)

The open collector type is a bit odd, and is probably mostly useful for telling the user that it is open drain/collector, rather than it being used for the ERC. It’s probably best to prioritize another pin type if it also fits that category (like the I2C pins).

When you have your pins, arrange them in a rectangle like this. You can arrange the pins however you like. This is a fake device, so there’s not necessarily a sense of what’s logical for pin placement here. You can set the fill color for the rectangle in Properties (Fill with body background color is probably what you want)

KiCad Pin in Box

Now, let’s add some properties. Since this symbol is for a specific part, we should add that info. Add a Manufacturer and Manufacturer PN property (set to ASoPD and LT9999, respectively). Also, place the part number in the Value field (this is typical for ICs). If this was a real part, you could add other fields like the datasheet, or other info you care about. The last interesting thing we can do is set a Footprint link. We haven’t created this yet, but we will name our footprint by the part number, so enter YOUR_FOOTPRINT_LIB_NAME:LT9999. You could also link it to a standard KiCad footprint.

KiCad Example 2 Symbol Properties

Copying a footprint

The last thing we have to do for this is to create a footprint, but SOT23-6 is a standard footprint that KiCad has builtin! You could have directly used this footprint, but let’s get practice duplicating them in case you every want to modify a symbol in the future. Open up the Footprint Editor and search for the SOT-23-6 footprint. Right click->Save As and save it to your footprint library that we created earlier with the name LT9999.

KiCad Example 2 Duplicate Footprint

And easy as that, we are done. If you were to place your LT9999 symbol and open up Assign Footprints, you’d find that the footprint automatically populates itself.

Extra Practice

If we have extra time in recitation, try creating some of these parts (which actually don’t have good ECAD models readily available).

  • Multi-unit symbol practice: Try creating a multi-unit symbol for the AD8592 using this guide
  • Tricky footprint: You’ll have to carefully read the mechanical drawing EVU-E2AF25B54

Some notes

  • Never blindly trust that the ECAD model you found online is accurate
  • Never blindly trust yourself. It’s easy to make tiny dimensioning mistakes, which could necessitate a respin of the board. Always double check!
  • The tool stores separates instances of each symbol and footprint. This means you can edit them independently of each other (such as adding unique values to each symbol)