Skip to the content
4 layers240 × 180 mmOparroy ci, the printed circuit board in 3D

WS2812 inspired versatile serial protocol and hardware

Size
240 × 180 mm
Copper layers
4
Thickness
1.6 mm
Parts
570
Nets
436
Pads
1,953
Tracks, vias
0, 0
Routed
Not yet
KiCad
KiCad 10.0 (file 20260206)
Created
26 Sep 2026
Updated
26 Oct 2026

Overview

Oparroy ci is an open-source printed circuit board by kristofferkoch, from the kristofferkoch/oparroy repository on GitHub, published under the MIT licence. It is a 4-layer board of 240 × 180 mm with 570 parts on 436 nets.

It is built around the CH32V003F4P6, RP2040 and INA241A5ID, with the W25Q16JVSSIQ, 74LVC1G3157 and SN74LVC1G3157DBV among its other parts. Its parts include 274 resistors, 116 ICs, 69 capacitors, 44 diodes and 16 transistors. It belongs with the lEDs and displays boards and the RP2040 and RISC-V boards of this library.

Main components

12

README

README.md

oparroy

A read+write, fault-tolerant ring communication protocol for extremely cheap microcontroller nodes, inspired by the WS2812 single-wire protocol.

Unlike WS2812's write-only daisy chain, oparroy closes the chain into a ring so nodes can both send and receive. The physical layer is designed so that no single point of failure — a broken connector (permanent or intermittent), or a dead/hung microcontroller — partitions the ring:

  • The ring is dual: every segment carries two counter-rotating data rings with symmetric rebroadcast, so any single fault leaves every node reachable (DESIGN.md §3).
  • Bypass wiring routes around failed interconnects.
  • Each node has a semi-passive hardware watchdog that bypasses the node's RX→TX path unless the MCU actively keeps the bypass disabled.
  • Status LEDs make faults visually locatable to node and segment without instruments.

Extremely low node cost is the central design principle (sub-3-NOK MCU class); every other driver — resilience, repairability, testability — is achieved subject to it. Supervisor and test infrastructure, by contrast, may cost freely.

Hardware direction

  • Node MCU: CH32V003F4P6 — 48 MHz RV32EC in TSSOP-20, on-chip comparator routable to timer capture, ~$0.14 @4k. Clocked from the factory-trimmed internal HSI — no crystal; the ratio-metric PHY makes absolute clock accuracy irrelevant. Rationale: docs/mcu-research.md; extracted part facts: datasheets/CH32V003/notes/.
  • Supervisor: RP2040 — its PIO is the re-timing PHY engine and golden-reference transceiver; on the test board its PIO also runs as a logic analyzer on the instrumented boundary node (DESIGN.md §6).
  • PHY: WS2812-compatible duty-coded PWM cells with ratio-metric decode at an 800 kbit/s anchor, comparator RX + DMA, per-bit cut-through re-timing, positional addressing, and the frame gap as a ring-wide vsync latch (DESIGN.md §2; analysis: docs/phy-analysis.md).
  • Segment interconnect (DESIGN.md §2.1, §3): 2x5-pin IDC connectors (2.54 mm box headers on 3M 3365/10 ribbon) carry both counter-rotating data rings plus power — a single 3.3 V rail that is both the signaling rail and node power, and a raw 5–18 V rail for payloads with their own buck. On 3M 3365 ribbon, segments reach 10 m unamplified; the 470 Ω TX series resistor, not the cable, sets the limit (simulation: docs/cable-reach.md).
  • Node I/O: potmeter, buttons/matrix, capacitive touch, I2C accelerometer, LEDs, buzzer — nodes are smart peripherals serving cooked data (Bela/Trill pattern, see docs/bela-lessons.md).
  • Test board: 8 ring nodes + supervisor, full fault injection (per-segment open/short, per-node power cut, keep-alive cut), everything scriptable for hands-off hardware-in-the-loop testing. Doubles as the demonstrator: some nodes carry human-facing I/O (potentiometer, buttons, LEDs, buzzer), each input overridable by the supervisor so scripted runs stay hands-off (DESIGN.md §6). 4-layer, self-documenting silkscreen. Prototypes assembled by JLCPCB Economic PCBA; part selection is inventory-driven — minimize unique Extended BOM lines.

