# commaai/neo architecture

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

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

## Overview

##### Project type and purpose
- This is an open-source hardware robotics research platform (“neo”) that leverages a consumer smartphone as the main compute and sensor hub, paired with a custom STM32F205–based CAN interface board, all housed in 3D-printed enclosures with active cooling. The file tree breaks down into:
- board (EagleCAD electrical design files)
- case (3D-printable STL models)
- car_harness, giraffe, interface_boards, etc. (connector and adapter designs for various vehicle makes)
- parts, key, paw, panda_debug, etc. (additional PCB designs and BOMs)

##### File structure for architectural clues
- “board” contains the core CAN-interface PCB schematic and layout (STM32F205 MCU + transceivers).
- “body” & “case” contain mechanical designs (housing, mounts, cooling).
- “car_harness” and “giraffe” directories hold versioned harness schematics and mechanical mounts for interfacing to specific vehicles’ OBD/CAN connectors.
- “interface boards” and “panda_debug” cover optional PCBs for specialized debugging or sub-systems.
- “parts” holds BOMs for all PCBs, indicating a clear separation between electrical design and mechanical design.

##### Extract README insights
- The platform runs a stripped Android ROM (“NEOS”) on the OnePlus 3 to provide both embedded-grade robustness and a modern Linux environment for development.
- Data flow: smartphone ↔ CAN board ↔ vehicle CAN network.
- Power budget: smartphone battery or external supply → DC-DC → STM32 board → CAN transceivers.
- Cooling via fans mounted in the 3D-printed case.

##### Main components
a. Smartphone (OnePlus 3) running NEOS – CPU, sensors (IMU, camera, GPS, radios)
b. CAN interface board (STM32F205 MCU + CAN transceivers)
c. Power management module (voltage regulators/DC-DC converters)
d. Vehicle Harness & Adapters (OBD-II or model-specific connectors – car_harness & giraffe modules)
e. Mechanical Housing (3D-printed case + active cooling fan)
f. Optional extension boards (panda_debug, interface_boards)

##### Component relationships & interactions
- From CAN Interface board, show two CAN bus channels branching to:
- Vehicle Harness (standard OBD‐II connector)
- Giraffe adapters (maker‐specific sub‐connectors)
- Power Management feeds both the CAN Interface and the Smartphone (if external power is used).
- The Mechanical Housing encapsulates Smartphone, CAN board, and fan; indicate mounting points.

##### Architectural patterns and design principles
- Modular design: separate electrical (board) and mechanical (case, body) layers.
- Versioned interfaces: car_harness/v1, v3 and giraffe adapters isolate vehicle‐specific wiring.
- Open standard: EagleCAD for schematics, STL for mechanical parts, CSV for BOM.

##### Relevant technologies, frameworks, or libraries
- STM32F205 microcontroller (ARM Cortex-M3) running firmware for CAN bridging.
- OnePlus 3 smartphone running Android‐based NEOS with Linux userland.
- EagleCAD for PCB design, standard STL files for 3D printing.

