A month ago, I would have told you that it is absolutely not possible. Then my wife gave me an awesome Nerf gatling gun for Christmas; last year she gave me an automatic chain gun. I realized that since both of these really require two hands to operate, I had one two many.

Fortunately this turned out to be rather simple to do. I’ve done several projects with Raspberry Pi, and have been rather skeptical of the capabilities of Arduino. To be perfectly honest, that hasn’t changed all that much…. comparing the two really is a like holding up a refrigerator to a full restaurant. But when you need cold food quickly, the refrigerator is exactly what you need!

The PIR sensor is a very simple thing, having only three pins. Plugging it into the Arduino with ground, 5v, and one of the input pins allowed it to power up and send a HIGH on the input when it detects motion. From there, it’s only a matter of using another pin to switch a relay which in turn triggers the gun.

PIR Sensor

Switching relay

This particular gun is perfect for such purposes. It doesn’t require any sort cocking action, nor are the darts fired via compressed air. Instead they are fed into place by a belt, then pushed into a chamber by a plunger of sorts. The chamber is enclosed on the left and right by spinning treaded wheels which catch hold of the dart and eject it through the barrel in the same way a baseball pitching machine works.

When I opened the gun’s casing, I found that the motion of pulling trigger caused two sets of contacts to connect and close the respective circuits, engaging the motors. There are three motors altogether: 1 which drives the belt and plunger assembly, and 2 (on the same circuit) which drive the ejection wheels.

Tying into that with the Arduino was a simple matter of soldering leads onto those contacts. I shorted the two negative contacts so that there would only be two leads coming out of the gun. Those leads were then hooked up to the relay so that when it is switched on, all three of the motors power up.

The Arduino code is very simple at this point. It simply checks for a HIGH return and outputs HIGH on the pin connected to the relay until the state changes.

I intend to modify this to implement a better timer of sorts so that it only shoots two or three darts per motion event. (I also have plans to add a Piezo buzzer to add some sound and further scare my victims!)

Trigger leads

Leads

Breadboard

Sensor slot

I have only used a breadboard at this point, although I intend to etch a board once I am done experimenting with further additions and enhancements. A RadioShack project enclosure I had on hand turned out to be the perfect size to hold the Arduino and the breadboard; so I cut a slot in the end to mount the PIR sensor. Finally I taped the whole thing on top of the gun. I do have plans to build a swiveling mount of some sort so that I can aim the sensor independently of the gun’s barrel, but a bunch of tape works fine for the time being.

I set up The Sentinel and summoned a coworker from the neighboring office:

Unfortunately none of the darts actually fired. You can hear that the motors powered up, and the belt feed engaged properly. However, the plunger which loads each dart into the wheel drive is not moving at all.

Upon investigation, I discovered that the action of pulling the trigger unlocks a mechanism that allows the plunger to move. So I found it necessary to move the location of the motor contacts and wire the trigger into the “pulled” position. After that quick fix, the gun was ready to try out again!

And one more for good measure:

UPDATE:

I have added a Piezo buzzer to the gun so that it plays music. There is a 1 in 5 chance that after it shoots it will play the “Mario Death” tune!