# rajtilak-2020/robotic_arm architecture

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

- Interactive diagram: https://gitdiagram.com/rajtilak-2020/robotic_arm
- Repository: https://github.com/rajtilak-2020/robotic_arm

## Overview

##### Project type and purpose
- This is an embedded IoT-enabled robotics project: a programmable robotic arm driven by an ESP32 microcontroller.
- The ESP32 runs Arduino firmware (Robotic_Arm.ino), hosts a Wi-Fi access point, serves a web control panel, and handles WebSocket commands to move servos.

##### File structure
- Top-level files:
- Robotic_Arm.ino – the main Arduino sketch implementing setup(), loop(), Wi-Fi AP, AsyncWebServer, and WebSocket handlers.
- Assets/AsyncTCP-master.zip & ESPAsyncWebServer-master.zip – libraries unzipped and added to the Arduino libraries folder at compile time.
- LICENSE – MIT license.

##### README for additional insights
- It lists technologies: ESP32, servo motors, Arduino IDE, Wi-Fi.

##### Diagramming recommendations
- Use clear, labeled blocks for each component (e.g., ESP32, Servo Bank, Browser UI).
- Hardware (gray)
- Firmware modules (blue)
- Network (green)
- Client UI (orange)
- Rectangles for modules
- Clouds for network/Wi-Fi

##### Capturing essential architecture
- Don’t dilute with every line of code—group related functionality (e.g., all WebSocket handlers in one block).
- Record/playback state machine as a sub-component of firmware.
- Keep the client UI block explicit: sliders, buttons, WebSocket client.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Hardware Layer
    subgraph "Hardware Layer"
        direction TB
        ESP32["ESP32 Microcontroller"]:::hardware
        Servos["Servo Motors (joints)"]:::hardware
        PowerSupply(("Power Supply")):::hardware
    end

    %% Firmware Layer
    subgraph "Firmware Layer"
        direction TB
        WiFi["Wi-Fi Subsystem"]:::firmware
        AsyncHTTP["AsyncWebServer Module"]:::firmware
        AsyncTCP["AsyncTCP Module"]:::firmware
        WS["WebSocket Module"]:::firmware
        ServoCtl["Servo Controller Logic"]:::firmware
        RecordLogic["Recording/Playback Logic"]:::firmware
        Buffer((Record Buffer)):::storage
    end

    %% Network Layer
    subgraph "Network"
        direction TB
        AP(("Wi-Fi AP")):::network
    end

    %% Client UI Layer
    subgraph "Client UI"
        direction TB
        Browser["Browser UI (Control Panel)"]:::client
    end

    %% Connections
    PowerSupply --> ESP32
    ESP32 --> Servos
    Browser -->|HTTP| AsyncHTTP
    Browser -->|WebSocket| WS
    AsyncHTTP --> WS
    WS --> ServoCtl
    ServoCtl --> Servos
    WS --> RecordLogic
    RecordLogic --> Buffer
    RecordLogic --> ServoCtl
    RecordLogic --> WS
    WS -->|status updates| Browser
    ESP32 -.->|hosts| AP
    Browser -.->|connects to| AP

    %% Click Events
    click WiFi "https://github.com/rajtilak-2020/robotic_arm/blob/main/Robotic_Arm.ino"
    click AsyncHTTP "https://github.com/rajtilak-2020/robotic_arm/blob/main/Assets/ESPAsyncWebServer-master.zip"
    click AsyncTCP "https://github.com/rajtilak-2020/robotic_arm/blob/main/Assets/AsyncTCP-master.zip"
    click WS "https://github.com/rajtilak-2020/robotic_arm/blob/main/Robotic_Arm.ino"
    click ServoCtl "https://github.com/rajtilak-2020/robotic_arm/blob/main/Robotic_Arm.ino"
    click RecordLogic "https://github.com/rajtilak-2020/robotic_arm/blob/main/Robotic_Arm.ino"
    click Buffer "https://github.com/rajtilak-2020/robotic_arm/blob/main/Robotic_Arm.ino"
    click Browser "https://github.com/rajtilak-2020/robotic_arm/blob/main/README.md"

    %% Styles
    classDef hardware fill:#dddddd,stroke:#444,stroke-width:1px
    classDef firmware fill:#cce5ff,stroke:#004085,stroke-width:1px
    classDef network fill:#d4edda,stroke:#155724,stroke-width:1px
    classDef client fill:#ffe5b4,stroke:#ff8c00,stroke-width:1px
    classDef storage fill:#e2e3e5,stroke:#6c757d,stroke-width:1px

    class Buffer storage
    class PowerSupply hardware
    class AP network
```
