I’m building an Arduino Nerf sentry gun. In the previous post, I showed how I wired and mounted the trigger connector. Now, I need a circuit to fire the gun from the Arduino microcontroller by bridging the two wires coming from the 1/8″ jack I put in the handle. I’m doing this is with a small, 5V relay wired to a digital pin and ground of the Arduino (my original plan called for a MOSFET, but the spot I wired to made a relay easier). Relays are electro-magnetic switches that can be opened and closed by energizing their coils. In this case, the low current, 5V from the Arduino is enough to do the trick all by itself. Here’s a snazzier circuit, if you have a less Arduino-friendly relay. My circuit also has a diode in it to prevent the collapsing magnetic field from frying the board. Here’s my sketch of this:
Here it is on a breadboard. I loaded a simple blink sketch on the Arduino, so that it pauses for four seconds, then fires the gun for one second, repeats. This is great for testing, and means I can now command a barrage of Nerf darts from my microcontroller. Watch out!
In the Maker Shed:
ADVERTISEMENT