$EndLIBRARY
to the end of some/most/all of these files to prevent a parsing error.The stuff here was written for versions of KiCad preceding 4.0. The latest versions of KiCad have introduced new library management features, rendering some of what follows obsolete.
KiCad places footprints into footprint libraries. Footprint libraries use the .mod
extension. One .mod
file typically contains definitions for several (usually related) footprints.
KiCad uses the term “module” interchangably with “footprint”.
There are two kinds of libraries in KiCad: footprint libraries, which are stored in .mod
files, and component libraries (i.e., schematic symbol libraries), which are stored in .lib
files. Our concern here is with footprint libraries.
Individual footprints can be stored in .emp
files. Footprints in .emp
files are typically used for exporting and importing footprints between libraries; they are not typically used directly in designs.
KiCad ships with a large set of predefined footprint libraries. The locations of these footprint libraries will depend on your operating system, but they are typically installed in a system level (rather than user level) subdirectory. PCBnew and CVpcb by default let you use these system footprint libraries automatically. You can also (and often need to) supplement the system footprint libraries with third-party and user libraries.
Third-party KiCad footprint libraries are available from many sources.1) These are often provided at no cost (i.e., gratis) but may or may not have limitations on usage (i.e., they may or may not be fully libre). You should always confirm that your intended use is consistent with the creator's licensing.
To use a third-party footprint library in your project, you must first make the library available to the project.2) The procedure is as follows:
.mod
file in a location that makes sense.3).mod
file you wish to use in the project..pro
file or to select another project's .pro
file. Go with the default—the current project's .pro
file.You should now be able to access the third-party library's footprints in CVpcb and PCBnew.
In addition to distributing collections of footprints in libraries (stored in .mod
files), it is also possible to distribute individual footprints using .emp
files.4) However, to use a footprint stored in an .emp
file, it must first be imported into a library.
You should add new footprints only to user footprint libraries. See User footprint libraries and Adding existing footprints to an existing user library below.
Even though you can import footprints into system and third-party libraries, you are strongly advised against making any changes to system and third-party libraries.
This is because when you update KiCad, there is a good chance that the system libraries will be overwritten, and you will lose any changes you have made to them. Similarly, if you download an update to a third-party library, you will lose the changes you have made to that library.
While footprints contained in predefined system and third-party footprint libraries will be enough to create many designs, at some point you will probably need to create a new footprint or edit an existing one.
For creating new footprints and for making changes to footprints in system or third-party footprint libraries, it is highly recommended that you use only libraries you have created yourself—what we will call user libraries. In other words, you should create new footprints only in user libraries, and footprints in system and third-party libraries that you wish to change should first be copied to a user library and edited there.
Even though you can create/add/edit footprints in system and third-party libraries, you are strongly advised against making any changes to system and third-party libraries.
This is because when you update KiCad, there is a good chance that the system libraries will be overwritten, and you will lose any changes you have made to them. Similarly, if you download an update to a third-party library, you will lose the changes you have made to that library.
Library maintenance and the creation and editing of footprints is done with KiCad's Module Editor. To open the Module Editor:
Unless stated otherwise, the processes described below all happen in the Module Editor. The processes below do not exhaustively describe all of the functionality in the Module Editor; rather they describe what I consider to be the most important.
As far as I can tell, there is no GUI-driven way to create a new and empty library. To create a new library you must save a footprint into it.
The basics of adding a new footprint to a new library is summarized below:
{library-id}-{footprint-id}
name format because otherwise it will be difficult to determine the library from which the footprint came.The new library will not be available to your project by default. To make the new library available to your project, follow the process described in “Adding a third-party footprint library to a project” above, selecting your new library as the one to add.
First, make sure that the library to which you want to add the new footprint is available to the project. Then, the process is the same as “Creating a new footprint in a new user library” except that when it comes time to save the new footprint, you need to:
(Note: You can actually Select working library at any time before Save Module in working library.)
First, make sure both the footprint's source and destination libraries are available to the project. Then,
Alternately, you may first export the existing footprint from the source library and then import it into the target library. To add an existing footprint that is in a .emp
file to a library, you only need to import it. Importing and exporting is described below.
First, make sure that the library that contains the footprint you want to edit is available to the project. If you will be saving the edited footprint into a different library, then that must be available to your project as well. To open a footprint for editing:
Note that you are discouraged from making changes to system and third-party libraries. You should save changes to user libraries instead.
Exporting a footprint creates a file with an .emp
extension that contains a copy of the data describing a single footprint. A footprint exported this way cannot be used directly in KiCad—it must first be imported into a footprint library. However, creating footprint exports is a convenient way to distribute individual footprints and can also be used to copy and move footprints between libraries.
To export a footprint,
.emp
file.
Individual footprints described in .emp
files cannot be used directly in KiCad designs; they must first be imported into an existing footprint library.
To import a footprint, click on the import module icon in the top toolbar and navigate to the .emp
file you wish to import.
To save the imported footprint into a library, first click the Select working library icon in the top toolbar and select the library to which you want to save the imported footprint, then click the Save Module in working library icon in the top toolbar. (Note that the library must be available to the project in order to select it.)
To import a footprint:
.emp
file you wish to import.
Creating pad groups for multi-pin packages in KiCad's Module Editor is a tedious and error-prone task. Much of the tedium and potential for error can be eliminated by using Robert Fitzsimons' footprintbuilder, a GUI-based Java program that automates footprint creation. You should use KiCad's Module Editor to check that the .emp
footprint files made with footprintbuilder are as you expect and to make any needed adjustments that are not possible from within footprintbuilder.
$EndLIBRARY
to the end of some/most/all of these files to prevent a parsing error.