Tutorial: How to make a footprint (From scratch)?


#1

Disclaimer: Screenshots taken in a nightly from after the 5.0.0-rc2 tag. (KiCad 5 will look very similar but there will be slight differences in KiCad 4)

The official docu gives a few hints about how kicads footprint editor works.

Other FAQ articles worth reading:

Other interesting resources:

Creating a footprint using the footprint editor

Introduction

All elements of a footprint are specified relative to the footprint origin. This means pads are defined via their center point relative to that origin plus size specifiers.
To create a footprint the first step is to translate dimensions given in the datasheet into a form that gives the center position and size of pads. (Relative to the chosen center)

What center should be chosen for the footprint?

If your footprint is intended only to be used by yourself and you hand populate the pcb, then you can put the center anywhere you want. (Make it easy for your self. We will get back to that later on.)

Center point for automatic assembly

If the pick and place center position is given in the datasheet then use that.
For surface mounted components (SMD) the center of the part body will be a good choice for the footprint center.
For through hole parts (THT) typically pin 1 is chosen as the center position.

Something important to keep in mind: If you plan on having your board assembled by a machine, talk to the guys programming it. They can give you guidance.

Getting dimensions for the footprint

Disclaimer: This section might go into too much depths for a novice. Especially the later subsections. In practice eyeballing the dimensions should be ok for a lot of use-cases. Especially true if the part is hand-soldered. It might still be a good idea to read this as it might give you inspiration for how to improve your skills.

What can be expected inside a datasheet

Every good datasheet at least contains a detailed dimensioned drawing of the component. Some even contain a suggested footprint layout to give the user a starting point.
Such a suggested footprint should not be taken at face value. Especially older datasheets might be out of date with current manufacturing methods and industry standards. (Meaning if you have access to some reliable piece of information that contradicts the suggested footprint, it might just be that the datasheet is wrong.)

The dimensioned drawings are most likely found somewhere near the end of the datasheet. (Not all datasheets follow that rule. I have encountered datasheets where the packaging information is somewhere in the middle.)
Some manufacturers do not include the dimensioned drawings in the datasheet but have them in a separate document.

What to do if datasheet does not give a suggested footprint?

If a datasheet does not contain a suggested footprint, it is possible that the manufacturer supplies an application note that aids the user in creating a valid footprint. Dimensioned drawings of footprints in such application notes do not necessarily apply to the component in question. (Application notes might be written with many different components in mind. Drawings might just be examples for some of them.)
Some conclusions can still be drawn from the application note even if it is not for the exact part you are using.

Another source for information are similar footprints from a trusted source. In most cases it is easier to modify such a footprint than to create one from scratch.

Datasheets of similar parts by other manufacturers can also supply some useful information. Especially if they contain both a dimensioned drawing of a footprint and the package. If the dimensioned drawing of the package is the same as your component then you can use the footprint as is. Otherwise you can use it to get information about fillet sizes. (More details in the example about the qfn footprint below.)

Some manufacturers also have a specialized tool with its own specialized file format to share footprints with their users. (Analog devices is an example for that. Sadly their tool only runs under windows. It also requires you to register with them. At least at the time of writing this.)

Using industry standards

Industry standards can be of great help when designing a footprint. Sadly such standards are most likely closed. (They are quite expensive.) One well known standard for smd parts is the IPC-7351 series. (IPC-7351B is the most recent standard at the time of writing. IPC-7315C is expected to be released soon.)

There exist tools that generate footprints in accordance to IPC standards. All of them however are closed and cost quite a bit. (If you really worry about being complaint this will be the price to pay.)
There are some open tools out there (Example: The python footprint generator for kicad has some ipc generators The QEDA project also has some IPC footprint generators.). Such tools are not able to give you a certificate for your parts.

We will discuss the terminology used in this standards later on. We will also design a footprint using some of the more easily to find recommendations. (With some patience a surprising amount of information about this standard can be found.) Older IPC standards can even be found complete on some file sharing sites. Be aware that sharing them would be a violation of copyright. (This is why we will not link to any such documents here.)

Talk to your manufacturer

