Skip to the content
2 layers14 × 9 mmWarning project, the printed circuit board in 3D

A bunch of scripts to automate KiCad processes

Size
14 × 9 mm
Copper layers
2
Thickness
1.6 mm
Parts
3
Nets
4
Pads
6
Tracks, vias
3, 0
Pours
1
Routed
Yes
KiCad
KiCad 5 (file 20171130)
Created
28 Mar 2018
Updated
22 Apr 2022

Overview

Warning project is an open-source printed circuit board by productize, from the productize/kicad-automation-scripts repository on GitHub, published under the Apache-2.0 licence. It is a 2-layer board of 14 × 9 mm with 3 parts on 4 nets, routed with 3 tracks and 0 vias.

Its parts include 1 resistor, 1 diode and 1 connector.

README

README.md

KiCad automation scripts

A bunch of scripts to automate KiCad processes using a combination of the PCBNew Python library and UI automation with xdotool.

This work is based in big parts on Scott Bezek's scripts in his split-flap display project. For more info see his excellent blog posts.

Currently tested and working:

  • Exporting schematics to PDF and SVG
  • Exporting layouts to PDF and SVG
  • Running ERC on schematics
  • Running DRC on layouts

Versions

This repository has a branch per supported major KiCad version, prefixed with kicad-. Note that installation instructions and supported features can be different per version.

The master branch and latest Docker tag will always be the latest supported stable KiCad version.

Installation

Using Docker

Build and run the docker image:

text
docker build -t kicad-automation-scripts .
docker run --rm -it -v <path to a kicad project>:/kicad-project kicad-automation-scripts

Or fetch it from Dockerhub:

text
docker run --rm -it -v <path to a kicad project>:/kicad-project productize/kicad-automation-scripts

Installation on your own machine:

If you want to use these scripts directly on your system, you should be able to get it to work by installing the folowing dependencies:

This tool has the following dependencies:

  • KiCad
  • python
  • python-pip
  • xvfb
  • recordmydesktop
  • xdotool
  • xclip

The Python dependencies (excluding KiCad) are listed in [eeschema/requirements.txt][eeschema/requirements.txt] and can be installed with

text
pip install -r eeschema/requirements.txt

Installation on Ubuntu/Debian:

text
sudo apt-get install -y kicad python python-pip xvfb recordmydesktop xdotool xclip

Usage

In the Docker image or on a system with all required dependencies installed you can use the following commands:

Run schematic ERC:

text
python -m kicad-automation.eeschema.schematic run_erc /kicad-project/<some-schematic>.sch <build_dir>

Add the flag --warnings_as_errors to make all warnings also return an error code of 1.

Export a schematic to PDF or SVG

text
python -m kicad-automation.eeschema.schematic export /kicad-project/<some-schematic>.sch <build_dir> <svg or pdf> <all-pages (True or False)>

Run layout DRC:

text
python -m kicad-automation.pcbnew_automation.run_drc /kicad-project/<some-layout>.kicad_pcb <build_dir>

Generate a zip file with gerber files for PCB manufacuring:

text
python -m kicad-automation.pcbnew_automation.plot /kicad-project/<some-layout>.kicad_pcb <plot_dir> [<layers to plot>]

Generate a pdf with the layout layers and drill map file:

text
python -m kicad-automation.pcbnew_automation.plot -f pdf /kicad-project/<some-layout>.kicad_pcb <plot_dir> [<layers to plot>]

Hacking

If you want to test the scripts in this repository and run them inside a docker image, the base image can be used. This base image contains all the required dependencies and the required environment for the script to work.

To build and run the base image:

text
docker build -f Dockerfile-base -t kicad-automation-base .
docker run --rm -it -v <path to a kicad project>/kicad-project  -v `pwd`/src:/usr/lib/python2.7/dist-packages/kicad-automation kicad-automation-base

Or fetch it from Dockerhub:

text
docker run --rm -it -v <path to a kicad project>:/kicad-project -v `pwd`/src:/usr/lib/python2.7/dist-packages/kicad-automation productize/kicad-automation-base

The scripts can now be used the same way as in the main image, but changes on the host will automatically be reflected on the container (though note that Python does not autoreload libraries).

Parts

3
QtyValueFootprintReferences
1330Resistor_SMD:R_0603_1608MetricR1
1Conn_01x02Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_VerticalJ1
1LEDLED_SMD:LED_0805_2012MetricD1

More from productize/kicad-automation-scripts

1
  • 2 layers14 × 9 mmGood project, the printed circuit board in 3D

    Good project

    productize/kicad-automation-scripts

    A bunch of scripts to automate KiCad processes

    2 parts96Apache-2.0

Similar boards

  • 2 layers40 × 30 mmBlinky, the printed circuit board in 3D

    Blinky

    earthtojake/text-to-cad

    Design physical products with AI

    3 parts26kMIT
  • 2 layers51.9 × 16 mmPassive2-rpi non standard adapter, the printed circuit board in 3D

    Passive2-rpi non standard adapter

    hzeller/rpi-rgb-led-matrix

    Controlling up to three chains of 64x64, 32x32, 16x32 or similar RGB LED displays using Raspberry Pi GPIO

    3 parts4.4kGPL-2.0
  • 2 layers16.3 × 16.3 mmSensor, the printed circuit board in 3D

    Sensor

    scottbez1/splitflap

    DIY split-flap display

    3 parts4.2k
  • 2 layersSub, the printed circuit board in 3D

    Sub

    atopile/atopile

    Design circuit boards with code! ✨ Get software-like design reuse 🚀, validation, version control and collaboration in hardware; starting with electronics ⚡️

    3 parts4kMIT
  • 2 layers85 × 30 mmDual stomp, the printed circuit board in 3D

    Dual stomp

    torvalds/GuitarPedal

    Linus learns analog circuits

    3 parts2.5kGPL-2.0
  • 2 layers124.5 × 33.7 mm172319-1 connector, the printed circuit board in 3D

    172319-1 connector

    rusefi/rusefi

    rusefi - GPL internal combustion engine control unit

    3 parts1.2k
  • 2 layers10.5 × 83 mmProgrammingAdapter, the printed circuit board in 3D

    ProgrammingAdapter

    stuartpittaway/diyBMSv4

    Version 4 of the diyBMS

    3 parts1.1k
  • 2 layers21.2 × 51.3 mmPico reset, the printed circuit board in 3D

    Pico reset

    hackclub/sprig

    🍃 Learn to code by making games in a JavaScript web-based game editor.

    3 parts1.1kMIT

Questions

How big is the Warning project PCB?

It measures 14 × 9 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Warning project use?

3 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 Warning project KiCad files?

From the productize/kicad-automation-scripts repository on GitHub, at the commit this page was made from: the board is test-projects/warning-project/warning-project.kicad_pcb. PCBKit opens the board in the browser, with nothing to install.

Can I use the Warning project design in my own project?

Its repository publishes it under the Apache-2.0 licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).