Skip to content

edzdgx/auto-turret

Repository files navigation

Auto Turret with Raspberry Pi 3

Project Idea

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

Flow Diagram

Components

PiGPIO Pinout

Pin # Component
3 Y-axis Servo
5 Trigger Servo
6 Ground
11 X-axis Servo

Software Setup

  • 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

Hardware Setups

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.

Demo

Video Demo

About

Automatic paintball gun turret with Raspberry Pi 3 and OpenCV Face Detection

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages