Member-only story
Controlling LEDs with Hand Gestures Using Python and Arduino
Introduction
I recently completed a project that combines computer vision with electronics. The goal was to control LEDs using hand gestures detected through a webcam.
For this project, I used Python to detect my fingers and an Arduino Uno to control five LEDs in real time.
Technologies and Components
Software:
- Python
- * OpenCV
- * MediaPipe
- * PyFirmata2
Hardware:
- Arduino Uno R3 CH340
- * 5 LEDs
- * 5 resistors
- * Breadboard
- * Jumper wires
- * Webcam
How Does It Work?
The project combines computer vision and hardware control in a simple system.
- Hand Detection
OpenCV captures video from the webcam, while MediaPipe detects the hand and identifies its 21 landmarks.
2. Finger Recognition
Python processes the detected landmarks to determine which fingers are raised. Each finger is represented by a binary value: 1 for a raised finger and 0 for a lowered…