Firmware direction

  • Freestanding C++, no standard library — RAII, typed volatile structs over memory-mapped I/O, constexpr config; no exceptions/RTTI/heap.
  • Foundation library modeled on SerenityOS's AK, landed in firmware/lib/: ErrorOr<T> with TRY propagation and fallible try_* APIs, VERIFY with a target failure hook, fixed-capacity StaticVector/Span, and a StaticArena slot pool.
  • Ring protocol core in firmware/protocol/ — bit cells and node/ring forwarding logic (DESIGN.md §2) — proven by KLEE symbolic-execution harnesses and libFuzzer harnesses whose seed corpora double as the meson test suite; branch coverage is measured on the release build (scripts/coverage-release).
  • The node pin map is captured in the DSL — 17 of 18 CH32V003 GPIO assigned with a budget check — and emits firmware/node/pins.hpp directly (DESIGN.md §7).
  • All of it under the project-owned coding standard: code-std.md holds the language-independent rules and links the per-language standards (code-std-cpp.md, code-std-python.md) — borrowing from JSF AV / MISRA / AUTOSAR / CERT, statically checked from the first commit (DESIGN.md §8).

Tooling

  • Design capture is code: the home-rolled Python DSL (src/oparroy/dsl/, DESIGN.md §7) is the single source of truth — an IR with subcircuit composition (ports, port arrays, bundles, multipacking, component sockets), a validation pass (limit ranges, interval containment, waivers as data), and emitters for KiCad netlists, ngspice simulation netlists, and firmware pin headers. Footprint assignment and annotation/back-annotation are explicit, repeatable stages between capture and pcbnew, so emission is not a one-shot export. The parts DB carries assembler-stock status (inventory-driven selection), and a .kicad_pcb layout property checker audits the physical layout (stackup, trace budgets, bypass-path copper independence, mechanical contracts). KiCad is used for layout only. Learn the DSL from docs/dsl-tutorial.md; the API map is docs/dsl-reference.md. Circuit captures live in design/ — the full node board is captured (CH32V003 + PHY front-end + charge-pump watchdog + status LEDs + segment connectors) — with ngspice benches in circuits/ run via scripts/sim-run.
  • Datasheets are extracted, not just stored: datasheets/<PART>/ holds vendor PDFs plus LLM-readable markdown sidecars (facts, per-peripheral notes, quirks) — see datasheets/README.md.
  • Meson + ninja build the firmware (DESIGN.md §8): one build dir per toolchain, freestanding flag set in meson.build.
    • host (clang; host objects + LLVM bitcode for KLEE): meson setup build/host --native-file meson/native/clang.ini
    • CH32V003 (RV32EC objects): meson setup build/rv32ec --cross-file meson/cross/rv32ec.ini
    • then meson compile -C build/<dir>; the reproducibility gate ninja -C build/host check-reproducible builds every configuration twice and compares artifact hashes.
  • nix flake provides everything non-Python (riscv/arm cross GCC, clang 19 + KLEE, AFL++, ngspice, KiCad, uv itself), pinned by flake.lock — nix develop enters the shell (.envrc provided for direnv users); uv owns Python alone (3.14, ruff strict, ty, pytest): uv sync, then uv run pytest / uv run ruff check / uv run ty check.
  • Pre-commit hooks (pre-commit install): clang-format, clang-tidy (replaying the host build's compile_commands.json), and the markdown pipeline (mdformat + markdownlint-cli2 + lychee link checks) — cheap checks only, ~2 s warm. Hooks are language: system against the nix-pinned tools, so the flake stays the single tool source.
  • CI (.github/workflows/ci.yml): GitHub Actions runs every gate — pytest, firmware host build + unit tests, KLEE proofs, bounded fuzz runs, ngspice benches, the rv32ec cross build, the reproducibility gate, and the pre-commit suite — inside the nix dev shell, so CI exercises byte-identical tools to a laptop. Each gate sparse-checks-out only its declared inputs, so an undeclared dependency fails CI even when the full tree builds locally; scripts/check-sparse <gate> rehearses a gate against a sparse worktree before pushing (file content comes from HEAD — commit source edits first).

Repository layout

PathContents
AGENTS.mdDoc-split and writing conventions for agents
IDEAS.mdNot-yet-planned ideas (append-only stash)
DESIGN.mdSettled design decisions + open design questions
KANBAN.mdSingle home for planned work (cards, Next/Backlog)
code-std.mdProject-owned coding standard: general rules (living)
code-std-cpp.mdC++ coding standard (living)
code-std-python.mdPython (DSL) coding standard (living)
README.mdThis file
flake.nix + flake.lockPinned dev shell: all non-Python tools (DESIGN.md §8)
pyproject.toml + uv.lockPython side: the DSL package (ruff strict, ty, pytest)
src/oparroy/Design-capture DSL package (dsl/: IR, checks, emitters)
design/DSL circuit captures: node board, pin map, parts DB seed
circuits/ngspice benches: PHY segment, watchdog, cable reach
tests/Python tests (pytest) + golden netlists, .kicad_pcb fixtures
meson.build + meson/Firmware build: flag set, native/cross toolchain files
.envrcdirenv hook into the flake shell
.pre-commit-config.yamlHook wiring; tools nix-pinned, language: system
.github/workflows/CI: every gate inside the nix shell
firmware/Node/supervisor firmware: foundation lib, ring protocol
scripts/Build, sim/proof/fuzz, coverage + pre-commit scripts (sh)
docs/Reference documents (research reports, sub-designs); dsl-tutorial.md + dsl-reference.md document the DSL
datasheets/Vendor PDFs + extracted markdown sidecars per part
LICENSEMIT, copyright 2026 Kristoffer Koch

Doc conventions follow the IDEAS → KANBAN/DESIGN graduation model: stray thoughts live in IDEAS.md, planned work in KANBAN.md cards, settled decisions in DESIGN.md. See AGENTS.md §Documentation.

Status

The design-automation pipeline is landed end-to-end: the DSL captures the full node board, validates it, and emits KiCad and ngspice netlists, the firmware pin header, and layout constraint skeletons; simulation benches cover the PHY, the charge-pump watchdog, and cable reach. On the firmware side the foundation library and the ring-protocol core are in place under KLEE/fuzz/coverage verification, and CI runs every gate. No boards exist yet: next up is KiCad layout of the node board, which unblocks the 8-node test board and the long-cable bench work. Current work is tracked as cards in KANBAN.md.

Parts

570
QtyValueFootprintReferences
9647kResistor_SMD:R_0603_1608MetricR1, R10, R11, R12, R13, R14, R15, R108, R112, R113, R116, R118, R135, R141, R142, R155 +80
80470Resistor_SMD:R_0603_1608MetricR104, R106, R110, R111, R114, R115, R119, R120, R121, R122, R133, R137, R138, R139, R140, R143 +64
6074LVC1G3157Package_TO_SOT_SMD:SOT-23-6U22, U23, U24, U25, U26, U27, U37, U38, U106, U107, U108, U109, U110, U111, U112, U113 +44
37100nCapacitor_SMD:C_0603_1608MetricC1, C2, C10, C11, C12, C13, C18, C19, C20, C21, C22, C23, C24, C25, C26, C27 +21
3710kResistor_SMD:R_0603_1608MetricR102, R103, R117, R125, R126, R127, R128, R149, R150, R164, R172, R173, R174, R175, R196, R197 +21
301kResistor_SMD:R_0603_1608MetricR105, R107, R129, R130, R131, R132, R134, R152, R154, R176, R177, R178, R179, R181, R199, R201 +14
22SN74LVC1G3157Package_TO_SOT_SMD:SOT-23-6U1, U2, U3, U4, U5, U30, U31, U32, U33, U34, U35, U36, U46, U57, U104, U115 +6
16XL-3216SYGCLED_SMD:LED_1206_3216MetricLED1, LED3, LED5, LED7, LED9, LED11, LED13, LED15, LED17, LED19, LED21, LED23, LED25, LED27, LED29, LED31
1174HC595Package_SO:SOIC-16_3.9x9.9mm_P1.27mmU8, U9, U10, U13, U14, U15, U16, U17, U18, U19, U20
910uCapacitor_SMD:C_0603_1608MetricC14, C31, C35, C40, C44, C49, C53, C58, C66
80RResistor_SMD:R_0603_1608MetricR101, R124, R148, R171, R195, R218, R240, R262
810nCapacitor_SMD:C_0603_1608MetricC33, C38, C42, C47, C51, C56, C64, C69
8220Resistor_SMD:R_0603_1608MetricR109, R136, R156, R183, R203, R230, R247, R274
822nCapacitor_SMD:C_0603_1608MetricC32, C37, C41, C46, C50, C55, C63, C68
82N7002Package_TO_SOT_SMD:SOT-23Q2, Q3, Q6, Q7, Q10, Q11, Q14, Q15
83V3TestPoint:TestPoint_Pad_1.5x1.5mmTP2, TP6, TP10, TP14, TP18, TP22, TP26, TP30
8AO3401APackage_TO_SOT_SMD:SOT-23Q1, Q4, Q5, Q8, Q9, Q12, Q13, Q16
8BAT54SPackage_TO_SOT_SMD:SOT-23D5, D6, D7, D8, D9, D10, D11, D12
8CH32V003F4P6Package_SO:TSSOP-20_4.4x6.5mm_P0.65mmU47, U58, U68, U79, U89, U100, U105, U116
8DNPResistor_SMD:R_0603_1608MetricR100, R123, R147, R170, R194, R217, R239, R261
8DNPPackage_TO_SOT_SMD:SOT-23-5U45, U56, U66, U77, U87, U98, U103, U114
8GNDTestPoint:TestPoint_Pad_1.5x1.5mmTP3, TP7, TP11, TP15, TP19, TP23, TP27, TP31
8PC7TestPoint:TestPoint_Pad_1.5x1.5mmTP4, TP8, TP12, TP16, TP20, TP24, TP28, TP32
8SWIOTestPoint:TestPoint_Pad_1.5x1.5mmTP1, TP5, TP9, TP13, TP17, TP21, TP25, TP29
8TS-1187A-B-A-BButton_Switch_SMD:SW_Push_1P1T_XKB_TS-1187ASW1, SW2, SW3, SW4, SW5, SW6, SW7, SW8
8XL-3216SURCLED_SMD:LED_1206_3216MetricLED2, LED6, LED10, LED14, LED18, LED22, LED26, LED30
8XL-3216UYCLED_SMD:LED_1206_3216MetricLED4, LED8, LED12, LED16, LED20, LED24, LED28, LED32
410kPotentiometer_THT:Potentiometer_Alps_RK09K_Single_VerticalRV1, RV2, RV3, RV4
4UDD32C03L01Diode_SMD:D_SOD-323D1, D2, D3, D4
31uCapacitor_SMD:C_0603_1608MetricC28, C29, C60
3PKLCS1212E4001-R1Buzzer_Beeper:Buzzer_Murata_PKLCS1212EBZ1, BZ2, BZ3
215pCapacitor_SMD:C_0603_1608MetricC16, C17
227Resistor_SMD:R_0603_1608MetricR74, R75
25k1Resistor_SMD:R_0603_1608MetricR65, R66
274HC165Package_SO:SOIC-16_3.9x9.9mm_P1.27mmU11, U12
2Conn_02x05_Odd_EvenConnector_IDC:IDC-Header_2x05_P2.54mm_Vertical_SMDJ1, J3
11nCapacitor_SMD:C_0603_1608MetricC61
122uCapacitor_SMD:C_0603_1608MetricC15
147Resistor_SMD:R_0603_1608MetricR232
14k7Resistor_SMD:R_0603_1608MetricR88
1ABM8-272-T3Crystal:Crystal_SMD_3225-4Pin_3.2x2.5mmY1
1ADCS7476Package_TO_SOT_SMD:SOT-23-6U101
1AMS1117-3.3Package_TO_SOT_SMD:SOT-223-3_TabPin2U21
1HC-TYPE-C-16P-01AConnector_USB:USB_C_Receptacle_HCTL_HC-TYPE-C-16P-01AJ2
1INA241A5Package_TO_SOT_SMD:SOT-23-8U102
1R082Resistor_SMD:R_0603_1608MetricR234
1RP2040Package_DFN_QFN:QFN-56-1EP_7x7mm_P0.4mm_EP3.2x3.2mmU28
1W25Q16JVSSIQPackage_SO:SOIC-8_5.3x5.3mm_P1.27mmU29

More from kristofferkoch/oparroy

1
  • 2 layers33.6 × 28.2 mmOparroy node, the printed circuit board in 3D

    Oparroy node

    kristofferkoch/oparroy

    WS2812 inspired versatile serial protocol and hardware

    37 partsMIT

Similar boards

  • 4 layers101.2 × 63.5 mmFABulous board, the printed circuit board in 3D

    FABulous board

    FPGA-Research/FABulous_board

    A PCB created for FABulous FPGAs, based on the caravel board.

    85 parts6Apache-2.0
  • 4 layers30 × 30 mmReCamera 2002 POE Board, the printed circuit board in 3D

    ReCamera 2002 POE Board

    Seeed-Studio/OSHW-reCamera-Series

    reCamera is a series of open-source AI cameras.

    75 parts495Apache-2.0
  • 4 layers81 × 60 mmFanpico, the printed circuit board in 3D

    Fanpico

    tjko/fanpico

    Fanpico: Open Source Programmable PWM (PC) Fan Controller

    86 parts239GPL-3.0
  • 4 layers90 × 60 mmBetter lamp controller, the printed circuit board in 3D

    Better lamp controller

    super-cow-powers/better-lamp-controller

    A custom lamp controller with audio, controlled with an RP2040

    103 partsBSD-3-Clause
  • 2 layers251.6 × 177.8 mmMelbourneTrainTracker, the printed circuit board in 3D

    MelbourneTrainTracker

    itsmevjnk/MelbourneTrainTracker

    Melbourne Train Tracker project repository (SIT210, T1/2025)

    1,071 parts40
  • 2 layers215.1 × 85 mmLe oeuf, the printed circuit board in 3D

    Le oeuf

    eggsworks/le-oeuf-v2

    An ultra-low profile (Kailh PG1316S) keyboard inspired by Le Chiffre.

    110 parts8CERN-OHL-S-2.0
  • 4 layers117.6 × 83 mmNile test chip pcb, the printed circuit board in 3D

    Nile test chip pcb

    Ash-tronix/nile_test_chip_pcb

    KiCad PCB design files to support the Ashtronix® Nile test chip.

    177 parts
  • 2 layers20 × 35 mmKiCAD ICOM Internal GPS, the printed circuit board in 3D

    KiCAD ICOM Internal GPS

    MSF-Telecom/UT-GPS

    A small, internal, and open-source GPS module for ICOM IC-5060 and IC-6060 radios.

    30 partsCC-BY-SA-4.0

Questions

How big is the Oparroy ci PCB?

It measures 240 × 180 mm and has 4 copper layers, 1.6 mm thick.

What parts does the Oparroy ci use?

570 parts, built around the CH32V003F4P6, RP2040, INA241A5ID and W25Q16JVSSIQ. 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 Oparroy ci KiCad files?

From the kristofferkoch/oparroy repository on GitHub, at the commit this page was made from: the board is boards/ci/oparroy-ci.kicad_pcb. PCBKit opens the board in the browser, with nothing to install.

Can I use the Oparroy ci 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).