# gopro2027/arduinoairsuspensioncontroller architecture

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

- Interactive diagram: https://gitdiagram.com/gopro2027/arduinoairsuspensioncontroller
- Repository: https://github.com/gopro2027/arduinoairsuspensioncontroller

## Overview

##### Main Components
- Main Board Firmware – Represented by the OASMan_ESP32 directory; this firmware runs on the ESP32 controller and handles sensor inputs, actuator outputs (compressor, valves, solenoids, etc.), and overall air suspension logic.
- Wireless Controller Module – Shown by the Wireless_Controller folder; this dedicated controller (with its associated PCB design and embedded code) provides an alternate interface (via BLE/Bluetooth) to control the system.
- Mobile Application – Two parts exist here:
– The new MobileApp (Flutter based using BLE) for modern user interaction.
– The legacy AirSuspension Android app (for traditional Bluetooth).
- Shared Libraries – ESP32_SHARED_LIBS holds shared configuration and common code between the main board and the wireless controller.
- Hardware Design & Manufacturing – PCB folder (with versioned Gerber files, DXF designs, etc.) and 3d Prints (STL files, 3D printable housing for manifolds, sensors, and display elements).
- Supporting Tools – LCDImageCreatorTool (for generating images for the tiny 128x64 display on the manifold) and PS3_Controller_Tool (for pairing a PS3 controller as an alternative control scheme).
- Tutorial & Documentation – The tutorial directory contains build instructions that help tie together the physical assembly and wiring.

##### Relationships and Data Flows
- The mobile app communicates via Bluetooth Low Energy (or traditional Bluetooth on legacy systems) to the Wireless_Controller and/or directly to the OASMan_ESP32 main board.
- The Wireless Controller module itself acts as a bridge to the main board, receiving commands from the mobile app or alternative inputs (for instance, from a PS3 controller configured by the PS3_Controller_Tool).
- Both controllers (ESP32 and wireless module) use shared code components from the ESP32_SHARED_LIBS.
- On the hardware side, the PCB designs and 3D printed parts physically integrate sensors, valves, compressor connections, and display components (like the tiny screen managed via the LCDImageCreatorTool).

##### Architectural Patterns and Design Principles
- The system is designed in a modular fashion: individual subprojects separate concerns (e.g., motion/sensor processing, connectivity, UI) while sharing common libraries/config files.
- There is clear separation between hardware (PCB, 3D printed hardware), embedded firmware (OASMan_ESP32 and Wireless_Controller), and the user interface layers (mobile app and supporting PC tools).
- Data flow relies on well-defined communication channels (Bluetooth/BLE), with the mobile apps acting as the user interface layer and the embedded systems managing the control logic and interfacing with physical components.

## Diagram (Mermaid)

```mermaid
flowchart TD

    %% User/Application Layer
    subgraph "User/Application Layer"
        MobileApp["New MobileApp (Flutter BLE)"]:::app
        LegacyApp["Legacy AirSuspension Android App"]:::app
    end

    %% Embedded Firmware Layer
    subgraph "Embedded Firmware Layer"
        MainBoard["OASMan_ESP32 (Main Board Firmware)"]:::firmware
        WirelessCtrl["Wireless Controller Module"]:::firmware
        SharedLib["ESP32_SHARED_LIBS (Shared Libraries)"]:::firmware
    end

    %% Hardware & Manufacturing Layer
    subgraph "Hardware & Manufacturing Layer"
        PCBDesign["PCB Designs"]:::hardware
        ThreeDPrint["3D Prints (Hardware parts)"]:::hardware
        ExternalDevices["Sensors,Actuators,Valves"]:::hardware
    end

    %% Supporting Tools
    subgraph "Supporting Tools"
        LCDTool["LCD Image Creator Tool"]:::tool
        PS3Tool["PS3 Controller Tool"]:::tool
    end

    %% Documentation
    subgraph "Documentation"
        Tutorial["Tutorial & Documentation"]:::documentation
    end

    %% Connections: Mobile App to Firmware
    MobileApp -->|"BLE"| WirelessCtrl
    LegacyApp -->|"Bluetooth"| WirelessCtrl
    MobileApp -->|"Direct"| MainBoard

    %% Firmware interactions
    WirelessCtrl -->|"Commands"| MainBoard
    MainBoard ---|"SharedCode"| SharedLib
    WirelessCtrl ---|"SharedCode"| SharedLib

    %% Supporting Tools interactions
    PS3Tool -->|"Pairing"| WirelessCtrl
    LCDTool -->|"DisplayImages"| MainBoard

    %% Hardware integration
    PCBDesign -->|"Connects"| MainBoard
    PCBDesign -->|"Connects"| WirelessCtrl
    ThreeDPrint -->|"MountsOn"| MainBoard
    ExternalDevices -->|"Interface"| MainBoard

    %% Click Events
    click MainBoard "https://github.com/gopro2027/arduinoairsuspensioncontroller/tree/main/OASMan_ESP32/"
    click WirelessCtrl "https://github.com/gopro2027/arduinoairsuspensioncontroller/tree/main/Wireless_Controller/"
    click MobileApp "https://github.com/gopro2027/arduinoairsuspensioncontroller/tree/main/MobileApp/oasman_mobile/"
    click LegacyApp "https://github.com/gopro2027/arduinoairsuspensioncontroller/tree/main/AirSuspension/"
    click SharedLib "https://github.com/gopro2027/arduinoairsuspensioncontroller/tree/main/ESP32_SHARED_LIBS/"
    click PCBDesign "https://github.com/gopro2027/arduinoairsuspensioncontroller/tree/main/PCB/"
    click ThreeDPrint "https://github.com/gopro2027/arduinoairsuspensioncontroller/tree/main/3d Prints/"
    click LCDTool "https://github.com/gopro2027/arduinoairsuspensioncontroller/tree/main/LCDImageCreatorTool/"
    click PS3Tool "https://github.com/gopro2027/arduinoairsuspensioncontroller/tree/main/PS3_Controller_Tool/"
    click Tutorial "https://github.com/gopro2027/arduinoairsuspensioncontroller/tree/main/tutorial/"

    %% Styles
    classDef app fill:#C1FFC1,stroke:#2F9D2F,stroke-width:2px;
    classDef firmware fill:#C1DFFF,stroke:#1F6FBD,stroke-width:2px;
    classDef hardware fill:#FFE4B5,stroke:#D2691E,stroke-width:2px;
    classDef tool fill:#F5DEB3,stroke:#DAA520,stroke-width:2px;
    classDef documentation fill:#D3D3D3,stroke:#A9A9A9,stroke-width:2px;
```
