- Real-time hand tracking using webcam
- Detects when all fingers are raised
- Sends command to Arduino via serial
- Turns all LEDs ON when fingers are open, OFF otherwise
Install required libraries:
pip install -r requirements.txtMake sure your Arduino is connected and update the COM port in main.py:
serial.port = "COM3" # Replace with your actual COM portThen run:
python src/main.pyThis will open your webcam and start gesture detection.
- Arduino UNO (or compatible)
- 5 LEDs + 220Ω resistors
- Jumper wires
- Breadboard
Connect LEDs to:
- D8, D9, D10, D11, D12
Open src/sketch.ino in the Arduino IDE and upload to your board.
| Hand Gesture | Command Sent | LED Action |
|---|---|---|
| All fingers raised | '1' |
LEDs ON |
| Any finger down | '0' |
LEDs OFF |
- MediaPipe detects hand landmarks from webcam input
- If all 5 fingers are raised, it sends
'1'via serial - Arduino reads the serial and lights up all 5 LEDs
- If any finger is down, it sends
'0', turning off the LEDs
├── src/
│ ├── main.py # Python script (hand tracker)
│ ├── sketch.ino # Arduino sketch
│ └── assets/
│ └── circuit.png # Wiring diagram
├── requirements.txt
└── README.md
Uses:
- MediaPipe Hands
- OpenCV
- Arduino Serial Communication
Licensed under the MIT License. You can use, modify, and share this freely with attribution.
