Giter Club home page Giter Club logo

py-auto-x-y's Introduction

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

py-auto-x-y's People

Contributors

edzdgx avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.