
Battery Management System
creid89/PSU_Capstone_Project_2025_BMS
Battery Management System for PSU Student EPL (Engineering Prototyping Lab)

Machine-generated PCB design for a Raspberry Pi Zero 2 W power scheduler / UPS / battery board. The electrical design is defined in code (netlist.py); the board was laid out and routed with the scripted KiCad +…
Powermod is an open-source printed circuit board by zdeager, from the zdeager/powermod repository on GitHub. It is a 4-layer board of 65 × 40 mm with 77 parts on 45 nets, routed with 431 tracks and 204 vias.
It is built around the PY32F003F18P6TU, TPS63020DSJR and BM8563, with the TP4056, XC6206P332MR and M2.5 among its other parts. Its parts include 28 resistors, 16 capacitors, 5 ICs, 5 diodes and 5 connectors.
Machine-generated PCB design for a Raspberry Pi Zero 2 W power scheduler /
UPS / battery board. The electrical design is defined in code (netlist.py);
the board was laid out and routed with the scripted KiCad + Freerouting
toolchain below, then hand-finished.
powermod.kicad_pcb (final)65 × 40 mm, 4-layer (F.Cu signal / In1 solid GND / In2 signal / B.Cu signal). Bolts under a Pi Zero 2 W (holes on the Pi's 58×23 grid, flush to the N+W edges); the Pi covers y0–30, and all user-facing parts (USB-C out, battery, button, LEDs, jumpers, test pads) sit on the exposed strip below it. Single-sided assembly.
One KiCad project, one stem: powermod.kicad_pro (netclasses + DRC config),
powermod.kicad_sch (generated schematic), powermod.kicad_pcb (board),
powermod.kicad_dru (width-enforcement rules — net classes alone are NOT
checked by DRC).
Status: fab-ready. Fully routed, 0 unconnected, 0 clearance; the only DRC
items are 4 track_width flags on the L2/L1N necks at U3's 0.65 mm pins,
which physically cannot be 1.0 mm wide. Pre-fab audit (pad-for-pad netlist
diff, datasheet pin checks, operating-point math, the D5 supercap fix):
see PREFAB_AUDIT.md — read it before ordering (BOM traps, firmware
contract, bring-up plan).
Do NOT regenerate this board from
netlist.py. Placement and the USB-C fine-pitch escapes are hand-done. Make changes surgically onpowermod.kicad_pcband updatenetlist.pyin parallel, then prove they agree with a pad-diff (the audit doc describes it).
netlist.py — every component, pin, and net (73 components, 45 nets).
Run it to (re)generate powermod.kicad_sch, powermod.net,
powermod.kicad_sym, sym-lib-table, fp-lib-table. Has a self-test
(golden vectors, pin counts).powermod.pretty/ — local footprint lib: the merged-pad USB-C
receptacle (reversible twin pads share one pad, so VBUS/GND escape cleanly
and DRC sees no coincident-pad conflicts). Required to open the board.All the layout/routing/placement scripts live in tools/ (run them from
this directory, e.g. python3 tools/finish_board.py powermod.kicad_pcb, so
board paths and _sizes.json resolve; they add the parent dir to sys.path
to import netlist.py). netlist.py itself stays here — it's the design
source and writes the deliverables alongside itself. SPICE decks are in
tools/spice/.
Routing pipeline (for derivative boards — not this one):
fr_pipeline.py — strip copper + export Specctra DSN / import routed
SES. Freerouting must never see a pre-routed board.tools/freerouting.jar (gitignored, ~55 MB) — the autorouter. Java 21+, run
with -Djava.awt.headless=true or it hangs on macOS.finish_board.py — post-route finisher: SES import → GND stitching →
floating-pour-island tie vias → zone refill. Then DRC with
--refill-zones (without it you get hundreds of phantom violations).stitch_gnd.py — the 2.5 mm GND stitching-via grid to the In1 plane.close_nets.py — route leftover nets with the In2-capable grid A*,
each route validated by refill+DRC and reverted if it doesn't improve.router.py — grid A* + obstacle model (F/In2/B) used by the above.netclasses.py — inject net-class width targets into a .kicad_pro.Placement:
layout_v2.py — the board generator (gen_pcb: footprints, GND
planes, keepouts). layout_mount.py configures it for this board's
outline/holes/pinned I/O.place_constrained.py — constraint-aware force-directed placer
(net springs, padded repulsion, wide-net/IC halos, rigid converter block).place_search_mount.py / relax_mount.py — placement search
scored by Freerouting / overlap relaxer. mount_best.py — placer
output snapshot (stale vs the hand-edited board; the board is
authoritative).place_check.py — courtyard-overlap + off-board report.make_stencil.py — generates a bare user-facing-parts canvas for
human I/O placement (its output board was removed once the layout froze)._sizes.json — cached footprint courtyard sizes (kept in this dir; the
placer reads it cwd-relative).SPICE (tools/spice/):
power_path_scenarios.py — behavioural ngspice model of the Q1/Q2/Q3
power path; runs the startup/switchover/unplug scenario matrix (see the
SPICE section of PREFAB_AUDIT.md). Needs ngspice on PATH.powermod.kicad_dru next
to the board, and after any rename/move confirm the 4 known track_width
flags still fire (if they vanish, the rules got orphaned, not fixed)..kicad_pro. A board file copied away from its
project routes everything at 0.2 mm and "routes fully" — a fake win.v1 (58×40, 2-layer) had 3A rails at 0.2 mm (the .kicad_dru lesson); v2
(65×30) was superseded by this board; the QFN-package MCU was swapped for the
SOIC-20 ATtiny1616 to break the routing wall; powermod_mount.* was renamed
to powermod.* once it became the only board (2026-07-17); then the MCU
migrated ATtiny1616 → PY32F003F18P6 (TSSOP-20, ARM Cortex-M0+) on the
instock-parts branch (2026-07-18) for JLC assembly availability, with a full
reroute — the current board is 65×40, 4-layer, PY32. Lessons live in
the tools and PREFAB_AUDIT.md, not in stale board files.
| Qty | Value | Footprint | References |
|---|---|---|---|
| 7 | 100n | C_0402_1005Metric | C10, C11, C12, C13, C14, C15, C16 |
| 5 | 100k | R_0402_1005Metric | R10, R12, R13, R14, R28 |
| 5 | 10k | R_0402_1005Metric | R15, R16, R17, R18, R19 |
| 4 | 560 | R_0402_1005Metric | R20, R21, R22, R23 |
| 4 | M2.5 | MountingHole_2.7mm_M2.5 | H1, H2, H3, H4 |
| 3 | 10u | C_0805_2012Metric | C1, C2, C7 |
| 3 | 1M | R_0402_1005Metric | R6, R8, R25 |
| 3 | 1N4148WS | D_SOD-323 | D3, D4, D5 |
| 3 | 22u | C_0805_2012Metric | C3, C4, C5 |
| 2 | 1u | C_0603_1608Metric | C8, C9 |
| 2 | 330k | R_0402_1005Metric | R7, R9 |
| 2 | 5.1k | R_0402_1005Metric | R2, R3 |
| 2 | 56k | R_0402_1005Metric | R4, R5 |
| 2 | AON7407 | DFN-8-1EP_3x3mm_P0.65mm_EP1.6x2.56mm | Q1, Q2 |
| 2 | TJ-S3227 | LED_TJ-S3227_RG_3.2x2.7mm | D1, D2 |
| 1 | 1.2k | R_0402_1005Metric | R1 |
| 1 | 1.5uH_4.5A | L_Sumida_CDMC6D28_7.25x6.5mm | L1 |
| 1 | 180k | R_0402_1005Metric | R24 |
| 1 | 1k | R_0402_1005Metric | R27 |
| 1 | 32.768kHz | Crystal_SMD_3215-2Pin_3.2x1.5mm | Y1 |
| 1 | 4.7u | C_0603_1608Metric | C6 |
| 1 | 47k | R_0402_1005Metric | R11 |
| 1 | 620k | R_0402_1005Metric | R26 |
| 1 | BAT_PAD | TestPoint_Pad_2.0x2.0mm | TP2 |
| 1 | BM8563 | SOIC-8_3.9x4.9mm_P1.27mm | U1 |
| 1 | BSS138 | SOT-23 | Q3 |
| 1 | BUTTON | SW_SPST_PTS647_Sx50 | SW1 |
| 1 | CHG_JUMPER | SolderJumper-2_P1.3mm_Open_RoundedPad1.0x1.5mm | JP1 |
| 1 | GND_PAD | TestPoint_Pad_2.0x2.0mm | TP4 |
| 1 | JST_PH_2 | JST_PH_S2B-PH-K_1x02_P2.00mm_Horizontal | J3 |
| 1 | PY32F003F18P6 | TSSOP-20_4.4x6.5mm_P0.65mm | U2 |
| 1 | STEMMA_QT | JST_SH_SM04B-SRSS-TB_1x04-1MP_P1.00mm_Horizontal | J4 |
| 1 | SWD_HDR | PinHeader_1x04_P2.54mm_Vertical | J5 |
| 1 | TP4056 | SOIC-8-1EP_3.9x4.9mm_P1.27mm_EP2.29x3mm | U4 |
| 1 | TPS63020DSJR | VSON-14-1EP_3x4.45mm_P0.65mm_EP1.6x4.2mm | U3 |
| 1 | USB_C_IN | USB_C_Receptacle_TYPE-C_16P_PowerMerged | J1 |
| 1 | USB_C_OUT | USB_C_Receptacle_TYPE-C_16P_PowerMerged | J2 |
| 1 | VBACKUP_GND_PAD | TestPoint_Pad_2.0x2.0mm | TP5 |
| 1 | VBACKUP_PAD | TestPoint_Pad_2.0x2.0mm | TP1 |
| 1 | VOUT_GND_PAD | TestPoint_Pad_2.0x2.0mm | TP6 |
| 1 | VOUT_PAD | TestPoint_Pad_2.0x2.0mm | TP3 |
| 1 | VSEL_JUMPER | SolderJumper-2_P1.3mm_Open_RoundedPad1.0x1.5mm | JP2 |
| 1 | XC6206P332MR | SOT-23 | U5 |
It measures 65 × 40 mm and has 4 copper layers, 1.6 mm thick.
77 parts, built around the PY32F003F18P6TU, TPS63020DSJR, BM8563 and TP4056. 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.
From the zdeager/powermod repository on GitHub, at the commit this page was made from: the board is hardware/powermod.kicad_pcb and its schematic hardware/powermod.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Its repository states no licence, so its author keeps all rights: ask zdeager before reusing the design.

creid89/PSU_Capstone_Project_2025_BMS
Battery Management System for PSU Student EPL (Engineering Prototyping Lab)
machmar/pixelpine
PixelPine: a 7 cm PCB Christmas tree with 240 charlieplexed LEDs and a personality (KiCad, simulator, firmware sizing, docs)



Terryzhao-dev/Hush
Bluetooth dictation mic in an aluminium cup that keeps people nearby from hearing you (ESP32, KiCad, CadQuery)

danielkluka/Diploma-Thesis
Design of a Secure Data Transmission System in NB-IoT Environment


lewipewi/esp-32-gaming-console
A custom PCB handheld built to run Game Boy games, inspired by the original DMG. Designed from scratch in KiCad — schematic, layout, BOM and firmware.