If you know which manufacturers will be used to produce your PCB and also who will be used to solder it, you might want to ask them for their “Design for Manufacturing” (DFM) guidelines. These guidelines might contradict other industry standards. (Like with every other competing set of standards.) Use your own judgment what guideline to trust. (If it is critical it might pay to produce some sample pcbs and analyze the result.)


Review of DC Barrel Jack PCB footprint - Things don't add up!
Anybody know how to get Sim900A footprint package
Footprint for TLV757
Grids, Origins, Offsets, and Pitch
How does KiCad know which symbol pin is connected to which pad of the footprint?
KiCad 5 footprint editor: what are the "Set grid origin" and "place footprint reference anchor" buttons for and how/when/why do we use them?
FAQ Index Thread
Help to source, install and manage libraries?
Newbie help with designing a PCB with a 4PDT switch
High level thinking
Footprint problems
VSSOP 10 Package
Footprint for connector
V5 courtyard anchor grid origin auto pin centre
Looking for thru-hole tactile switch with LED
Looking for various footprints (ATMega)
Looking for various footprints (ATMega)
Footprints and symbol for solid state relay D3805HK?
Are there any bornier connectors?
Placing pads with equal distance apart
Netlist Load Error
Atmega housings
#2

Example footprint Molex Picoblade (From suggested footprint in the datasheet)

To illustrate the points above lets look at an example. We will be making a footprint for the molex picoblade connector 53398-0671. Molex supplies dimensioned drawings with a suggested land pattern.

Getting the necessary dimensions from the datasheet (dimensioned drawing)

picoblade_easy_center
The black dimensions are the ones already present in the original drawing. The blue ones are also from the same document but they come from a different drawing.

In red are the things we need to calculate in order to make the footprint. (As we can only enter the center position and sizes of pads.)

To make it easy for us we placed the center such that it aligns in the y direction with the center of the mounting pads.

However this part defines a center for the pick and place machine. (For our part the drawing is on page 4)
This of course makes it a lot more complicated as we then need to do more calculations. (In fact even the calculation of the center position relative to the body outline is quite involved and not shown here.)
For the remaining tutorial we will use the easier drawing as our reference. (Just be aware that this would make live harder if you want to use this footprint for programming a pick and place machine.)
picoblade

Preparing the footprint editor for creating the footprint

For following this tutorial create a new empty project. Open the footprint editor and create a new footprint. As name for that footprint i would suggest something like “Molex_PicoBlade_53398-0671”.

Now create a new library from that footprint within the project directory and add it to the project local fp-lib-table.

The result should look like this.

Adding the mounting pads using the user grid.

To showcase how the user grid can be used for creating footprints we will use that to add the mounting pads.

First we setup the user grid such that grid points are where our two mounting pads should later be. Open the user grid definition from the view menu (In kicad 4 it is found in the Dimensions menu)
Set the x spacing to 5.675mm. (We calculated 5.675mm for xm.)
The y spacing is not critical right now but to reduce the possibility of an error we set it to some large value. (5mm should do the trick.)

Now place the first pad for the mounting pins. Open the pad properties dialog (Press e while hovering above the pad. Also reachable via the right click menu -> preferences)
Set the pad to SMD, rectangular, x size = 2.1mm and y size = 3mm
We give the mounting pads the pin number “MP”. We do that such that it is compatible with the symbols of the official library. (There are symbols that allow connecting the mounting pad from the schematic.) Alternatively you can leave the pin number for the mounting pins empty. That will mean you can not connect them from the schematic. (Depends on your needs.)
The pad settings should look like this:

Now we duplicate the mounting pin. Start the operation with [crtl+d or right click -> duplicate] move the mouse to the right and left-click to place the second mounting pad.
The resulting footprint should now look like this. (I set the grid to be viewed as lines to make it easier to see in the screenshot.)

Adding the “normal” connection pads

We now add the remaining pads to the footprint. To showcase the grid workflow a bit more we will use it again. In a second footprint we will show how the same can be done using the array function of the modern (open gl) canvas.

Now we setup the grid center to be at y=-2.75mm (the y axis increases towards the bottom of the screen. We want to place the pads 2.75mm above the mounting pads so we need to enter a negative value.)

