AUTOMATIC SHOOTING GUN
I made an Automatic Shooting Gun which shoots just by the click of a computer mouse! For this I used a Strongarm Nerf gun... This is the video of me making the Automatic Shooting Gun ↓
So first talking about this.. let's say its semi-automatic and not fully automatic.. I have planned for making a full automatic gun which i will upload in the upcoming month.. So in this post i am gonna tell you how to make an easy gun like how i did!
HERE IS THE TUTORIAL FOR MAKING A SEMI-AUTOMATIC SHOOTING GUN!! I will also put the project repository in this post!!
First off.. before starting this tutorial.. let me tell the required items for it. Click on the points down below to know how they look like! We need:
- Arduino board (You can use any arduino.. here i used an Arduino UNO.. Arduino nano is preferable as it is a smaller board but still could do the works of an UNO Board)
- A Toy Gun (You can use any Gun you want or also a nerf gun.. I used a Nerf Strongarm gun)
- MG996R Servo
- Breadboard
- A Few Jumper wires (Depends on how long you want the wiring to be.. you can extend the wiring by using more jumper wires, for that you need Male to female jumper wires and Male to Male Jumper wires.. If you dont want to extend it, no problem :) you just need Male to Male jumper wires)
- An old phone charger or an unused one.. for powering up the servo.. or any 5V adapter with cable because we will cut the cable and use it as a power supply for our servos.(Make sure in the adapter it says 5V output or DC 5V..)
- 5mW Laser diode (It is not really necessary to use it.. but if you want a laser from your gun you need it.. and if you want the laser diode you also need another 5V charger for powering the laser up.. or use a laser pointer to avoid any complication)
- Usb Type A to Type B cable for connecting Arduino to computer or laptop(Arduino Uno and Arduino Mega can be connected with this cable but the other Arduinos need different cables)(This A to B Usb cable is the same cable used in most of the printers)
- Thread
Softwares required:
- Visual Studio | Any Version. You can download it from here.
- Arduino Studio | You can download it from here.
Make sure your power sources says OUTPUT-5V like this ↓
Or it must say DC 5V like this ↓
And if your 5V chargers have two wires attached like this ↓ The one which has a line on it is the negative wire.. For normal chargers the black colour is the negative and the red colour is positive.
So First, let's start by doing the hardware.. Lets start with 5V power supply we got.. So you have to cut the bottom part of the wire which is the side were you connect your charger to your phone **DO NOT CUT THE SIDE WITH THE ADAPTER** After cutting it must have two Black and Red wires like this:
A jumper wire is attached to it in the above pic.. you must also do like that.. for a clear pic of Step 2 see this ↓
You can use a soldering gun to attach the jumper and the wires or use a tape.. Here i used soldering gun and taped it at its metal exposed areas so that they don't touch each other.
And if your using a laser diode for your gun.. you can directly attatch the laser diode to the 5V power supply like this ↓ Check after the pic to know how to connect.
You have to connect the negative wire of the cable to the blue wire of the laser diode and the positive wire of the cable to the red wire of the laser i.e. blue wire of the laser to the black wire of the cable and red wire of the laser to the red wire of the cable. And again I strictly recomend using a soldering gun for this or hot glue gun is also ok but.. if you use tape the wiring can come out..
Now lets start with the MG995R Servos. You can actually use any servos. Take the attachment gears given with the servos and attach the one given in this pic.
After connecting the attachment, lets talk about the 3 wires hanging out from the servos. So the brown wire or the black wire is the ground, the red wire is the 5V input for the servo, the yellow wire is the PWM signal input for the servo (Here the PWM signals are the signals through which an Arduino communicates with a servo). This picture ↓ will be much clear.
Connect the Servos with a breadboard which connects the 5V power source like in the picture below. Here in this picture, the yellow wire comming out from the servo is the signal wire, the red wire which comes out of the servo is the 5V input and the black wire is its ground.
Now connect the servo with a thread and keep the thread as it can pull the trigger like this ↓
You can also attach the laser to your gun at this point like this ↓
You can download the code repository for this gun from here.
Then upload the code from arduino studio to your arduino board. Make sure you choose your correct port on which your arduino is connected
After that open my other code file on visual studio. Make sure you choose the correct port on that also for it to work! You can do it by going to form design and double click serialport1 from below the form and click properties (it will mostly be open in properties tab automatically) then in PortName type the Port which your arduino is connected as you saw from visual studio.
Congratulations you have succesfully completed the tutorial and you gun is ready! just plug in the power supplies run the visual studio program and now you have an automatic shooting gun!
