# krushang004/hand-gesture-led-control architecture

> Architecture diagram of the GitHub repository krushang004/hand-gesture-led-control, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/krushang004/hand-gesture-led-control
- Repository: https://github.com/krushang004/hand-gesture-led-control

## Overview

This is a camera-to-LED gesture-control application: the Python program captures frames, detects one hand, counts extended fingers, displays the count, and sends changed counts over serial; Arduino firmware turns on the corresponding LEDs. The README also documents the hardware setup and 0–5 finger behavior. The Python entry point is the only sampled source; firmware behavior and wiring links are supported by README documentation rather than inspected sketch contents.

Main entry points: [`hand_gester.py`](https://github.com/krushang004/hand-gesture-led-control/blob/master/hand_gester.py) (Gesture app), [`arduino_code.ino`](https://github.com/krushang004/hand-gesture-led-control/blob/master/arduino_code.ino) (Arduino firmware), [`hand_landmarker.task`](https://github.com/krushang004/hand-gesture-led-control/blob/master/hand_landmarker.task) (Landmarker model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_vision["Vision and gesture processing"]
  node_python_app["Gesture app<br/>[hand_gester.py]"]
  node_landmark_model["Landmarker model"]
  node_mediapipe["MediaPipe detector"]
end

subgraph group_control["Serial and device control"]
  node_serial["Serial connection<br/>[hand_gester.py]"]
  node_firmware["Arduino firmware<br/>[arduino_code.ino]"]
end

subgraph group_hardware["LED hardware"]
  node_leds["LEDs"]
end

node_user(("User"))
node_camera["Webcam"]

node_user -->|"shows gestures"| node_camera
node_camera -->|"provides frames"| node_python_app
node_python_app -->|"configures model"| node_landmark_model
node_python_app -->|"detects landmarks"| node_mediapipe
node_python_app -->|"writes finger count"| node_serial
node_serial -->|"sends over USB"| node_firmware
node_firmware -->|"controls LEDs"| node_leds
node_python_app -->|"displays count"| node_user

click node_python_app "https://github.com/krushang004/hand-gesture-led-control/blob/master/hand_gester.py"
click node_landmark_model "https://github.com/krushang004/hand-gesture-led-control/blob/master/hand_landmarker.task"
click node_serial "https://github.com/krushang004/hand-gesture-led-control/blob/master/hand_gester.py"
click node_firmware "https://github.com/krushang004/hand-gesture-led-control/blob/master/arduino_code.ino"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_python_app,node_landmark_model,node_mediapipe,node_user toneBlue
class node_serial,node_firmware toneAmber
class node_leds toneMint
class node_camera toneIndigo
```

## Components

### Vision and gesture processing

- [Gesture app](https://github.com/krushang004/hand-gesture-led-control/blob/master/hand_gester.py): `hand_gester.py`
- [Landmarker model](https://github.com/krushang004/hand-gesture-led-control/blob/master/hand_landmarker.task): `hand_landmarker.task`
- **MediaPipe detector**

### Serial and device control

- [Serial connection](https://github.com/krushang004/hand-gesture-led-control/blob/master/hand_gester.py): `hand_gester.py`
- [Arduino firmware](https://github.com/krushang004/hand-gesture-led-control/blob/master/arduino_code.ino): `arduino_code.ino`

### LED hardware

- **LEDs**

### Other components

- **User**
- **Webcam**

## Connections

- User → Webcam: shows gestures (evidence: `README.md`)
- Webcam → Gesture app: provides frames (evidence: `hand_gester.py`)
- Gesture app → Landmarker model: configures model (evidence: `hand_gester.py`)
- Gesture app → MediaPipe detector: detects landmarks (evidence: `hand_gester.py`)
- Gesture app → Serial connection: writes finger count (evidence: `hand_gester.py`)
- Serial connection → Arduino firmware: sends over USB (evidence: `README.md`)
- Arduino firmware → LEDs: controls LEDs (evidence: `README.md`)
- Gesture app → User: displays count (evidence: `hand_gester.py`)