To reduce the possibility for errors we also set the x grid origin to -3.75mm (The origin is then at the position of pad 1)

The grid spacing in x direction is now set to the pin pitch (1.25mm)

Now place the leftmost pad. (At the grid origin = White circled cross mark.) Again edit the pad properties and set the size for the pad as shown in the dimensioned drawing. (Reminder: 0.8x1.3mm) The pin number should already be equal to 1.

Now reactivate the pad placement tool and place 5 more pads using the grid points. Notice that kicad automatically increases the pad number.
The footprint should now look like this:

The most important parts of the footprint are now done. Everything else is mainly for documentation, quality control, …

Adding the part outline on the fab layer, silk layer and courtyard layer

Read this FAQ article to learn what layer is used for what purpose

What should be on these layers can be taken from the kicad library convention. At least a part outline on the fab and silk layer plus pin 1 markers and a simple rectangle defining the courtyard area should be present for a well defined footprint.

Silk and Fab outlines

We will keep using the user grid. The outlines on silk and fab are not critical to the function of the part. It still makes sense to create them as exact as possible. (Some datasheets are missing critical information to define the details of the part outline. In such cases either a physical part can be measured, maybe a 3d model exists that can be used as a reference or one needs to approximate the outline.)

As the molex drawing includes all necessary measurements we can make an exact outline. (Deriving the measurements will be left to the reader as we already detailed that for the pads.)
Lets draw the main body outline together. Try to calculate the grid settings your self and compare them to my results: origin=(x=-4,625mm, y=-2.6mm), size=(x=9.25mm, y=3.7mm)

Set the fabrication layer as the active drawing layer. (Left-click on the F.Fab layer name in the right toolbar. The blue triangle should now point to the F.Fab layer.)
Select the line tool (right toolbar) and left-click on the grid origin. Move the mouse to the next grid point (example to the right) and click again. Repeat this for the remaining 3 lines to get a closed rectangle. Use the ESC key or double-click to end the tool.

The line thickness can be changed using the properties menu of said line. (shortcut e) Sadly there is no way to change multiple lines at once. Setting the default thickness is done in the properties dialog of any line. (The fastest workflow i know of is creating the first line, setting the default thickness and then draw the rest.)

After the main rectangle is drawn the body should look like this.

We can now repeat this process to draw small rectangles around the parts holding the mounting pins. and the body outline is done.


For the silk outline it is enough to set the grid to some small value (example 0.05mm) and just draw it such that it is fully outside the F.Fab outline.
To get it symmetric we first reset the grid origin back to 0,0.
If this is too imprecise for your liking you can continue walking around using the grid and grid origin.

One important thing to note is that it makes sense to avoid putting silk over the area that will be free of mask. So keep a small clearance to pads. (The clearance depends on the manufacturer used. For committing to the official library look at the KLC.)

After adding the silk outline plus a pin 1 marker on both the silk and fab layer the footprint could look something like this. (Note that you can also use other types of pin 1 markers. There are industry standards that give suggestions.)

Courtyard outline

The courtyard outline defines the area where no other part should be placed. It is principally up to the designer to decide how large this area should be. Again the KLC can give beginners some guidance. Another point of reference are industry standards.

KiCad 5 is now able to check for courtyard violations. For this to work the courtyard outline must be a closed polygon (Each segment end point must be with 0.01mm of the next segments start point.)

As this is a footprint for a connector and i use the KLC as my guide, i create the courtyard with 0.5mm clearance all around. (In this case relative to the pads as they protrude the body in all directions.)

In the end the resulting footprint could look like this:

Improving the resulting footprint

If you compare the footprint we created with the one found in the official library you will notice that the one in the library is a lot more complex. The fab outline is a lot more detailed and the silk outline follows it much closer. It should be noted that the footprint found in the official lib is script generated.

Another improvement would be to use the pick and place center point as the footprints origin. And the courtyard outline could follow the outline more closely.


#3

Example footprint QFN-64 with exposed pad (Calculate land pattern from part dimensions)

