
This project allows you to control an LED using hand gestures detected by your webcam. Python tracks your hand vectors, while the Arduino handles physical execution over a USB Serial link.
Pro Tip: Ensure your room has good lighting! MediaPipe tracking precision drops significantly in low-light environments, which can cause erratic LED switching behaviors.
Positive Leg (Anode) of your LED to Arduino Pin 13 through a 220Ω Resistor.Negative Leg (Cathode) directly to an Arduino port.GNDHardware Warning: Never connect an LED directly to a 5V/3.3V pin without a resistor; bypassing current-limiting components can permanently burn out the semiconductor diode or damage the microcontroller's I/O pin.
Execute these terminal blocks to prime your local Python engineering workspace environment:
pip install opencv-python to handle webcam frame capturing feeds.pip install mediapipe to load the localized hand landmark tracking mesh model framework.pip install pyserial to open up serial data pipe transfer access channels.Serial Port Errors: If the script crashes on launch, verify your configuration line: serial.Serial('COM3', 9600). Check Device Manager to make sure your Arduino is currently assigned to that specific COM channel.