Real-time prosthetic robotic hand controlled by live camera hand tracking.
Move your hand in front of a webcam β the robotic hand mirrors it instantly. No buttons. No keyboard. No manual input. Just your hand.
πΉ
assets/demo.mp4
β οΈ This image shows the prosthetic hand model. Real-time motion is demonstrated in the attached video.
Webcam β MediaPipe Hand Tracking β Python β Serial (USB) β Arduino β 5 Servo Motors
- A webcam captures your hand at ~30 FPS
- MediaPipe detects 21 hand landmarks per frame
- Python compares each fingertip position vs its knuckle joint to determine open/closed state
- A 5-value array
[Thumb, Index, Middle, Ring, Pinky]is built β1= open,0= closed - The array is sent over serial only when state changes β no spam, no lag
- Arduino receives the values, maps each to a servo pin, and smoothly sweeps to the target angle
- π₯ Fully camera-driven β zero manual input
- β‘ Low-latency real-time tracking (~30 FPS)
- π State-change gating β serial only fires on actual changes
- π€ Smooth servo motion β non-blocking 4Β°/tick sweep
- π‘οΈ Arduino buffer overflow protection β frame validation before parsing
- ποΈ Left/right hand awareness β correct thumb detection for both
- π₯οΈ Live HUD overlay β finger states + FPS + serial status
- π¨οΈ Full printable 3D model included (forearm, hand, wrist)
| Component | Details |
|---|---|
| Arduino | Uno or Mega |
| Servo motors | 5Γ standard hobby servo (e.g. SG90 or MG996R) |
| Webcam | Any USB webcam (720p or higher recommended) |
| USB cable | Arduino to PC |
| Power supply | Separate 5V for servos (don't power from Arduino 5V pin) |
| 3D printed parts | See 3d_model/ |
| Finger | Arduino Pin |
|---|---|
| Thumb | 3 |
| Index | 5 |
| Middle | 6 |
| Ring | 9 |
| Pinky | 10 |
Python 3.8+
Install dependencies:
pip install -r requirements.txtContents of requirements.txt:
opencv-python
mediapipe
pyserial
cvzone
Arduino IDE 1.8+ or Arduino IDE 2.x
Library required: Servo (built-in, no install needed)
- Open
arduino/prosthetic_hand_controller.inoin Arduino IDE - Select your board (Tools β Board β Arduino Uno/Mega)
- Select your port (Tools β Port β COMx on Windows,
/dev/ttyUSBxon Linux/Mac) - Click Upload
Open python/real_time_hand_tracking.py and set your serial port at the top:
SERIAL_PORT = "COM3" # Windows example
# SERIAL_PORT = "/dev/ttyUSB0" # Linux/Mac exampleThe script will also attempt to auto-detect your Arduino by its USB descriptor β so this is only needed as a fallback.
python python/real_time_hand_tracking.pyA window will open showing your webcam feed with a live HUD. Move your hand β the robotic hand will mirror it in real time.
Press Q to quit. All fingers will close safely on exit.
Python sends a single line over serial whenever finger state changes:
T,I,M,R,P\n
Example:
1,1,0,0,1
| Value | Meaning | Servo angle |
|---|---|---|
1 |
Finger open | 0Β° |
0 |
Finger closed | 180Β° |
Baud rate: 115200
All printable parts are in 3d_model/prosthetic_hand/ organized into three subfolders.
| File | Part |
|---|---|
RobCableBackV3.stl |
Forearm cable channel β rear |
RobCableFrontV3.stl |
Forearm cable channel β front |
RobRingV3.stl |
Forearm ring guide |
RobServoBedV6.stl |
Servo mounting bed (holds all 5 servos) |
servo-pulleyX5.stl |
Servo pulley Γ 5 |
TensionerRightV1.stl |
Cable tensioner |
| File | Part |
|---|---|
thumb5.stl |
Thumb finger |
Index3.stl |
Index finger |
Majeure3.stl |
Middle finger |
ringfinger3.stl |
Ring finger |
Auriculaire3.stl |
Pinky finger |
robpart2V4.stl β robpart5V4.stl |
Palm assembly parts |
robcap3V2.stl |
Palm cap |
topsurfaceUP6.stl |
Top surface plate |
WristlargeV4.stl |
Wrist connector β large |
WristsmallV4.stl |
Wrist connector β small |
| File | Part |
|---|---|
CableHolderWristV5.stl |
Wrist cable holder |
RotaWrist1V4.stl |
Rotating wrist joint β part 1 |
RotaWrist2V3.stl |
Rotating wrist joint β part 2 |
| Setting | Value |
|---|---|
| Material | PLA or PETG |
| Layer height | 0.2 mm |
| Infill | 30β40% |
| Supports | Required for finger parts |
| Perimeters | 3+ for structural parts |
MimicArm/
β
βββ README.md
βββ requirements.txt
βββ LICENSE
β
βββ arduino/
β βββ prosthetic_hand_controller.ino # Arduino servo controller
β
βββ python/
β βββ real_time_hand_tracking.py # CV hand tracking + serial
β
βββ 3d_model/
β βββ prosthetic_hand/
β βββ forearm/ # Servo bed, cable channels, pulleys
β βββ hand/ # Fingers, palm, wrist connectors
β βββ wrist/ # Rotating wrist joint
β
βββ assets/
βββ images/
βββ demo.mp4
Servos move in the wrong direction
Each servo's ANGLE_OPEN / ANGLE_CLOSED can be inverted per-finger in the Arduino file. Find the INVERT array at the top and set true for any finger that moves backwards:
const bool INVERT[5] = {false, false, false, false, false};
// Thumb Index Mid Ring PinkySerial port not found
- Windows: Check Device Manager β Ports (COMx)
- Linux/Mac: Run
ls /dev/tty*before and after plugging in Arduino - Make sure no other program (e.g. Arduino IDE Serial Monitor) has the port open
Hand not detected
- Ensure good lighting β MediaPipe struggles in dark or backlit conditions
- Keep your hand fully within the camera frame
- Try adjusting
min_detection_confidencein the Python script (default: 0.75)
Lag or frame drops
- Close other applications using the webcam
- Reduce
FRAME_W / FRAME_Hin the Python script to640, 480 - Ensure Arduino is on a direct USB port, not a hub
This project is licensed under the terms in LICENSE.
- MediaPipe by Google β hand landmark detection
- OpenCV β camera capture and display
- Arduino Servo library β servo control
