An embedded system that controls a paintball gun to automatically aim at desired location and pull the trigger. The system is controlled using Raspberry Pi 3, 3 servo motors are used in the design, including one that controls x-axis, one that controls y-axis, and one that controls the trigger. There is also a PiCamera V2 that does color detection and tracking with OpenCV library. Each frame the camera captures is masked and analyzed, and coordinate of the center of the tracked color will be calculated. Then servos will be adjusted through the coordinate information. Servos are controlled by PWM signal that the GPIO pins send out.
- Auto-turret that fires paintballs at desired target (face)
- PiCamera Module V2 to stream images to be processed
- OpenCV library used for facial recognition/ color detection
- 3 servos to control x-axis, y-axis, and trigger of paintball gun
- Raspberry Pi 3 to control and coordinate all parts
- 3 * HS805BB+ servos
- 1 * Raspberry Pi 3
- 1 * PiCamera Module V2
- 1 * CO2 tank
- 1 * Paintball Gun
- 1 * Breadboard for GPIO
- 1 * 5V Power Source
Pin # | Component |
---|---|
3 | Y-axis Servo |
5 | Trigger Servo |
6 | Ground |
11 | X-axis Servo |
- For facial recognition, use OpenCV library:
sudo apt-get install python-opencv
- For processing frame on PiCamera, use picamera.array library:
sudo apt-get install python-picamera
- Used PWM signals to control motion of servos
Raspberry Pi: Connect Camera Module V2 to Raspberry Pi with silver band facing the HDMI port. Connect mouse and keyboard using USB port. Connect HDMI with a screen.
Servos: There are 3 wires connected to each servo (red/black/yellow) each representing power/ground/signal. Red should go directly into an external battery, black should go to ground on breadboard (which is the common ground for all batteries and servos.