Real-time hand tracking utilizing OpenCV and MediaPipe to control an Arduino LED circuit.
- Demo
- Features
- Installation Guide
- Usage
- Project Structure
- Troubleshooting
- Contributing
- Acknowledgements
- License
Screenshot demonstrating the project hardware layout.
This project runs in a terminal environment and relies on webcam access to detect gestures.
hand-gesture-arduino-led-control provides a real-time computer vision script designed for interacting with an external Arduino circuit.
Built to be responsive, easy to set up, and straightforward.
- Real-time Hand Tracking: Uses MediaPipe and OpenCV to accurately detect hands via your webcam.
- Gesture Detection: Detects when all five fingers are raised in the frame.
- Serial Communication: Translates gesture states into serial commands sent to a connected Arduino.
- Hardware Integration: Lights up a sequence of LEDs physically wired to an Arduino UNO when an open hand is shown.
Follow these steps to install gesturelight locally.
- Python 3.x
- Arduino IDE
- pip (Python Package Manager)
- Arduino UNO (or compatible board), 5 LEDs, 220Ω resistors, jumper wires, breadboard
git clone https://github.com/Huerte/gesturelight.git
cd gesturelightpip install -r requirements.txtAfter wiring your Arduino and uploading the sketch:
python src/main.py- Open
src/sketch.inoin the Arduino IDE and upload it to your board. - Ensure you have connected your LEDs correctly (Pins D8, D9, D10, D11, D12).
- Update the COM port in
src/main.py:serial.port = "COM3"(Replace with your actual COM port). - Run
python src/main.py. This will launch your webcam. - Raise all five fingers to light up the LEDs. Close your hand or lower any finger to turn them off.
gesturelight/
│
├── src/
│ ├── main.py # Python script (hand tracker)
│ ├── sketch.ino # Arduino sketch
│ └── assets/
│ └── circuit.png # Wiring diagram
├── requirements.txt
└── README.md
Serial Port Not Found
Error: could not open port 'COM3': FileNotFoundError...
Fix: Check your Arduino IDE or Device Manager to identify the correct COM port assigned to your board. Update
serial.portinsrc/main.pyaccordingly.
Still stuck? Open an issue with your error details and environment info.
Contributions are welcome and appreciated!
- Fork the Project
- Create a Feature Branch (
git checkout -b feature/NewFeature) - Commit Changes (
git commit -m 'Add NewFeature') - Push to Branch (
git push origin feature/NewFeature) - Open a Pull Request
- MediaPipe Hands — Hand tracking and landmark detection.
- OpenCV — Real-time computer vision capabilities.
Distributed under the MIT License. See LICENSE for details.
© 2026 Huerte. All Rights Reserved.
