-
Notifications
You must be signed in to change notification settings - Fork 951
Kicad Library Convention
This version of the KLC is out of date. The KiCad library information can now be found on the official KiCad website. Refer to the new KLC here
Revision 2.0.12, September 2017
Devised by Carl Poirier, Oliver Walters
With help from members of:
kicad-lib-committers
kicad-developers
This document outlines the requirements for contributing schematic-symbols and footprints to the official KiCad library repositories. Users wishing to submit or update symbols and/or footprints should be familiar with these rules.
If a user believes there should be an exception to a certain rule when submitting a pull request, this will be a matter for discussion with the KiCad library team.
Not all of the rules listed below can apply in all circumstances, and so exceptions can be made at the discretion of the library team, if these exceptions are justified.
If the rules are uncertain on a given issue, users should try to match the convention of existing symbols and footprints when submitting a pull request.
There is a list of Frequently Asked Questions which covers library questions that are asked (frequently) when submiting symbols and footprints. It is a good idea to read through those questions before submitting for the first time.
There are a set of Python Scripts which can be used to check if a symbol/footprint meets these rules. When a Pull Request is made to the KiCad libraries, the symbols / footprints are automatically checked using these scripts. It can be helpful to run them yourself before submitting a PR, as it will help speed up the merging process.
Note: Not all of the rules are checked by these scripts, and any submissions will still require manual checking by a member of the KiCad library team.
- Writing uses C-style naming with the first letter of each word being capitalized, e.g.
Socket_Strip_Straight_2x06
- Every acronym has all of its letters capitalized
- Manufacturer name is capitalized as normal, using only standard ASCII characters e.g.
NEC
,Microchip
,Wurth
- When dimensions are used in part name, they are in millimeters, decimal places separated by a dot e.g.
C_Rect_L13mm_W4mm_P10mm
- Filename is the same as the part name
- Reference fields are prefilled with the reference designator appropriate for the part (IEEE 315-1975)
- Filenames, symbol names, footprint names and model names must contain only valid characters, as below:
- Alphanumeric characters (
A-Z
,a-z
,0-9
) - Underscore
_
- Hyphen / dash
-
- Period / dot
.
- Alphanumeric characters (
- Library files use Unix-style line endings (LF) rather than DOS-style (CR+LF)
KiCad symbol library files (.lib
file extension) contain multiple schematic symbols. Library naming should follow the order of elements given below, as far as is practical. Elements should be separated by underscore _
character. Some elements may be omitted if not required, and extra elements should be appended as required.
- Manufacturer name e.g.
Microchip
,Texas
- Category or family of parts, e.g.
Capacitors
,Spartan6
, etc. - Extra library features e.g.
CMOS
Symbol names should consist of only allowed characters as specified in KLC 1.7
. Symbol naming should follow the order of elements given below, as appropriate. Some elements may be omitted if not required, and any other elements added to the end of the list.
- Type of symbol (as required)
- May be shortened for common components e.g.
Conn_
for Connector - Reference designator may be substituted for common parts e.g.
D
,C
,LED
(IEEE 315-1975)
- May be shortened for common components e.g.
- Add the manufacturer name if it is required to differentiate from other similar parts
- Manufacturer Part Number (MPN) should be given preference, unless the symbol is generic
- Part number, including extension for specific footprint (JEDEC for common devices, e.g.
1N4001
) - Any modification to the original symbol, indicated by appending the reason e.g. different pin ordering
Q_NPN_EBC
,Q_NPN_BCE
- Indicate quantity of elements for symbols arrays e.g. resistor array with 8 elements:
Resistor_x8
Further information on symbol naming is available in the Frequently Asked Questions.
- Pin placement
- Using a
100mil
grid, pin origin must lie on grid nodes (IEC-60617) - Pins should have a length of at least
100mils
(2.54mm
) - Pin length should not be more than
300mils
(7.62mm
) - Pin length can be incremented in steps of
50mils
(1.27mm
) if required e.g. for long pin numbers - Shorter pins may be allowed for simple symbols such as resistors, capacitors, diodes, etc
- Using a
- Symbol visual style
- Origin is placed in the middle of symbol
- Symbol body has a line width of
10mils
(0.254mm
) - Fill style of symbol body is set to
Fill background
- IEC-style symbols are used whenever possible
- Pin stacking. Placing pins in the same position results in the circuits being connected. Pins may be placed in the same location under certain circumstances:
- Pins must not be of type
No Connect
- Pins are logically connected in the symbol
- Pins must have the same name
- Pins must have the same electrical type
- Only one pin must be visible (all others set to invisible)
- Stacks of type
Output
,Power Output
andPower Input
are special cases. One visible pin must have the correct type, and all other pins in the stack must be passive and invisible.
- Pins must not be of type
- Pins should be grouped logically, rather than physically
- Pin location should not necessarily follow footprint pinout
- Pins with similar functions should be placed together, e.g.
SPI_MISO, SPI_MOSI, SPI_SCK, SPI_CS
andUART_TX, UART_RX
- Ports should be ordered from top to bottom, unless this conflicts with the above requirements
- Whenever possible, pins should be arranged by function:
-
Positive Power pins should be placed at top of the symbol, e.g.
Vcc, Vdd, Vin, V+, etc
-
Negative Power and Ground pins should be placed at the bottom of the symbol, e.g.
GND, Vss, V-, etc
-
Input/Control/Logic pins should be placed on the left of the symbol, e.g.
opamp +/-, NPN base, SPI pins on an DAC, transformer primary, UART Tx/Rx pins, etc.
-
Output/Controlled/Driver pins should be placed on the right of the symbol, e.g.
opamp output, DAC output, transformer secondary, RS232 Tx/Rx, etc.
-
Positive Power pins should be placed at top of the symbol, e.g.
- Pin
Electrical type
should be set to match the appropriate pin function - Hidden connection pins are not allowed for schematic symbols
- All symbol connection points must be visible
- No hidden power pins (e.g. for logic gates)
- As an exception, unused pins should be named
NC
, electrical typeNot Connected
and should beInvisible
- All text fields use a common size of
50mils
(1.27mm
)- Value field
- Reference field
- Footprint field
- Datasheet field
- Pin names and numbers
- Default symbol fields contain the correct information
- The Reference field contains the appropriate Reference Designator (RefDes) and is visible.
- For power-flag symbols (e.g.
+5V
,GND
) the RefDes must always be#PWR
(with leading#
character) - For graphical symbols (no pins or footprint) the RefDes must be set to
#SYM
and must be invisible.
- For power-flag symbols (e.g.
- The Value field contains the name of the symbol and is visible. (Exception: For power and graphical symbols, the value field must be invisible)
- The Footprint field is filled according to rule
4.12
(below) and is invisible - The Datasheet field is left blank and is invisible
- The symbol contains no other custom fields
- The Reference field contains the appropriate Reference Designator (RefDes) and is visible.
- Part meta-data is filled in as appropriate. This meta-data is stored in the
<libname>.dcm
file, and must be filled in for each symbol and each of the symbol's aliases-
Description field contains comma-separated device information
- For symbols with a default footprint, the human-readable footprint name should be appended to the description e.g.
SOIC-8
- For symbols with a default footprint, the human-readable footprint name should be appended to the description e.g.
- Part name should not be included in the Description field
- For parts with different symbols associated with different footprints, shortform footprint name should be specified in the description field (e.g.
DIP8
) - Keywords field contains space-separated keyword values
-
Documentation field contains URL to part documentation if applicable, or is left blank
-
Description field contains comma-separated device information
- Footprint association
- The footprint field should be set to invisible
- For components with a single default footprint, the Footprint field is filled with a valid entry of the format
Footprint_Library:Footprint_Name
- For components with multiple possible footprints, the Footprint field should be left blank
- Footprint filters should be added as appropriate to match all possible footprints (see
KLC 4.13
below) - Filters should be used even if a default footprint is given
- The footprint field should be empty for power and graphical symbols
- Footprint filters should match all appropriate footprints
- Filters use
*
wildcards to match multiple footprints e.g.TO*220*
matchesTO220
,TO-220_Reverse
,TO-220-5
- Filters should end with a
*
wildcard to allow matching of modified packages e.g._HandSoldering
- Filters should not match the pin count - this is performed by KiCad's internal footprint association
- Filters should match dimension information (where required) to be as specific as possible, e.g.
- Filters use
- Power-Flag Symbols
- Graphical Symbols
Example Images:
Each footprint library is a directory with the .pretty
extension. Footprint libraries contain multiple footprint files with the .kicad_mod
extension.
-
Footprint library organisation:
- Footprints are organised firstly by package type or function e.g.
QFN
orPotentiometers
- Larger libraries may be further divided by sub-type e.g.
Resistors_SMD
orResistors_THT
- Manufacturer specific libraries are named
Type_Manufacturer
e.g.Connectors_JST
- Footprints are organised firstly by package type or function e.g.
-
Footprint library naming
- Library name elements should be separated by underscore
_
character - Library name elements should follow the ordering below (elements can be added or omitted as appropriate)
- Library type e.g.
Resistors
,Capacitors
,Connectors
(should be in plural form) - Package type e.g.
SOIC
,SMD
,THT
,QFN
, etc - Manufacturer
- Extra library features
- Library type e.g.
- Library name elements should be separated by underscore
Note: Not all naming elements above will be necessarily used, and extra naming elements may be required. Some examples of library names are below:
LEDs.pretty
Connectors_Hirose.pretty
Housings_SSOP.pretty
Each footprint is specified in a .kicad_mod
file within the .pretty
directory. Footprint naming should follow the order of elements given below, as far as is practical. Elements should be separated by underscore _
character. Some elements may be omitted if not required, and extra elements may be appended as required.
- Specific package type first, not separated by anything e.g
TSSOP
,C
- Package name and number of pins are separated using a hyphen. e.g.
SOT-89
,SOT-23-5
. Variation from standard package is included here e.g. Exposed pad under package:QFP-48-1EP
- Package dimensions specified as
width
xheight
e.g.3.5x2.0mm
- Pitch specified in
mm
e.g.Pitch1.27mm
- Orientation e.g.
Horizontal
,Angled
, etc - Any modification to the original footprint, indicated by appending the reason:
- e.g. Longer pads used to facilitate hand soldering of a QFN component:
QFN-52_HandSoldering
- e.g. Thermal pad designated with
ThermalPad
- e.g. Longer pads used to facilitate hand soldering of a QFN component:
Note: Manufacturer specific footprints that deviate from the above naming convention should be named as follows: Manufacturer_FootprintName
e.g. Texas_S-PVQFN-N48
- Follows datasheet recommendation unless intentional variation, for example longer pads for hand soldering
- Pin-1 should be placed at the top-left. Where this is impractical, it should be placed closest to the top (IPC-7351)
- Silkscreen Layer (IPC-7351C)
- Reference Designator is supplied on
F.SilkS
layer- Text size =
1.00mm
- Text thickness =
0.15mm
- Must be fully visible after component placement
- Text size =
- Silkscreen clearance
- Silkscreen must not be placed over pads or areas of exposed copper
- Silkscreen-pad clearance must be at least
0.2mm
or greater than the pad-mask-expansion (whichever is greater)
- For SMD components, silkscreen is completely visible after board assembly (must not be under component)
- For THT components, silkscreen outline must be visible after board assembly. Silkscreen may be added under component to aid in assembly
- Silkscreen line width is
0.12mm
(0.1mm
is allowed for high density,0.15mm
for low density) - IPC-7351C - Pin-1 designator is provided on Silkscreen layer where appropriate
- Pin-1 designator must always be visible after board assembly
- Pin-1 designator should follow IPC-7351C where possible
- Reference Designator is supplied on
- Fabrication Layer
- Component value (footprint name) should be provided on
F.Fab
layer- Text size =
1.00mm
- Text thickness =
0.15mm
- Text size =
- Component outline should be provided on the appropriate
F.Fab
layer- Outline uses line width of between
0.10mm
and0.15mm
(recommended0.10mm
) - Outline should be simplified for complex shapes
- Pin-1 designation is provided on
F.Fab
layer where appropriate
- Outline uses line width of between
- Reference Designator should also be provided on
F.Fab
layer- Centered on component (inside component outline)
- Size of text matched to component size (should fit inside component outline)
- Recommended text size =
1.00mm
- Allowable text size =
0.1mm
to2.00mm
- Allowable text thickness =
0.01mm
to0.20mm
(should be approximately15%
of text size, with allowances for variation for aesthetic reasons) - To get second instance of RefDes, add text labeled
"%R"
- Rotation of second RefDes should be aligned with the major axis of the component outline
- Component value (footprint name) should be provided on
- Courtyard Layer (IPC-7251, IPC-7351C)
- Footprint courtyard is provided on the
F.CrtYd
layer - Courtyard uses
0.05mm
line width - Courtyard lines are placed on a grid of
0.01mm
- Clearance is measured from exterior of pads and package outline
- Default courtyard clearance is
0.25mm
- Components smaller than 0603 should have a clearance of
0.15mm
- Connectors, canned capacitors, crystals, should have a clearance of
0.5mm
- BGA footprints should have a clearance of
1.0mm
- Default courtyard clearance is
- Footprint courtyard is provided on the
- Footprints should not be duplicated to match a different pin ordering. This is to be handled in the symbol libraries.
- Footprints that contain multiple pads or other conductive elements that are physically connected require special attention:
- Multiple pads that are physically connected must share the same number
- Thermal vias (if present) must share the same number as the thermal pad
- If thermal vias are used, a copper pad on the
B.Cu
(bottom copper) layer should be added. This pad must be at least large enough to fully surround all thermal pads with a margin of>= 0.5mm
. Note: If the footprint datasheet gives a conflicting suggestion here, the datasheet should be given preference
- Multiple pads that are physically connected must share the same number
- Keepout Areas - until KiCad has a native method to define keepout areas within a footprint, keepouts should be defined as follows:
The following rules apply specifically to SMD footprints (the general rules in section 7 also apply).
- Footprint Placement type should be set to
Surface mount
- Footprint anchor should be placed in the middle of the footprint (IPC-7351). Generally this is the centroid calculated with respect to the device lead ends.
- If the datasheet specifies an origin for Pick-and-Place, this should be used in preference.
- Pad construction for SMT pads has two options:
- Normal pads for device pin/lead connections should use the following layers:
- Front Copper (
F.Cu
) - Front Mask (
F.Mask
) - Front Paste (
F.Paste
)
- Front Copper (
- Pads which require specific stencil opening shape and aperture design (e.g. thermal pads)
- Construct copper shape with pad(s) which use only
F.Cu
andF.Mask
layers - Add required stencil opening(s) with pad(s) which only use
F.Paste
layer, and do not have a pad number
- Construct copper shape with pad(s) which use only
- Normal pads for device pin/lead connections should use the following layers:
Note: The layer requirements for surface mount pads often require adjustment based on paste/stencil requirements. The manufacturer datasheet should be followed in preference to these layer suggestions if there is a conflict.
The following rules apply specifically to THT footprints (the general rules in section 7 also apply).
- Footprint Placement type should be set to
Through hole
- Footprint anchor should be set on Pin-1
- Pin-1 should be set to rectangular, and other pads circular/oval. Exception: Non-polarised parts (e.g. THT resistors) do not require rectangle for Pin-1
- Pad layer settings:
- All copper layers
- Front Mask (
F.Mask
) - Back Mask (
B.Mask
)
- Minimum drilled hole diameter is the maximum lead diameter plus
0.20mm
(IPC-2222 Class 2) - Minimum annular ring width should be at least
0.15mm
(IPC-2221)
- Footprint name must match its filename. (.kicad_mod files)
- Footprint meta-data should be filled in as appropriate
- Documentation field contains comma-separated device information. Where appropriate, URL to footprint datasheet should be included
- Keywords field contains space-separated keyword values
- Other properties should be left to default values, unless required for a specific reason e.g. datasheet specification
- Move and Place: Free
- Auto Place: 0 and 0
- Local Clearance Values: 0
- 3D Shape files should be named the same as their footprint and are placed in a folder named the same as the footprint library replacing the
.pretty
with.3dshapes
- Only WRL files are allowed (.wrl)
- PATH prefix
${KISYS3DMOD}/
is recommended - Variations of the same footprint can refer to the same 3D model (e.g.
R_0805_HandSoldering
should use the same 3D model asR_0805
) - 3D model references should be added even if the model does not yet exist (this helps with library maintenance)
- 3D models should be scaled
1:1:1
Changelog
Revision 2.0.12 - 7 September 2017
- Fixed typo in 3.3
- Added clarity to 7.3
Revision 2.0.11 - 6 September 2017
- Added extra information to 7.7 re: thermal vias
- Added extra information to 8.3 re: required layers for stencil design
Revision 2.0.10 - 4 August 2017
- Reduced minimum text size requirement for F.Fab RefDes
Revision 2.0.9 - 31 July 2017
- Added section about keepout zones
Revision 2.0.8 - 24 July 2017
- Added extra information for Silkscreen clearance
- Removed redundant rule information (3.3 / 3.7)
- Fixed formatting issues for 1.8
Revision 2.0.7 - 9 July 2017
- Added rule for Unix-style line endings
Revision 2.0.6 - 30 June 2017
- Added exception description for solderpaste / stencil requirements
Revision 2.0.5 - 28 June 2017
- Improved wording for RefDes text size requirement
Revision 2.0.4 - 22 June 2017
- Updated symbol naming information
Revision 2.0.3 5 June 2017
- Added rules for power-flag symbols
Revision 2.0.2 4 June 2017
- Added extra rule for pin-stacking
Revision 2.0.1, 23 May 2017
- Specified only WRL 3D models allowed
Revision 2.0, April 2017
- Major rearranging / improvement of KLC
- Added introductory text and link to kicad-library-utils
- Separated rules for THT and SMD footprints
- Added rules for Footprint Filters
- Added examples for many rules
- Improved readability for rules, added bullet-points
- Added example images for some rules
Revision 1.1, October 1st 2016
- Specified IPC-7351C dimensions for silkscreen, courtyard and reference designator
Revision 1.0, November 15th 2015
- Fixed some repetition
- Added rule 3.8 from the checklib scripts
- Tagged as 1.0 for the KiCad 4.0.0 release
Revision 0.11, April 6th 2015
- Updated rule 1.4 about dimensions. Units in millimeters are now implicit
Revision 0.10, March 1st 2015
- Moved the footprint value property to the fabrication layer
- Pin length is enforced only for black-box symbols
- Some reorganization has been done
Revision 0.9, February 14th 2015
- Added section and rules about footprint properties
- Specified the path to 3d models
- Moved the reference fields rule to the general section
Revision 0.8, January 19th 2015
- More thorough rule about courtyard has been split over 6.6 and 6.7
Revision 0.7, September 18th 2014
- Added rule 6.6 for courtyard
Revision 0.6, September 14th 2014
- Specified in 6.8 that value and reference designators must be placed on silkscreen
Revision 0.5, August 6th 2014
- Specified in 6.5 that only the outline must be completely visible after assembly
- Rule 3.8 moved from section 1 since it pertains only to symbols
Revision 0.4, July 30th 2014
- Completion of convention for symbols
- Rule 6.7 moved from section 1 since it pertains only to footprints
Revision 0.3, June 8th 2014
- Specified that pin ordering duplicates are to be handled in symbol libraries
- Specified the rules for footprint silkscreen
Revision 0.2, May 19th 2014
- Minor clarifications to few items
- Exposed pad is now considered as a variation of a package, thus separated by hyphen instead of plus sign
- Added 2-level numbering
Revision 0.1, May 8th 2014
- Initial Commit
These Wiki pages can be edited directly only by the KiCad Library owners and maintainers.
If you are not a member and want to add or edit something please clone Wiki pages to your Git repository and prepare merge request. Your request will be reviewed and included as soon as possible.