##### Elements
- Components labeled clearly: “OnePlus 3 (NEOS)”, “STM32F205 CAN Board”, “DC-DC Power Module”, “Vehicle Harness (OBD-II)”, “Giraffe Adapter (Honda, Ford, etc.)”.
- Data flow: smartphone → CAN → vehicle & vice versa
- Power flow: battery/external supply → regulators → smartphone & CAN board
- Electronics (blue rectangles)
- Mechanical parts (gray outlines)
- Harness/adapters (green blocks)
- Firmware/software layers (Android kernel, CAN driver, userland services).

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Mechanical Housing"
        MH1["Case (STL Files)"]:::mech
        MH2["Body & Mounts"]:::mech
        FAN["Cooling Fan"]:::mech
    end

    subgraph "Electronics"
        SP["OnePlus 3 (NEOS)"]:::elec
        CI["STM32F205 CAN Board"]:::elec
        PM["Power Management Module"]:::elec
    end

    subgraph "Vehicle Interfaces"
        subgraph "Harness Modules"
            VH["Vehicle-Specific Harness Modules"]:::harness
        end
        subgraph "Giraffe Adapters"
            GA["Giraffe Adapters"]:::harness
        end
    end

    subgraph "Optional Extensions"
        IB["Interface Boards"]:::elec
        PD["Panda Debug Board"]:::elec
    end

    subgraph "Pedal Interface"
        PI["Pedal Interceptor Subsystem"]:::elec
    end

    subgraph "Bill of Materials"
        BOM["BOM & Parts Lists"]:::bom
    end

    %% Data Flows
    SP <-->|"Data over USB/Serial"| CI
    CI -->|"CAN Bus Channel 1"| VH
    CI -->|"CAN Bus Channel 2"| GA

    %% Power Flows
    PM -->|"Power"| SP
    PM -->|"Power"| CI

    %% Enclosure relationships
    MH1 --- SP
    MH1 --- CI
    MH1 --- FAN

    %% BOM Links
    CI --> BOM
    IB --> BOM
    PD --> BOM
    PI --> BOM
    VH --> BOM
    GA --> BOM

    %% Click Events
    click SP "https://github.com/commaai/neo/blob/master/README.md"
    click SP "https://github.com/commaai/neo/blob/master/guide.pdf"
    click CI "https://github.com/commaai/neo/blob/master/board/neo.sch"
    click CI "https://github.com/commaai/neo/blob/master/board/neo.brd"
    click CI "https://github.com/commaai/neo/blob/master/board/comma.ai.lbr"
    click PM "https://github.com/commaai/neo/blob/master/board/neo.sch"
    click PM "https://github.com/commaai/neo/blob/master/board/neo.brd"
    click VH "https://github.com/commaai/neo/tree/master/car_harness/v1/"
    click VH "https://github.com/commaai/neo/tree/master/car_harness/v3/"
    click VH "https://github.com/commaai/neo/tree/master/car_harness/v1/boards/"
    click VH "https://github.com/commaai/neo/tree/master/car_harness/v1/connectors/"
    click GA "https://github.com/commaai/neo/blob/master/giraffe/README.md"
    click GA "https://github.com/commaai/neo/tree/master/giraffe/fca/"
    click GA "https://github.com/commaai/neo/tree/master/giraffe/ford/"
    click GA "https://github.com/commaai/neo/tree/master/giraffe/honda/"
    click GA "https://github.com/commaai/neo/tree/master/giraffe/hyundai/"
    click GA "https://github.com/commaai/neo/tree/master/giraffe/subaru/"
    click GA "https://github.com/commaai/neo/tree/master/giraffe/toyota/"
    click MH1 "https://github.com/commaai/neo/tree/master/case/"
    click MH2 "https://github.com/commaai/neo/tree/master/body/"
    click IB "https://github.com/commaai/neo/tree/master/interface boards/"
    click PD "https://github.com/commaai/neo/blob/master/panda_debug/panda_debug.sch"
    click PD "https://github.com/commaai/neo/blob/master/panda_debug/panda_debug.brd"
    click BOM "https://github.com/commaai/neo/blob/master/parts/digikey.csv"
    click BOM "https://github.com/commaai/neo/blob/master/parts/macrofab.xyrs"
    click BOM "https://github.com/commaai/neo/blob/master/parts/mcmaster.csv"
    click BOM "https://github.com/commaai/neo/blob/master/key/BOM.csv"
    click BOM "https://github.com/commaai/neo/blob/master/key/key.sch"
    click BOM "https://github.com/commaai/neo/blob/master/key/key.brd"
    click BOM "https://github.com/commaai/neo/blob/master/paw/BOM.csv"
    click BOM "https://github.com/commaai/neo/blob/master/paw/paw.sch"
    click BOM "https://github.com/commaai/neo/blob/master/paw/paw.brd"
    click PI "https://github.com/commaai/neo/blob/master/pedal/board/interceptor.sch"
    click PI "https://github.com/commaai/neo/tree/master/pedal/case/"
    click PI "https://github.com/commaai/neo/blob/master/pedal/build_guide.pdf"

    %% Styles
    classDef elec fill:#cce5ff,stroke:#333,stroke-width:1px
    classDef mech fill:#f2f2f2,stroke:#666,stroke-width:1px
    classDef harness fill:#d4edda,stroke:#2e7d32,stroke-width:1px
    classDef bom fill:#fff3cd,stroke:#856404,stroke-width:1px
```
