Mt1-pcb is an open-source printed circuit board by yupipi93, from the yupipi93/eda-pcb-designer repository on GitHub, published under the MIT licence. It is a 2-layer board of 100 × 30 mm with 25 parts on 29 nets, routed with 86 tracks and 7 vias.
Its parts include 5 ICs, 4 connectors, 2 resistors, 1 capacitor and 1 switch.
README
README.md
eda-pcb-designer
One YAML file in → a fabricable PCB out.
A deterministic, headless KiCad-9 PCB design pipeline — spec → schematic →
placement → autorouting → DRC → physical verification → JLCPCB-ready gerbers —
packaged as an installable Python toolkit (pcb-designer), with no GUI and no
LLM in the loop.
Lemon Piano v0.6.0 — pipeline output. Placement, routing, DRC, render and
dimension annotations all generated from one YAML file; the Arduino Nano photo
is composited pin-over-pad by the overlay stage. Designed end-to-end through
the hosted API.
The pipeline
mermaid
flowchart LR
Y[/"board.yaml<br/>(single source of truth)"/] --> S
S["schematic<br/>kicad-sch-api"] --> P["place<br/>real layer flips + DRC"]
P --> R["route<br/>freerouting + GND zone"]
R --> D["render<br/>DIM · realistic · overlay"]
D --> V{"verify<br/>anti-mirror gate"}
V -->|pass| F["fab<br/>gerbers · BOM · pos · zip"]
V -->|fail| X["⛔ no fab outputs"]
Every stage is headless, idempotent and scriptable; errors fail fast with
actionable messages. The pipeline calls no LLM API — it is a plain,
reproducible Python + KiCad + freerouting toolchain — but it was built to be
driven safely by an AI coding agent (Claude, GPT, Gemini, …) as well as by
humans: the agent edits the YAML and drives the CLI, and it cannot reach fab
without passing DRC plus a physical-verification gate. See
AGENTS.md for the agent operating protocol.
[!TIP]
🌐 Live hosted API — https://pcb-designer.scv.multitecua.com — no install
needed. Upload a .kicad_pcb, get back an autorouted board, a DRC report,
raytraced renders or a JLCPCB-ready fab zip:
One board, four render styles — all from the same .kicad_pcb, all generated
by the render stage:
bare
dim
realistic
overlay
Iterations are versioned, so a board's history reads like a filmstrip:
And it ships real hardware. The MT1 rocket flight computer went through
5 fabricated releases at JLCPCB — designed entirely by this pipeline inside
the multi-rocket-avionica
project, and vendored here as the worked example (projects/mt1/):
Pipeline render
The fabricated board
MT1 v0.1.4 — overlay render with real breakout photos
The same design, fabricated at JLCPCB and populated
Why
Iterating a PCB by hand in a GUI is slow and unreproducible; letting a generative
model emit .kicad_pcb S-expressions directly is dangerous. This toolkit takes a
third path:
One YAML per board captures everything a layout iteration needs (outline,
placements, pin counts, net numbers, trace widths) — reviewable in a diff.
The engine does the mechanical work deterministically: footprint placement
with genuine layer flips, freerouting-based autorouting, GND zone + stitching,
DRC, versioned renders, gerber/BOM/pos exports.
Idempotency is law: any stage can be re-run and converges to the same board.
KiCad 9 (kicad-cli); component bodies need kicad-packages3d (or --fetch-models)
fab
KiCad 9 (kicad-cli)
KiCad 9 install options are documented in docs/SETUP.md
(AppImage without root, or ppa:kicad/kicad-9.0-releases). The freerouting JAR
is not committed — fetch it once, checksum-verified:
pcb-designer validate --config examples/mt1.yaml
# → OK: MT1 Flight Computer Board (v0.1.4) — 19 placements, 16 through-hole, 100×30 mm board
pcb-designer pipeline --config examples/mt1.yaml --stages place,route,render
# place → placement + layer flips + GND zone + DRC + renders# route → freerouting autoroute + zone fill + stitches (needs Java 21 + JAR)# render → PCB-editor-style DIM PNGs (needs kicad-cli + pdftocairo)# export3d → GLB + STEP you can rotate (see "Look at the board in 3D" below)
pcb-designer fab --config examples/mt1.yaml --version v0.1.4# → projects/mt1/releases/v0.1.4/…zip (9 gerbers + 2 drill + BOM + pos, JLCPCB-ready)
2 · Start your own board
bash
pcb-designer init my-board --template minimal --vendor MyOrg
# → projects/my-board/{kicad,tools,renders,validation,releases}/# → projects/my-board/my-board.yaml (the board's single source of truth)
Then: create the KiCad project in projects/my-board/kicad/, fill in the YAML
(schema: docs/CONFIG_REFERENCE.md, placement
method: docs/PLACEMENT_GUIDE.md), and add the
board's orchestrator scripts under projects/my-board/tools/ — thin wrappers
that bind your board's constants and delegate to the pcb_designer package
(projects/mt1/tools/ is the reference implementation).
3 · HTTP API (hosted — best for agents in the cloud)
The stateless HTTP API exposes the engine operations over uploaded board
files — no project checkout, no local KiCad. No uploaded code is ever
executed; the server only performs KiCad file surgery and returns the
artefact.
bash
URL=https://pcb-designer.scv.multitecua.com
# Freerouting-as-a-service: autoroute any .kicad_pcb
curl -F pcb=@board.kicad_pcb "$URL/route" -o routed.kicad_pcb
# DRC report / raytraced renders / JLCPCB-ready fab zip
curl -F pcb=@board.kicad_pcb "$URL/drc" | jq .by_severity
curl -F pcb=@board.kicad_pcb "$URL/render?side=both" -o renders.zip
# render styles: bare | realistic | realistic-dim | dim | overlay# (overlay: client sends module photos: -F modules=@modules.yaml -F images=@nano.png)# Rotatable 3D model (?format=glb|step|both) — the service ships the 3D model# library, so component bodies always resolve here:
curl -F pcb=@board.kicad_pcb "$URL/export3d?format=glb" -o board.glb
curl -F pcb=@board.kicad_pcb "$URL/render?side=top&style=realistic" -o top.png
curl -F pcb=@board.kicad_pcb -F sch=@board.kicad_sch "$URL/fab?version=v1.0.0" -o release.zip
# Validate a YAML config / apply placements
curl --data-binary @examples/mt1.yaml "$URL/validate"
curl -F pcb=@board.kicad_pcb -F config=@board.yaml "$URL/place" -o placed.kicad_pcb
GET /openapi.json serves the OpenAPI 3 spec (agents self-configure from it);
binary responses become base64 JSON with ?format=json. Run it yourself with
make docker-api or deploy with deploy/ (Cloud Run-ready —
production deploys are tag-driven: pushing pcb-designer-vX.Y.Z builds and
rolls out automatically via the multitec Terraform repo).
The Lemon Piano v0.6.0 board in the hero image was designed end-to-end
through exactly these endpoints (/place /route /drc /render /fab) from its
product repo, arduino-lemon-piano.
4 · Python API
python
from pcb_designer import load_config
from pcb_designer.placement import place_and_flip
cfg = load_config("examples/mt1.yaml")
text = open(cfg.pcb_path("."), encoding="utf-8").read()
text, updated, missing = place_and_flip(text, {r: p.as_tuple()for r, p in cfg.placements.items()})
Every module is importable on its own: kicad_pcb_io (depth-aware S-expression
surgery), placement (genuine layer flips), injection, routing,
autorouter, render_dim, render_overlay, export3d, verify, fab.
The physical-verification gate
The verify stage is a hard gate between routing and fabrication: a
computer-vision + geometric check that catches mirrored or pin-swapped
footprints by comparing the rendered board against the board's ground-truth
pinout. It exists because three mirror bugs once reached a real fab order
(the full story:
projects/mt1/docs/POST-MORTEM-001-mirror-rootcause.md).
Mounting-hole CV check
Pins-over-pads check
Detected hole centres vs ground truth — deviation 0.000 mm
Every module pin proven to sit on its pad
If the layout contradicts the ground truth, verify exits non-zero and fab
never runs. The mirrored board that motivated the gate is kept as a regression
fixture (tests/fixtures/mt1-pcb-v0.1.1-buggy.kicad_pcb) so
the tests prove the gate still catches it.
Look at the board in 3D
export3d runs in the default pipeline and writes two files per version:
a .glb (binary glTF — opens in browsers and light viewers) and a
.step (FreeCAD / Fusion, enclosure design, real fit checks). Both include
tracks, pads, zones, silkscreen and soldermask.
Viewer recommendations (VS Code, web, native) and the missing-bodies gotcha
In VS Code — one click. The repo ships a .vscode/extensions.json
recommending thingraph.cad-viewer,
so VS Code offers to install it the first time you open the workspace. Then
double-click the .glb — or the .step — and drag to rotate. It bundles
occt-import-js.wasm (OpenCascade), so its STEP support is a real geometry
kernel.
Web, nothing to install. Open https://3dviewer.net and drag the .glb
in — it renders in your browser, the file is not uploaded to a server.
Local, lightweight.f3d (sudo apt install f3d) is a
fast native viewer. There is also KiCad's own 3D viewer (Alt+3) if you have
KiCad installed.
If parts are missing bodies: component bodies are not in the
.kicad_pcb — each footprint stores a path into the kicad-packages3d
library (several GB), and kicad-cli skips models it cannot resolve
silently. export3d detects this and can fetch just the handful of files
your board references (~1–2 MB):
The package/example split is the core design rule: algorithms live in
src/pcb_designer/ and take every parameter explicitly; board specifics live in
the board's YAML + projects/<board>/tools/. The pipeline stages
subprocess-call the board's orchestrator scripts (resolved via project.tools_dir
in the YAML), so adding a second board never touches the package.
Where boards live: a real board belongs to its PRODUCT's repo under
pcb/ — config, docs, tools, ground-truth, kicad sources, renders,
validation evidence and releases all together — with the board's tools
importing this toolkit as a sibling repo (../eda-pcb-designer/src) and
running the generative steps in this repo's Docker image. That is how MT1
lives upstream (multi-rocket-avionica/pcb/) and how the Lemon Piano board
lives in arduino-lemon-piano/pcb/. The projects/mt1/ copy here is the
vendored worked example the docs and tests reference — scaffold with
pcb-designer init, then move the project folder into the product repo's pcb/.
For AI agents
This repo is designed to be operated by an AI coding agent under a strict
protocol — the agent edits the YAML config and drives the CLI; it never
hand-edits S-expressions for routine iterations, and it cannot reach fab
without passing DRC + the physical-verification gate.
Entry point: AGENTS.md — operating manual (reading order,
hard rules, the iteration loop, stop-and-ask criteria).
Load-bearing rules: docs/LESSONS_LEARNED.md —
24 rules learned from real incidents; breaking them produces boards that pass
DRC yet crash pcbnew or ship mirrored.
Parts of the methodology corpus are written in Spanish (the project's working
language); code, identifiers and the agent-facing entry points are in English.
Development
bash
make dev # editable install with all extras
make lint # ruff check src tests
make test # pytest
make docker # build the pipeline-in-a-box image
CI runs lint + tests on Python 3.11/3.12, validates the example configs,
round-trips a pcb-designer init scaffold, builds the Docker image and runs
the MT1 place,render stages inside it with a real KiCad 9, and smoke-tests
every HTTP API endpoint against the deploy image.
It measures 100 × 30 mm and has 2 copper layers, 1.6 mm thick.
What parts does the Mt1-pcb use?
25 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 Mt1-pcb KiCad files?
From the yupipi93/eda-pcb-designer repository on GitHub, at the commit this page was made from: the board is projects/mt1/kicad/mt1-pcb.kicad_pcb and its schematic projects/mt1/kicad/mt1-pcb.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Can I use the Mt1-pcb design in my own project?
Its repository publishes it under the MIT licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).