As a second tutorial we make the footprint for ATmega165A-MU. A dimensioned drawing of the package is found in the datasheet on page 827.
You will notice that this datasheet does not include a suggested footprint layout. Now we are forced to develop one from the dimensions of the package alone.

Definition of terms

We will borrow a few terms from industry standards to discuss how to derive a footprint.
The first terms you will come across reading such a document are heel, toe and side solder fillets. These define the size increase of the pad compared to the lead contact area in their respective direction.
The lead contact area is calculated to fit most parts. (The contact area after production should agree with the calculated area with high statistical certainty.)
ipc_terms

Calculating the lead contact area

The first step for determining the pad sizes and position is to find the lead contact area. Here it is helpful to use a cad program. Pencil and paper should also be enough.
From the datasheet drawings we get the following result. (Green are maximum values. Blue are minimum values. Note that we put the maximum lead size together with the minimum body size.)

However this picture is a bit overly cautious. It is very unlikely that the pads are at their maximum tolerance at the same time as the body is on its minimum. A more realistic calculation is shown below.
A rigorous calculation must consider manufacturing tolerances as well. (Placement tolerance and tolerances from PCB production.)

For the purpose of tutorial we ignore both shortcomings. (We use the above result as is. It is in this case remarkable close compared to a more detailed calculation.)

Improved calculation of Smin

For anybody interested i give an example of how Smin could be calculated more accurately. Lets start with how we have it now:

  • Smax = Dmax - Lmin
  • Smin = Smax - Sum(tolerances)

Where D is the body size and L the contact (lead) length.

As mentioned above simply summing up all tolerances is overly cautions. A better way is to sum up the squares of all tolerance. The error term is the square root of that sum.

  • Smin(RMS) = Smax - √(Sum(tolerances²))

Calculation of the pad sizes

We use the following fillet sizes to calculate the needed pad sizes:

  • heel = 0mm
  • side = -0.04mm
  • toe = 0.3mm

The source for these is this blog post. (They are from IPC-7351)

The two pads on top are shown to check if we have a problem using these measurements. Everything looks ok so we can go into kicad and start making our footprint.

Placing the pads in kicad

Create a new footprint as shown in the Connector Molex footprint tutorial above. (As a name something like QFN-64-1EP_9x9mm should do for now. A better name would include more information. The footprint naming convention of the KLC could be used as a guide.)

This time we will use the array function of the modern (opengl) canvas. Place the first pad at x=-4.425mm and y=-3.75mm; size x=0.85mm, y=0.22mm.
Right click on the pad and select create array [or shortcut ctrl+T].
In the array dialog set the vertical count to 16 and horizontal count to 1. Vertical spacing is set to 0.5.
For correct pad numbering set the initial number selection to “start number” and enter 1 as the start number.

We do the same with the bottom row. Place the leftmost pad and give it pad number 17. (coordinates are now y=4.425mm and x=-3.75mm)
Again start the array dialog. It should still have the same values as before. So we change the vertical count to 1 and the horizontal count to 16. Make sure horizontal spacing is 0.5 and that the start number is 17.

For the remaining two side repeat the same. Place the bottom left pin and start the array function from there. We use negative spacing to get the pads to increase their pin numbers in the right direction. (remember to update the start number)
Here shown the array setup for the top row starting from the top right pad:

In the end the footprint should look like this

The exposed pad

Footprints with a large exposed pad pose a number of interesting problems. They are nearly impossible to hand solder. To make live easy one could add a large through hole (large drill) to be able to solder it from below. In this tutorial we will however make a footprint such that it can be reflow soldered.

For reflow soldering of such parts we need to reduce the paste coverage of the exposed pad to somewhere between 50 to 80% by area. (Different sources give different ranges.) We will aim for 65% as this is in the middle of this range and should be a good compromise.

In addition to reducing the paste area it is suggested to split it into multiple small areas. This allows for better out-gassing. Another benefit is that squeegee deformation is limited as the openings in the stencil are smaller that way.

The pad size is not that critical. Most manufacturer datasheets seem to suggest the nominal lead size in their datasheets. In our footprint there is enough space between the exposed pad and the normal pads. I personally would therefore increase its size a bit. (I would use the IPC calculations with 0 or a small negative fillet.)
For this tutorial we simply use the maximum pad size (5.5x5.5mm)

