

Insert the stepper motor hat onto the Raspberry Pi. You will then have to hold the trigger down using tape or other means so that the internal switch is closed. The second option is to leave your gun intact, but solder the power and ground wires to the electrical contacts of the batteries instead. Although we used this option, we found it extremely difficult to reassemble our gun properly. The physical switch actuated by the trigger that you just disconnected will later be replaced by an electrical relay controlled by the Raspberry Pi. Remove the wires from this switch and solder them directly to your own longer power and ground wires and feed them out of the gun. The first, but perhaps more difficult option, is to take apart your gun and find the switch that gets closed when the trigger is pulled. The method of preparation depends on your airsoft or nerf gun model, but there are two options we found for attaching wires to our gun: Get all the 3D printable part files on our Patreon: Ĭheck out this video for a detailed walk-through on how to build it:īefore moving onto the next step, prepare your airsoft or nerf gun so it is ready to be mounted onto the turret when it is built. Use a nerf gun instead if you are planning on shooting people, never an airsoft gun! Since this device fires projectiles, please use the necessary safety precautions while operating the turret. Motion Detection uses openCV and computer vision to track moving targets in front of the camera.

Interactive allows you to control the turret remotely and stream live video. We created two separate operation modes: Interactive and Motion Detection. This project is small, lightweight and entirely battery operated. We used an airsoft gun for this project, but you can easily modify this build to use a Nerf instead. There is also an interactive mode so that you can control it manually from your keyboard. The gun turret is autonomous so it moves and fires the gun when it detects motion. In this project, we will build a motion tracking airsoft (or nerf gun) turret with a Raspberry Pi 3. Whether its those pesky possums always destroying your backyard vegetable garden, or your family members getting into your cookie jar, you can create your own security guard to protect against them. Luckily, using image recognition and motion detection software, we can build autonomous gun turrets to protect our most prized possessions even in our absence. We have many valuable possessions that need protection, but we can't be everywhere at once.
