Skip to the content
2 layersClearance example, the printed circuit board in 3D

Clearance example

upb-lea/KiClearance17

Generate clearance rules for KiCAD by a human-readable easy-to-use table.

Copper layers
2
Thickness
1.6 mm
Parts
6
Nets
7
Pads
14
Tracks, vias
28, 0
Pours
1
Routed
Yes
KiCad
KiCad 9.0 (file 20241229)
Created
18 May 2024
Updated
4 Nov 2026

Overview

Clearance example is an open-source printed circuit board by upb-lea, from the upb-lea/KiClearance repository on GitHub. It is a 2-layer board with 6 parts on 7 nets, routed with 28 tracks and 0 vias.

Its parts include 3 connectors, 1 resistor, 1 IC and 1 diode.

README

README.rst

.. sectnum::

Welcome to KiClearance

This Python program converts a given table of voltage distances into KiCad design rules.

.. image:: docs/source/figures/overview.png

Installation

Install KiClearance directly from pyPI:

::

text
pip install kiclearance

Usage

Define net classes in your KiCad project

text
Add the net classes to each connection in the circuit diagram.

.. image:: docs/source/figures/net_class_directive_labels.png

Add the same net classes in the net classes of the PCB editor:
``KiCad PCB Editor``: ``File`` -> ``Board Setup`` -> ``Design Rules`` -> ``Net classes``

.. image:: docs/source/figures/board_setup.png

Run KiClearance to initially generate the clearance table

Navigate to the project folder with the KiCad project. Open a terminal and execute :

::

text
python -m kiclearance

Now a file clearance.ods is generated, which contains the human-readable clearance table. As of now, the table has been generated using fantasy values.

Adapt the table 'clearance.ods/xls/csv' containing clearance distances

text
Update the table (clearance.ods/xls/csv) in your KiCad project directory with voltage clearances defined by your requirements (e.g. standards).

The table contains the distances from a potential to another in ``mm``. The same net distance is optional.

.. image:: docs/source/figures/table.png

Run KiClearance again, to generate the final set of rules for KiCad
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Navigate to the project folder with the KiCad project and the clearance.ods/.xls/.csv file. Open a terminal and execute :

::

    python -m kiclearance

Now a file ``yourprojectname.kicad_dru`` is generated, which contains the rule sets.

Open your KiCad project, the rule sets are now stored and you can start the routing.

As the inner layers are exposed to less dirt and no air, the distance in the inner layers can be set as optional with a scaling factor (defaults to 1).
If this factor is to be set differently, this can be set with the following command (in the example: inner distance to 75% of outer distance):

::

Parts

6
QtyValueFootprintReferences
3Conn_01x02_PinConnector_PinHeader_1.27mm:PinHeader_1x02_P1.27mm_HorizontalJ1, J2, J3
1LEDLED_SMD:LED_0603_1608MetricD1
1NSL-32OptoDevice:Luna_NSL-32U2
1RResistor_SMD:R_0603_1608MetricR1

Similar boards

  • 2 layers18.5 × 11.1 mmSwitch, the printed circuit board in 3D

    Switch

    byrantech/laptop

    anyon_e, a highly integrated, high end, open source laptop. Attempt the impossible.

    6 parts4.3kMIT
  • 2 layers14.6 × 33 mmBrain board SD Card 1, the printed circuit board in 3D

    Brain board SD Card 1

    rusefi/rusefi

    rusefi - GPL internal combustion engine control unit

    6 parts1.2k
  • 2 layers9 × 9 mmDpoint, the printed circuit board in 3D

    Dpoint

    Jcparkyn/dpoint

    Open-source digital stylus using camera tracking and inertial measurements

    6 parts1.1kMIT
  • 2 layers51.5 × 16.6 mmMicroswitchXY Endstop, the printed circuit board in 3D

    MicroswitchXY Endstop

    VoronDesign/Voron-Hardware

    Cool Hardware designed by the Voron Design group

    6 parts1.1kGPL-3.0
  • 2 layers21.9 × 76.7 mmAmiga External, the printed circuit board in 3D

    Amiga External

    hoglet67/RGBtoHDMI

    Bare-metal Raspberry Pi project that provides pixel-perfect sampling of Retro Computer RGB/YUV video and conversion to HDMI

    6 parts1kGPL-3.0
  • 2 layers88.9 × 50.8 mmBusinesscard, the printed circuit board in 3D

    Businesscard

    hackclub/OnBoard

    💡 Join 1,000 teenagers and make your first PCB with a $100 grant!

    6 parts915
  • 2 layers20.3 × 15.2 mmL0 RGB led, the printed circuit board in 3D

    L0 RGB led

    Luos-io/luos_engine

    Open-source and real-time orchestrator for cyber-physical-systems, to easily design, test and deploy embedded applications and digital twins.

    6 parts546MIT
  • 2 layers9 × 3.6 mmOpticalEncoder, the printed circuit board in 3D

    OpticalEncoder

    adamb314/ServoProject

    Getting the most out of your hobby servo

    6 parts545

Questions

What parts does the Clearance example use?

6 parts. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Clearance example KiCad files?

From the upb-lea/KiClearance repository on GitHub, at the commit this page was made from: the board is examples/clearance_example.kicad_pcb and its schematic examples/clearance_example.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Clearance example design in my own project?

Its repository states no licence, so its author keeps all rights: ask upb-lea before reusing the design.