Add a rectangular SMD pad with size 5.5x5.5mm at x=0 and y=0. Set the pad number to 65 (one higher than the maximum normal pad number). Deselect the paste layer as we want to have it controlled by separate pads.

Now we still need to add the paste layer. A good rule of thumb is that each paste pad should be around 1x1mm. In our case we would have the choice between an array of 4x4 or 5x5 paste pads. (As we make it by hand i chose to go with 4x4)

The side length for the paste pads is calculated as 5.5*√(0.65)/4 ≈ 1.1
Using that we can sketch the layout in a cad program (or do the math by hand) such that the paste pads are equally spaced. (I aim for the inner paste clearances to be double the outer ring.)


Using the array function is not really possible in this case as it does not allow us to assign no pad number to the resulting pads. So we fall back to using the grid and the duplication of an initial pad.

For the first paste pad the pad properties dialog should be:

After placing all paste pads it should look like this. (Note that you will need to set the F.Paste Layer as active to see the paste layout.)

Bonus: Adding thermal vias

Some footprints with exposed pads need vias to connect the pad to the bottom layer (Or an internal large copper zone). This allows for better thermal management. One can of course leave this for the board design but there it gets tedious. A lot easier is placing them while creating the footprint.

Introducing vias into the pad has some drawbacks. The most noticeable is that it will result in solder loss. There are multiple ways to combat that. The cheapest being to accept some loss and increase the amount of paste. Another option is bottom tenting. If you follow the tutorial exactly you will end up with bottom tented vias. (Talk to your manufacturing guys if this is a good idea for the process used in your project.)


The first step is to decide how many vias should be placed and where. I decided to go with a 5x5 array with the outermost ring touching the outer edge of the pad. As via size i chose 0.2mm drill with 0.15mm annular ring. (Resulting in 0.5mm pad size)
Using a CAD program i get the following layout:

We setup the grid again

  • origin at any via. In this case a via is at the origin. (Meaning 0,0 is a good choice for our grid origin)
  • Spacing is the via pitch we determined in the sketch.

Place a pad and change it to be a circular through hole pad. Pad number 65, size 0.5mm and drill 0.2mm. Remove the ticks for F.Mask and B.Mask. (F.Mask is removed because we want to control where mask is placed with other pads. Removing the tick for B.Mask results in bottom tented vias.)

Duplicate that pad again for every grid point. (As soon as you have created one row or column you can select all these vias and duplicate a full column at once.)

For even better thermal results you can add a large pad on the bottom side. If you plan on adding a heat sink activate B.Mask for it. If not then you can disable it (The thin solder-mask film has very little influence in the ability to transfer heat to the air.)

Improvements for the thermal via footprint

In the screenshot you can see that the paste pads do not really align with the same grid as the vias. (Some vias are covered more then others. This can create problems in manufacturing as this way the process is hard to control.)

In the screenshot i show a few options of how to improve that. The green option shows the result of moving around the current paste pads such that each of them is in the center of 4 vias.

The magenta options are designed such that they avoid the vias with 0.1mm clearance. The leftmost magenta option trades paste coverage for clearance.
A better result is using camfered pads (The next two magenta outlines.). Chamfered pads need to be created from custom (polygon) pads. An alternative would be using rounded rectangle pads.
The script used for creating such footprints for the official library does that automatically.

If you choose the first solution (same sized pads but arranged differently) the resulting footprint will look similar to this:

Finishing the footprint and possible improvements

Add an outline on the fab layer (including a chamfer on the top left corner to mark pin 1.)
Add lines on the silk screen around the corners. (Leave out the line nearest to pin 1 as the pin 1 mark)
And add a courtyard outline. (0.25mm clearance to the pads is suggested by IPC for nominal density.)
For details how this can be done look at the connector molex tutorial above.

As inspiration the script generated footprint for the same part:

It might also be a good idea to use rounded rectangle pads with 0.25% round radius ratio (maximum 0.25mm radius).

As a bonus exercise you can try to follow the How to check footprint correctness? tutorial to check if you made your footprint correctly.