# commaai/pcbgolf architecture

> Architecture diagram of the GitHub repository commaai/pcbgolf, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/commaai/pcbgolf
- Repository: https://github.com/commaai/pcbgolf

## Overview

PCBGolf is a KiCad hardware design and miniaturization challenge, not a software application. The principal workflow is to optimize the board while retaining its interfaces and functionality, then submit the KiCad project and final-assembly STEP file for review and scoring. The README identifies the board’s major electrical subsystems and maps them to schematic sheets. Since no source excerpts are available, the graph shows documented capabilities but avoids inferring circuit-level connections between them.

Main entry points: [`pcbgolf.kicad_pcb`](https://github.com/commaai/pcbgolf/blob/master/pcbgolf.kicad_pcb) (PCB layout), [`assets/score.tex`](https://github.com/commaai/pcbgolf/blob/master/assets/score.tex) (Compactness score)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_power["Power and ports"]
  node_power_design["Power design<br/>[pcbgolf.kicad_sch]"]
  node_power_input["12V input<br/>[pcbgolf.kicad_sch]"]
  node_power_rails["5V and 3.3V<br/>[pcbgolf.kicad_sch]"]
  node_obd_ports["Four OBD-C ports"]
  node_port_power["Port power monitoring"]
end

subgraph group_interfaces["Connectivity"]
  node_can["Four CAN-FD transceivers"]
  node_ignition["Ignition simulation"]
  node_usb["USB hub"]
  node_usb_host["USB-C host"]
  node_controller["Microcontroller"]
  node_microsd["microSD slot"]
  node_controls["Button and LEDs"]
end

subgraph group_challenge["Challenge"]
  node_board["PCB layout<br/>[pcbgolf.kicad_pcb]"]
  node_score["Compactness score<br/>[score.tex]"]
  node_submission["KiCad and STEP submission"]
  node_review["Challenge review"]
end

node_optimizer(("Board optimizer"))

node_optimizer -->|"optimizes"| node_board
node_optimizer -->|"submits"| node_submission
node_board -->|"minimizes"| node_score
node_submission -->|"is reviewed"| node_review
node_review -->|"posts ranking"| node_optimizer

click node_power_design "https://github.com/commaai/pcbgolf/blob/master/pcbgolf.kicad_sch"
click node_power_input "https://github.com/commaai/pcbgolf/blob/master/pcbgolf.kicad_sch"
click node_power_rails "https://github.com/commaai/pcbgolf/blob/master/pcbgolf.kicad_sch"
click node_obd_ports "https://github.com/commaai/pcbgolf/blob/master/pcbgolf_5.kicad_sch"
click node_port_power "https://github.com/commaai/pcbgolf/blob/master/pcbgolf_5.kicad_sch"
click node_can "https://github.com/commaai/pcbgolf/blob/master/pcbgolf_4.kicad_sch"
click node_ignition "https://github.com/commaai/pcbgolf/blob/master/pcbgolf_4.kicad_sch"
click node_usb "https://github.com/commaai/pcbgolf/blob/master/pcbgolf_3.kicad_sch"
click node_usb_host "https://github.com/commaai/pcbgolf/blob/master/pcbgolf_3.kicad_sch"
click node_controller "https://github.com/commaai/pcbgolf/blob/master/pcbgolf_2.kicad_sch"
click node_microsd "https://github.com/commaai/pcbgolf/blob/master/pcbgolf_3.kicad_sch"
click node_controls "https://github.com/commaai/pcbgolf/blob/master/pcbgolf_2.kicad_sch"
click node_board "https://github.com/commaai/pcbgolf/blob/master/pcbgolf.kicad_pcb"
click node_score "https://github.com/commaai/pcbgolf/blob/master/assets/score.tex"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_power_design,node_power_input,node_power_rails,node_obd_ports,node_port_power toneBlue
class node_can,node_ignition,node_usb,node_usb_host,node_controller,node_microsd,node_controls toneAmber
class node_board,node_score,node_submission,node_review toneMint
class node_optimizer toneIndigo
```

## Components

### Power and ports

- [Power design](https://github.com/commaai/pcbgolf/blob/master/pcbgolf.kicad_sch): `pcbgolf.kicad_sch`
- [12V input](https://github.com/commaai/pcbgolf/blob/master/pcbgolf.kicad_sch): `pcbgolf.kicad_sch`
- [5V and 3.3V](https://github.com/commaai/pcbgolf/blob/master/pcbgolf.kicad_sch): `pcbgolf.kicad_sch`
- [Four OBD-C ports](https://github.com/commaai/pcbgolf/blob/master/pcbgolf_5.kicad_sch): `pcbgolf_5.kicad_sch`
- [Port power monitoring](https://github.com/commaai/pcbgolf/blob/master/pcbgolf_5.kicad_sch): `pcbgolf_5.kicad_sch`

### Connectivity

- [Four CAN-FD transceivers](https://github.com/commaai/pcbgolf/blob/master/pcbgolf_4.kicad_sch): `pcbgolf_4.kicad_sch`
- [Ignition simulation](https://github.com/commaai/pcbgolf/blob/master/pcbgolf_4.kicad_sch): `pcbgolf_4.kicad_sch`
- [USB hub](https://github.com/commaai/pcbgolf/blob/master/pcbgolf_3.kicad_sch): `pcbgolf_3.kicad_sch`
- [USB-C host](https://github.com/commaai/pcbgolf/blob/master/pcbgolf_3.kicad_sch): `pcbgolf_3.kicad_sch`
- [Microcontroller](https://github.com/commaai/pcbgolf/blob/master/pcbgolf_2.kicad_sch): `pcbgolf_2.kicad_sch`
- [microSD slot](https://github.com/commaai/pcbgolf/blob/master/pcbgolf_3.kicad_sch): `pcbgolf_3.kicad_sch`
- [Button and LEDs](https://github.com/commaai/pcbgolf/blob/master/pcbgolf_2.kicad_sch): `pcbgolf_2.kicad_sch`

### Challenge

- [PCB layout](https://github.com/commaai/pcbgolf/blob/master/pcbgolf.kicad_pcb): `pcbgolf.kicad_pcb`
- [Compactness score](https://github.com/commaai/pcbgolf/blob/master/assets/score.tex): `assets/score.tex`
- **KiCad and STEP submission**
- **Challenge review**

### Other components

- **Board optimizer**

## Connections

- Board optimizer → PCB layout: optimizes (evidence: `README.md`)
- Board optimizer → KiCad and STEP submission: submits (evidence: `README.md`)
- PCB layout → Compactness score: minimizes (evidence: `README.md`)
- KiCad and STEP submission → Challenge review: is reviewed (evidence: `README.md`)
- Challenge review → Board optimizer: posts ranking (evidence: `README.md`)
