Tuesday, September 30, 2014

ZombieLARP Nerf Gun

© Paul White 2016

See the Imgur album here.

This was a side project I did during the Summer of 2014. My friend and I were attending a Live-Action Roleplaying (LARP) event nearby. This time, the theme was 'Zombie Apocalypse.' As part of the game, people were encouraged to bring their own Nerf weapons. At the beginning of the game, referees would assign damage levels to each weapon based on how cool they thought it was. Since higher damage -> more dead zombies, my buddy and I decided to kit out our Nerf guns to make them more impressive. The mods included re-painting, and adding a digital display to indicate number of shots fired, and current battery voltage, to indicate when new batteries should be installed. This short video illustrates the functionality:


Let's dig into the guts of how this thing works. This dartgun is a modified Nerf N-Strike Stryfe. This gun was selected because it uses an electric motor to accelerate darts as opposed to air pressure. This means it is fully automatic and could (in theory) have its motors over-driven to accelerate the darts even more quickly. We didn't end up going down this road, but that could be a future project. The logic is implemented on an Arduino Pro Mini clone, as shown in the extremely high-end schematic below. If you want to build a project like this for yourself, the source code is available for you to play with. This microprocessor was chosen for 4 main reaons:
  1. It was cheap as borscht
  2. It had a built-in voltage regulator, so that was one less thing to worry about dead-bug wiring in.
  3. It was an Arduino, so it was super easy to program.
  4. it was nice and compact, and would be easy to cram somewhere on the Nerf gun's body.
Here are the schematics of the hardware we used. The voltage divider on pin A7 is used to sample the battery voltage, we divided it down so that it would be within the sampling range of the microprocessor's analog-digital converter.
ZombieLARP Nerf Gun Schematic
ZombieLARP Nerf Gun IR LED schematic

Here's a cross-section of the finished dart gun. Note how I painted the interior of the magazine bay: this was so the gun wouldn't look stupid with the magazine removed. Note the seven-segment displays and accompanying circuitry in the transparent compartment at the rear, and the additional wiring on the motor module:
ZombieLARP Nerf Gun Cross-Section
The darts are counted using a simple IR LED and wavelength-matched phototransistor. The LED is always on, and the phototransistor is blocked momentarily when a dart passes through the muzzle on its way to smoke a zombie. (Note that this required me to cut a small notch in the muzzle to allow the phototransistor to see the LED) This assembly is shown in eye-searing detail in this image:
ZombieLARP Nerf Gun IR Detail
My friend and I wanted to patch the sensing/control circuitry into the Nerf gun's original power circuitry, so we could mooch off the batteries. This was done by wiring the VCC/ground pins in parallel with the rest of the gun's circuitry. The Nerf gun is basically wired as a bunch of switches in series, and if all the switches are closed, the motor circuit will be completed and the two motors will spin and shoot darts. This actually ended up causing a problem for us, since the motors would draw so much current from the batteries that the voltage across the batteries would drop below the microprocessors operating voltage of 5V as they encountered resistance accelerating a dart. This bug was discovered days before ZombieLARP was supposed to start, so we resolved it by simply placing a bunch of capacitors hat I had on hand across the batteries, to smooth the voltage and maintain the necessary 5 V. (this is the 1mF capacitance in the first figure)

The sensor switches are located in the following locations:
  1. Magazine Detector
  2. Jam door
  3. Trigger (button underneath actual trigger. If the other sensors are depressed, pushing this button will cause the motors to spin up)
ZombieLARP Nerf Gun Motor Circuit Detail
Note that this is NOT the original order of operations, we modified it so that the magazine detector would come first, so that it could be sampled by the microcontroller to detect if a magazine was present.

I hope you enjoyed this expose!

Here are the libraries/datasheets for the parts we used:
Seven Segment display: http://www.lumex.com/specs/LDD-C514RI.pdf
SevenSeg Library: http://playground.arduino.cc/Main/SevenSeg

No comments:

Post a Comment