arduinoSentry01.jpg
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:

NerfRelayNtbkScan01.jpg
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!

nerfGunRelay01.jpg

In the Maker Shed:

Makershedsmall

arduino duemilanove cropped Arduino Nerf sentry gun build: Relay firing circuit

Arduino Duemilanove

John Edgar Park

John Edgar Park likes to make things and tell people about it. He works in CG animation at DisneyToon Studios and writes for Make, Boing Boing, and other places online and in print. You can find him at jpixl.net and twitter @johnedgarpark — if you like that sort of thing.


Related
blog comments powered by Disqus

Related Supplies at Maker Shed

Follow

Get every new post delivered to your Inbox.

Join 28,384 other followers