# m-saad-k/robotic-servo-hand-controlled-raspberry-pi-5-and-pi-camera-with-mediapipe architecture

> Architecture diagram of the GitHub repository m-saad-k/robotic-servo-hand-controlled-raspberry-pi-5-and-pi-camera-with-mediapipe, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/m-saad-k/robotic-servo-hand-controlled-raspberry-pi-5-and-pi-camera-with-mediapipe
- Repository: https://github.com/m-saad-k/robotic-servo-hand-controlled-raspberry-pi-5-and-pi-camera-with-mediapipe

## Overview

This Raspberry Pi application captures camera frames, uses MediaPipe landmarks to determine finger positions, and maps those results to servo angles while displaying a live preview. The README also describes the Raspberry Pi camera and Python-environment setup, but that setup is not part of the runtime architecture. The graph reflects the sampled source; the imported speech library is unused, and no speech capability is documented.

Main entry points: [`hand-tracker-code/Cam_Controlled_Servo_Hand.py`](https://github.com/m-saad-k/robotic-servo-hand-controlled-raspberry-pi-5-and-pi-camera-with-mediapipe/blob/main/hand-tracker-code/Cam_Controlled_Servo_Hand.py) (Hand controller), [`hand-tracker-code/module.py`](https://github.com/m-saad-k/robotic-servo-hand-controlled-raspberry-pi-5-and-pi-camera-with-mediapipe/blob/main/hand-tracker-code/module.py) (Landmark helpers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_capture["Frame capture"]
  node_controller["Hand controller"]
  node_camera["Pi camera"]
end

subgraph group_vision["Hand analysis"]
  node_landmark_module["Landmark helpers<br/>[module.py]"]
  node_mediapipe["MediaPipe Hands"]
  node_finger_logic["Finger detection"]
end

subgraph group_output["Output control"]
  node_preview["Live preview"]
  node_servos["Servo hand"]
end

node_operator(("Operator"))

node_operator -->|"starts"| node_controller
node_controller -->|"captures frames"| node_camera
node_camera -->|"returns frames"| node_controller
node_controller -->|"requests landmarks"| node_landmark_module
node_landmark_module -->|"processes frames"| node_mediapipe
node_mediapipe -->|"returns landmarks"| node_landmark_module
node_landmark_module -->|"returns positions and names"| node_controller
node_controller -->|"checks finger positions"| node_finger_logic
node_controller -->|"shows frames"| node_preview
node_controller -->|"sets servo angles"| node_servos

click node_controller "https://github.com/m-saad-k/robotic-servo-hand-controlled-raspberry-pi-5-and-pi-camera-with-mediapipe/blob/main/hand-tracker-code/Cam_Controlled_Servo_Hand.py"
click node_landmark_module "https://github.com/m-saad-k/robotic-servo-hand-controlled-raspberry-pi-5-and-pi-camera-with-mediapipe/blob/main/hand-tracker-code/module.py"
click node_finger_logic "https://github.com/m-saad-k/robotic-servo-hand-controlled-raspberry-pi-5-and-pi-camera-with-mediapipe/blob/main/hand-tracker-code/Cam_Controlled_Servo_Hand.py"

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_controller,node_camera toneBlue
class node_landmark_module,node_mediapipe,node_finger_logic toneAmber
class node_preview,node_servos toneMint
class node_operator toneIndigo
```

## Components

### Frame capture

- [Hand controller](https://github.com/m-saad-k/robotic-servo-hand-controlled-raspberry-pi-5-and-pi-camera-with-mediapipe/blob/main/hand-tracker-code/Cam_Controlled_Servo_Hand.py): `hand-tracker-code/Cam_Controlled_Servo_Hand.py`
- **Pi camera**

### Hand analysis

- [Landmark helpers](https://github.com/m-saad-k/robotic-servo-hand-controlled-raspberry-pi-5-and-pi-camera-with-mediapipe/blob/main/hand-tracker-code/module.py): `hand-tracker-code/module.py`
- **MediaPipe Hands**
- [Finger detection](https://github.com/m-saad-k/robotic-servo-hand-controlled-raspberry-pi-5-and-pi-camera-with-mediapipe/blob/main/hand-tracker-code/Cam_Controlled_Servo_Hand.py): `hand-tracker-code/Cam_Controlled_Servo_Hand.py`

### Output control

- **Live preview**
- **Servo hand**

### Other components

- **Operator**

## Connections

- Operator → Hand controller: starts
- Hand controller → Pi camera: captures frames
- Pi camera → Hand controller: returns frames
- Hand controller → Landmark helpers: requests landmarks
- Landmark helpers → MediaPipe Hands: processes frames
- MediaPipe Hands → Landmark helpers: returns landmarks
- Landmark helpers → Hand controller: returns positions and names
- Hand controller → Finger detection: checks finger positions
- Hand controller → Live preview: shows frames
- Hand controller → Servo hand: sets servo angles
