KiCad Symbols and Footprints: Creating a Custom Footprint From a Datasheet
Sooner or later you will use a part that is not in the KiCad libraries: a sensor module, an unusual connector, or a relay with an odd pin layout. You will then need to create its symbol, its footprint, or both. Getting this right is critical, because a footprint error is baked into copper and cannot be fixed with a firmware update.
This article explains how symbols and footprints relate, sets up a personal library, and walks through building a through-hole footprint for a 4-pin 6 mm tactile switch from its mechanical drawing.
Symbols vs Footprints
| Item | Lives in | Describes | Key data |
|---|---|---|---|
| Symbol | Schematic, .kicad_sym library | Electrical function | Pin names, pin numbers, electrical type |
| Footprint | PCB, .pretty folder of .kicad_mod files | Physical land pattern | Pad numbers, size, position, drill, layers |
The only link between the two is the number. Symbol pin 1 connects to footprint pad 1, pin 2 to pad 2, and so on. Pin names such as VCC or SDA are for humans. If a symbol uses pin number 3 for VCC but the footprint's VCC pad is numbered 4, KiCad will happily route the wrong signal. When you pair a symbol with a footprint, always compare the numbering against the datasheet.
Setting Up a Personal Library
- Open the Footprint Editor from the project manager.
- Choose File > New Library, select Project if the footprint belongs to one design or Global if you want it everywhere, and name it, for example
my_footprints. KiCad creates amy_footprints.prettyfolder. - Do the same in the Symbol Editor for symbols; KiCad creates a
.kicad_symfile. - Keep personal libraries in your project folder or in a backed-up location, never inside the KiCad installation directory, which is replaced on upgrade.
Reading the Mechanical Drawing
The common 6 mm through-hole tactile switch has four legs arranged in a rectangle. Pins on the same side are internally connected in pairs, so electrically it is a two-terminal switch with two pins per terminal. A typical drawing gives the following land pattern; always confirm against the drawing for the exact switch you will buy.
Top view, pads drilled on a rectangle:
1 o-------------o 2
| | horizontal pitch: 6.5 mm
| 6 x 6 mm | vertical pitch: 4.5 mm
| body | recommended hole: about 1.0 mm
3 o-------------o 4
Pins 1-2 internally joined, pins 3-4 internally joined (check datasheet)Note what the drawing gives you: pin positions relative to each other, hole diameter, body outline and orientation. If the drawing gives a hole size only for the lead, add clearance. A common rule is lead diameter plus about 0.2 to 0.3 mm for the finished hole, and pad diameter at least hole plus twice your fab's minimum annular ring.
Building the Footprint Step by Step
- In the Footprint Editor, select your library and choose File > New Footprint. Name it
SW_Tactile_6x6_THT. - Set the grid to 0.25 mm or 0.5 mm via the grid drop-down, and keep the footprint origin at the centre of the part. Centre origins make pick-and-place data and rotation predictable.
- Use Place > Add Pad. Open pad properties with E: type Through-hole, shape circular or oval, size 1.8 mm, hole 1.0 mm, number 1. Position it at X -3.25 mm, Y -2.25 mm.
- Add pads 2, 3 and 4 at (+3.25, -2.25), (-3.25, +2.25) and (+3.25, +2.25). Make pad 1 rectangular so the orientation is visible on the bare board.
- On
F.Fab, draw the 6 x 6 mm body outline. This layer documents the real body for assembly drawings. - On
F.Silkscreen, draw an outline slightly outside the body, keeping it clear of the pads. - On
F.Courtyard, draw a rectangle enclosing body and pads with about 0.25 mm margin. DRC uses courtyards to detect overlapping parts. - Open Footprint Properties and set the reference field on silkscreen and the value field on F.Fab. Optionally link a 3D model.
- Save, then run Inspect > Footprint Checker to catch overlapping pads or missing courtyards.
| Layer | What goes there |
|---|---|
| F.Cu / B.Cu | Copper pads (through-hole pads appear on both) |
| F.Mask / B.Mask | Mask openings, generated automatically from pads |
| F.Paste | Stencil openings, used for SMD pads only |
| F.Silkscreen | Visible outline and pin 1 marker |
| F.Fab | True body outline and value text for documentation |
| F.Courtyard | Keep-out boundary used by DRC |
Verifying Before You Trust It
- Print the board at 1:1 scale on paper (File > Print in the PCB Editor, scale 1) and press the real part through the paper at the pad locations.
- Measure pad pitch with the Measure tool (Ctrl+Shift+M) and compare to the drawing.
- Check that pad numbers match the symbol pin numbers, especially for parts where the drawing is a bottom view.
- Confirm the footprint shows correctly in the 3D Viewer if you attached a model.
- For SMD parts, confirm paste layer openings exist; without them the stencil will have no hole.
Summary
Symbols carry electrical meaning and footprints carry physical geometry, joined only by pin numbers. A good custom footprint starts from the datasheet drawing, uses a centred origin, correct pad and drill sizes, a clear pin 1 marker, and proper fab and courtyard layers. Verify every new footprint with a paper print or the real part before ordering boards, and store it in a personal library so you never have to draw it twice.