This project utilizes OpenCV and CVZone in Python to detect hand gestures via a webcam, sending commands to an Arduino. The Arduino controls LEDs based on the number of fingers visible, enabling real-time, interactive LED control through computer vision and serial communication.
- Hand Gesture Recognition using OpenCV & CVZone ποΈ
- Real-Time Finger Detection & Counting π’
- Serial Communication with Arduino π
- Dynamic LED Control Based on Finger Count π‘
- Live Visualization of Hand Gestures πΉ
π LED-Control-Using-OpenCV-Arduino
βββ ide.m.ino # Arduino code for LED control
βββ main.py # Python script for gesture detection & communication
βββ LED control live demo.mp4 # Demonstration video
βββ README.md # Project Documentation
- Arduino UNO
- LEDs
- Resistors
- Jumper Wires
- USB Cable for Arduino
- Webcam
- Clone the repository:
git clone https://github.com/yourusername/LED-Control-Using-OpenCV-Arduino.git
- Install the required Python dependencies:
pip install opencv-python cvzone mediapipe pyserial
- Upload
ide.m.inoto your Arduino UNO using the Arduino IDE. - Connect the hardware components as per the circuit diagram.
- Run the Python script:
python main.py
- Start the Python script to detect hand gestures.
- Hold your hand in front of the webcam and raise fingers to control LEDs.
- The number of raised fingers determines which LED(s) will turn on.
- The program will continuously update the LED states in real time.
- Press
ESC(ASCII 27) to exit the program and close the video feed.
Feel free to fork the repository, submit issues, or suggest improvements for better real-time detection and control.