# ezyrone/hackathon_blitzcrank architecture

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

- Interactive diagram: https://gitdiagram.com/ezyrone/hackathon_blitzcrank
- Repository: https://github.com/ezyrone/hackathon_blitzcrank

## Overview

##### Project type and purpose
- This is an embedded-plus-software robotics project: a mini-sumo bot combining low-level motor control on an Arduino UNO with high-level decision making on a Raspberry Pi Zero running Python.
- Its goal is to autonomously detect and push opponents out of a ring.

##### File structure
- Top level:
- Arduino/ – contains two sketches (main.ino, omi.ino) handling motor drivers (L298N) and sensors (ultrasonic HC-SR04, IR line sensors).
- Python/ – contains the Pi logic: main.py, a utils folder with sensors.py, plus an audio asset for announcing “John Cena.”
- README.md, requirements.txt for Python dependencies (e.g., pyserial).
- No separate “frontend” or “backend”; instead, two embedded software components communicating over serial.

##### README for additional insights
- Confirms the hardware stack (Arduino UNO + L298N + sensors, plus Raspberry Pi Zero).
- Describes the software roles: Arduino = low-level control, Pi = decision making and sensor fusion, communication via pyserial.

##### Final recommendations
- Be exhaustive: include every sensor, actuator, power source, and software module.
- Related items (all sensors, all motor drivers) visually.
- Configuration or dependency files (requirements.txt, .gitignore) implicitly as part of the Python build/deploy layer.

This detailed schematic will give the principal software engineer a clear, accurate view of how your mini-sumo bot’s hardware and software interact, helping guide any future enhancements or optimizations.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Hardware Layer
    subgraph "Hardware Layer"
        direction TB
        Batteries["Batteries"]:::hardware
        subgraph "Sensors"
            direction TB
            Ultrasonic["HC-SR04 Ultrasonic Sensor"]:::hardware
            IR["IR Line Sensors"]:::hardware
        end
        MotorDriver["L298N Motor Driver"]:::hardware
        Motors["Motors & Wheels"]:::hardware
        Speaker["Speaker"]:::hardware
    end

    %% Embedded Firmware Layer
    subgraph "Embedded Firmware (Arduino)"
        direction TB
        ArduinoUNO["Arduino UNO"]:::firmware
        ArduinoFirmware["Arduino Sketch\n(main.ino, omi.ino)"]:::firmware
    end

    %% High-Level Application Layer
    subgraph "High-Level Application (Raspberry Pi Zero)"
        direction TB
        PiZero["Raspberry Pi Zero"]:::high
        PythonApp["Python App\n(main.py)"]:::high
        PythonUtils["Sensor Utilities\n(sensors.py)"]:::high
        PySerial["pyserial Interface"]:::high
        AudioAsset["Audio Asset\n(John Cena MP3)"]:::high
    end

    %% Documentation
    subgraph "Project Docs & Config"
        direction TB
        README["README.md"]:::doc
        Requirements["requirements.txt"]:::doc
        Gitignore[".gitignore"]:::doc
    end

    %% Connections
    Ultrasonic -->|"Digital Read"| ArduinoUNO
    IR -->|"Analog Read"| ArduinoUNO
    ArduinoUNO -->|"PWM"| MotorDriver
    MotorDriver -->|"Drives"| Motors
    ArduinoUNO <-->|"Serial (UART/USB)"| PiZero
    PiZero -->|"pyserial"| PythonApp
    PythonApp -->|"Imports"| PythonUtils
    PythonApp -->|"Commands/Telemetry"| ArduinoUNO
    PiZero -->|"Audio Out"| Speaker
    PythonApp -->|"Plays"| AudioAsset

    %% Click Events
    click ArduinoFirmware "https://github.com/ezyrone/hackathon_blitzcrank/blob/main/Arduino/main.ino"
    click ArduinoFirmware "https://github.com/ezyrone/hackathon_blitzcrank/blob/main/Arduino/omi.ino"
    click PythonApp "https://github.com/ezyrone/hackathon_blitzcrank/blob/main/Python/main.py"
    click PythonUtils "https://github.com/ezyrone/hackathon_blitzcrank/blob/main/Python/utils/sensors.py"
    click AudioAsset "https://github.com/ezyrone/hackathon_blitzcrank/blob/main/Python/file/and-his-name-is-john-cena-sound-effect-(hd)-made-with-Voicemod.mp3"
    click Requirements "https://github.com/ezyrone/hackathon_blitzcrank/blob/main/requirements.txt"
    click README "https://github.com/ezyrone/hackathon_blitzcrank/blob/main/README.md"
    click Gitignore "https://github.com/ezyrone/hackathon_blitzcrank/blob/main/.gitignore"

    %% Styles
    classDef hardware fill:#f2f2f2,stroke:#999,stroke-width:1px
    classDef firmware fill:#cce5ff,stroke:#3385ff,stroke-width:1px
    classDef high fill:#d4edda,stroke:#28a745,stroke-width:1px
    classDef doc fill:#fff3cd,stroke:#ffcc00,stroke-width:1px
```
