OpenCV Hand-Tracking Turret
This Arduino and OpenCV-based turret autonomously scans the environment at random angles and locks onto a detected hand using real-time computer vision. The system reacts with servo movement, and LCD status display.
Demo Video
Watch the turret randomly scan, detect a hand using OpenCV, and lock on with precision-controlled servo movement.
Components used
- Arduino Uno (R3 being compatible with OpenCV)
- MG996R Servo motor x2 (pan + tilt)
- DFRobot RGB LCD (I2C)
- Laser diode module
- Logitech C920 webcam (or equivalent)
- External 5V 2A power supply x3 (for servos and laser module)
- Breadboard x1
- Jumper wires x a lot
- Computer running Python + OpenCV
How It Works
1. In idle mode, the turret randomly pans and tilts using Arduino servo logic.
2. The OpenCV Python script tracks hand motion using a webcam and sends position data via serial.
- When a hand is detected, the turret overrides random movement and locks onto the hand's position
- LCD displays status: "System Ready", "Scanning area...", or "Object detected!"
3. If tracking is lost, the turret returns to idle scanning mode.
4. The system uses serial communication between Python and Arduino for precise angle control.
5. WASD keys can be used for servo calibration during runtime if needed.
The Code
All code for the Arduino + Python OpenCV turret is available on GitHub:
View Code on GitHub