
LabExam
moi-script/pcb_ui
A simple one-layer PCB "drawer": read a KiCad board, extract the copper traces, and turn them into travel-optimized G-code you can plot on a pen-plotter / small CNC driven by a microcontroller (GRBL — an Arduino running…

A simple one-layer PCB "drawer": read a KiCad board, extract the copper traces, and turn them into travel-optimized G-code you can plot on a pen-plotter / small CNC driven by a microcontroller (GRBL — an Arduino running…
NewProject is an open-source printed circuit board by moi-script, from the moi-script/pcb_ui repository on GitHub. It is a 2-layer board of 36 × 37 mm with 11 parts on 25 nets, routed with 94 tracks and 0 vias.
Its parts include 3 capacitors, 3 ICs, 2 switches, 1 resistor and 1 diode.
A simple one-layer PCB "drawer": read a KiCad board, extract the copper traces, and turn them into travel-optimized G-code you can plot on a pen-plotter / small CNC driven by a microcontroller (GRBL — an Arduino running grbl_servo_z).
Aimed at hobby / student mini projects, not professional copper milling.
labExam.kicad_pcb
→ pcb_read.py parse (custom s-expression parser; supports KiCad 10)
→ pcb_draw.py board preview by copper layer (labExam_wiring.png)
→ pcb_gcode.py travel-optimized G-code (labExam.gcode)
→ pcb_gcode_preview.py verify toolpath, no hardware (labExam_toolpath.png)
→ pcb_send.py stream to GRBL over USB serial (--check to validate)
→ Arduino running GRBL 1.1, over USBpcb_send.py is the CLI streamer and is not what the web app uses. The API
owns the serial port itself:
grbl/ the GRBL 1.1 stack: protocol codec, port enumeration, the
flow-controlled streamer thread, machine state, travel limits,
and a simulator good enough to develop against
machine.py the one process-wide Session that owns the port
job.py streams one board's G-code, with progress, pause, stoppython main.py # run the whole pipeline, step by step
python main.py --skip-preview # ... without the matplotlib image stepsEach stage also runs on its own — see DOCS.md for full
documentation, status, and roadmap, and HARDWARE.md for the
plotter build (parts list, flashing steps, starter config).
server.py is a FastAPI app that wraps this pipeline for the web UI in
../userpage, and drives the machine. It parses uploaded boards, generates
G-code, and stores accounts and routed boards in MongoDB
(mongodb://localhost:27017, database traceworks).
pip install -r requirements.txt
uvicorn server:app --reload --port 8000 # needs a local MongoDB
TRACEWORKS_SIM=1 uvicorn server:app --reload --port 8000 # ...and no hardwareBoard and account endpoints: POST /route (upload a .kicad_pcb → parsed +
routed board), POST /trace (an image → a pen path), /auth/signup ·
/auth/login, /boards/{email}, /board/{id}.
Machine endpoints — the backend runs on the same PC as the browser, so it, not the tab, owns the COM port:
| Endpoint | What it does |
|---|---|
GET /machine/ports | serial ports with chip names; suggested only when exactly one candidate exists |
POST /machine/connect | {port, baud, email?} → the firmware banner |
POST /machine/disconnect | |
GET /machine/state | the machine snapshot: state, mpos, wpos, job progress |
GET /machine/last | ?email= → the last port and baud used, or null |
WS /machine/ws | the same snapshot pushed at up to 10 Hz, plus console lines |
POST /machine/jog | {axis, distance, feed}; refused with the axis named if it would leave the envelope |
POST /machine/jog/cancel, /home, /unlock | |
POST /machine/zero | {axes} — set work zero on X, Y, Z or any combination |
POST /machine/command | {line} — one raw line; realtime characters are routed as realtime |
POST /machine/estop | realtime soft reset; returns instantly, never waits on the link |
POST /machine/run | {board_id, check} — stream a stored board; check brackets it with $C |
POST /machine/pause, /resume, /stop |
See server.py for the full list and db.py for the Mongo connection. The
reusable entry point is pcb_read.extract_wiring(text).
Python 3 and matplotlib for the CLI pipeline. The web API also needs
fastapi, uvicorn, python-multipart, and pymongo (all in
requirements.txt), plus a running MongoDB. (kiutils is intentionally not used —
it does not support the KiCad 10 file format.)
See ../RUNNING.md for running this together with the
frontend in ../userpage.
| Qty | Value | Footprint | References |
|---|---|---|---|
| 3 | 100nf | Capacitor_THT:C_Disc_D5.0mm_W2.5mm_P5.00mm | C1, C2, C3 |
| 1 | 330 | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_Horizontal | R1 |
| 1 | 74LS00_AND_1 | Package_DIP:DIP-14_W7.62mm | U1 |
| 1 | 74LS04_NOT_1 | Package_DIP:DIP-14_W7.62mm | U3 |
| 1 | 74LS32_OR_1 | Package_DIP:DIP-14_W7.62mm | U2 |
| 1 | Barrel_Jack | Connector_BarrelJack:BarrelJack_Horizontal | J1 |
| 1 | LED | LED_THT:LED_D5.0mm | D1 |
| 1 | SW_DIP_x04 | Button_Switch_THT:SW_E-Switch_EG1224_SPDT_Angled | SW2 |
| 1 | SW_SPST | Button_Switch_THT:SW_CK_JS202011AQN_DPDT_Angled | SW1 |
It measures 36 × 37 mm and has 2 copper layers, 1.6 mm thick.
11 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.
From the moi-script/pcb_ui repository on GitHub, at the commit this page was made from: the board is serverside/newProject.kicad_pcb. PCBKit opens the board in the browser, with nothing to install.
Its repository states no licence, so its author keeps all rights: ask moi-script before reusing the design.

moi-script/pcb_ui
A simple one-layer PCB "drawer": read a KiCad board, extract the copper traces, and turn them into travel-optimized G-code you can plot on a pen-plotter / small CNC driven by a microcontroller (GRBL — an Arduino running…

moi-script/pcb_ui
A simple one-layer PCB "drawer": read a KiCad board, extract the copper traces, and turn them into travel-optimized G-code you can plot on a pen-plotter / small CNC driven by a microcontroller (GRBL — an Arduino running…

google/mozc-devices
Circuit diagrams and firmware source code for Gboard DIY keyboards


FrameworkComputer/ExpansionCards
Reference designs and documentation to create Expansion Cards for the Framework Laptop

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

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


tardate/LittleArduinoProjects
a collection of "Little Electronic & Arduino Projects", most involving electronics or an Arduino in one way or another!

basilfx/TRADFRI-Hacking
Hacking IKEA TRÅDFRI products, such as light bulbs, window blinds and other accessories.