# ozkanerbatuhan/hyperloop_pi architecture

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

- Interactive diagram: https://gitdiagram.com/ozkanerbatuhan/hyperloop_pi
- Repository: https://github.com/ozkanerbatuhan/hyperloop_pi

## Overview

##### Project type and purpose
- This is a Raspberry-Pi–based, Python–driven IoT/data-acquisition tool (not a web app). It collects accelerometer data from an MPU-6050, controls GPIO pins, and emits data over a serial interface. There is no frontend—it's a single-process embedded script with modular components.

##### File structure
Top-level files
- main.py           – entry point, orchestrates workflow
- mpu6050_sensor.py – encapsulates MPU-6050 I2C interaction
- gpio_control.py   – encapsulates RPi.GPIO calls to set/read pins
- serial_data.py    – formats and sends measurement packets over UART/USB-serial
- denme.py          – likely a test or utility script
- README.md         – stub (empty)
- env/.venv         – Python virtual environment containing sensor and CLI libraries

Notes
- No separate “src” or “lib” directories—modules live at project root.
- Dependencies installed in virtualenv include RPi.GPIO, adafruit-apds9960, mpu6050_raspberrypi, clint (CLI utilities), args (argument parsing).

##### README
– It contains no architecture notes. Use code and file names to infer responsibilities.

##### Be detailed
– Don’t omit any module or hardware interface.
– If there are configuration or test scripts (denme.py), show them off to one side as “utilities.”

[Hardware Layer]
MPU-6050 --I2C--> Raspberry Pi
GPIO Header --pins--> Raspberry Pi
UART--> External Logger/Host
[Software Layer inside Pi]
Python VM ←virtualenv
├── main.py
│     ├→ mpu6050_sensor.py
│     ├→ gpio_control.py
│     └→ serial_data.py
└── denme.py (utility)
[External]
CLI (args/clint) for start-up parameters

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Hardware Layer
    subgraph "Hardware Layer"
        classDef hardware fill:#dddddd,stroke:#888;
        MPU["MPU-6050 Sensor"]:::hardware
        GPIO["GPIO Header"]:::hardware
        UART["UART/USB-Serial Port"]:::hardware
    end

    %% Raspberry Pi & Software
    subgraph "Raspberry Pi"
        classDef runtime fill:#ffffcc,stroke:#888;
        PythonVM["Python VM\n(virtualenv)"]:::runtime
        click PythonVM "https://github.com/ozkanerbatuhan/hyperloop_pi/tree/main/env/"

        subgraph "Modules"
            classDef modules fill:#ddf,stroke:#888;
            Main["main.py\n(Orchestrator)"]:::modules
            click Main "https://github.com/ozkanerbatuhan/hyperloop_pi/blob/main/main.py"
            Sensor["mpu6050_sensor.py"]:::modules
            click Sensor "https://github.com/ozkanerbatuhan/hyperloop_pi/blob/main/mpu6050_sensor.py"
            GPIOmod["gpio_control.py"]:::modules
            click GPIOmod "https://github.com/ozkanerbatuhan/hyperloop_pi/blob/main/gpio_control.py"
            Serial["serial_data.py"]:::modules
            click Serial "https://github.com/ozkanerbatuhan/hyperloop_pi/blob/main/serial_data.py"
            Denme["denme.py\n(Utility/Test)"]:::modules
            click Denme "https://github.com/ozkanerbatuhan/hyperloop_pi/blob/main/denme.py"
        end

        subgraph "CLI & Terminal UI"
            classDef cli fill:#cfc,stroke:#080;
            Args["args (CLI Parser)"]:::cli
            click Args "https://github.com/ozkanerbatuhan/hyperloop_pi/blob/main/env/lib/python3.11/site-packages/args.py"
            Clint["clint (Terminal UI)"]:::cli
            click Clint "https://github.com/ozkanerbatuhan/hyperloop_pi/tree/main/env/lib/python3.11/site-packages/clint"
        end
    end

    %% External Component
    External["External Host/Logger"]:::external
    click External "https://github.com/ozkanerbatuhan/hyperloop_pi/blob/main/README.md"
    classDef external fill:#cfc,stroke:#080;

    %% Data Flows
    MPU -->|"I2C SDA/SCL"| Sensor
    Sensor -->|"read()"| Main
    GPIO -->|"GPIO pins"| GPIOmod
    GPIOmod -->|"read/write"| Main
    Main -->|"sensor & pin data"| Serial
    Serial -->|"bytes"| UART
    UART -->|"serial"| External
    Args -->|"startup parameters"| Main
    Clint -->|"terminal UI"| Main

    %% Containment
    PythonVM --> Main
    PythonVM --> Sensor
    PythonVM --> GPIOmod
    PythonVM --> Serial
    PythonVM --> Denme
    PythonVM --> Args
    PythonVM --> Clint
```
