"Electrical" Airsoft gun + Arduino

Hey Guys,

First I’ll tell you what I’m doing. I want to shoot the electric airsoft gun on my computer(press a key) without pulling the trigger with the arduino connected. How do I do it (parts, breadboard setup, etc.)?

Background info: The battery has two separate wires ( power, ground) and the motor that pulls the spring to shoot the pellets has an additional power and ground wire. Usually the battery ground wire is directly connected to the motor and the battery power wire and motor power wire is connected to a separate object. When you pull the trigger it connects the battery p wire and motor p wire together through the object separating the two.

I’ve used a servo as a trigger and in a sense I’m pulling the trigger on my computer, but thats more mechanical.

What did your local google searches show?

MonauralProduct: Hey Guys,

First I'll tell you what I'm doing. I want to shoot the electric airsoft gun on my computer(press a key) without pulling the trigger with the arduino connected. How do I do it (parts, breadboard setup, etc.)?

Background info: The battery has two separate wires ( power, ground) and the motor that pulls the spring to shoot the pellets has an additional power and ground wire. Usually the battery ground wire is directly connected to the motor and the battery power wire and motor power wire is connected to a separate object. When you pull the trigger it connects the battery p wire and motor p wire together through the object separating the two.

I've used a servo as a trigger and in a sense I'm pulling the trigger on my computer, but thats more mechanical.

You'll essentially want a motor driver board; since electric airsoft gun motors only need to rotate in one direction, you can homebrew something using a relay, transistor, or MOSFET, with the latter two being completely electronic, while the relay being the easiest to interface with. But first, you need to know what the current requirements for the motor are. I don't know much about airsoft guns, but if you can run it "dry" (that is, firing no bullets - just "air"), then you can gauge how much current the motor requires using a multimeter (hopefully it isn't over 10 amps, which it probably won't be - because most multimeters won't measure more than that). Once you know the current requirements, then you can shop for an appropriate driver or parts (relay, transistor, MOSFET) to actuate the motor.

Basically, knowing the current of the motor will allow you to select the proper sized relay (contact current rating - if you wanted to just eyeball it, a 12VDC 15 amp Bosch Automotive SPST relay would likely work fine), or the proper sized transistor or MOSFET. Note that you'll require more parts than just one of these three items (and in the case of a relay, you'll need a transistor or MOSFET to actuate it, but it will be a smaller item than what would be needed to directly drive the motor) to drive your motor, which is why a pre-built motor controller might be a better deal (in fact, a cheap RC brushed motor controller might be the best deal overall - a simple one meant for airplanes, since you don't need reverse, would be ideal - just don't buy a brushless motor controller, unless your airsoft gun uses a brushless motor and you know the specs of it, but I doubt it does, given your description of the motor, battery and switch operation).

Beyond that, there are plenty of tutorials out there on how to hook up relays, transistors, MOSFETs and such to control motors - a great source is here:

http://www.thebox.myzen.co.uk/Workshop/Introduction.html

This is Mike Cook's website (aka Grumpy_Mike here on the forums) - at the bottom of that page you'll see some links to tutorials on how to hook up motors and such to the Arduino. It should help you get a handle on what you want to do...

Good luck on your project! :)

Thanks for the help cr0sh

Also would the motor shield for the arduino work in this case?

Only today: http://arduino.cc/forum/index.php/topic,68218.0.html

MonauralProduct:
Also would the motor shield for the arduino work in this case?

Without knowing how much current the motor in your airsoft gun uses, the answer cannot be stated with certainty; however, if you are speaking of an L293-based motor shield, then the answer is likely “no”, as I would have to assume that such a motor in an airsoft gun takes way more current than that shield can supply. However, if you are speaking of an L298-based motor shield (especially one that can operate in bridged mode), then the answer is “maybe” - measure your current first, then go shopping.

Otherwise you’ll hook the darn thing up, blow your shield (and flush your money down the toilet) and wonder where you went wrong (hint: you didn’t measure your current)…

Likely - even if either motor shield could support such a motor, they would be overkill, because you only need to spin the motor in one direction only; a relay, a 2n2222 NPN transistor, a diode, and a resistor, and piece of protoboard shouldn’t cost even $10.00 USD (much less if you can shop surplus).

Alright thanks. I'll follow up later as lunch is around the corner.