Introduction: Autonomous Sentry Turret

Picture of Autonomous Sentry Turret


The Autonomous Sentry Turret is a standalone system capable of detecting and neutralizing unwanted intruders via a barrage of soft foam darts. Built for the office environment, the AST is a powerful piece of hardware that needs no human input (although you can remotely disable it, for y'know, safety reasons). Consisting of a modified electric Nerf gun mounted on servo mechanism, the machine is Intel Edison-powered and fitted with a long-range lidar and motion sensor. Read along to see how it's made!

New to Arduino? If this is all a bit above your head, or you need a quick refresher, I recently wrote a comprehensive Arduino guide to bring you up to speed before you try to tackle the turret.

Step 1: Parts and Materials

Picture of Parts and Materials

Step 2: Toy Gun Modification Part 1

Picture of Toy Gun Modification Part 1

The first step on our path to world, ehem, office domination begins with disassembling the nerf gun. I chose the CS-18 N-Strike Elite Rapidstrike as the heart of the turret, as it is reasonably compact and electronic, which means we'll be able to modify it for easy control. The gun has a lot of tiny parts that need to be removed, so I've broken up the modification into many separate steps.

First, flip the gun to lay on its side with holes up. Exercise your dominant hand, grab a Phillips head screw driver and begin the process of removing the screws. All 22 exterior screws are accessible from the same side, with the exception of the battery cap. The tail stock has screws as well, but it is a standalone assembly that pops right out when the case is open. The case doesn't have any tabs, so you can gently pry it apart once you're confident the screws are removed.

Step 3: Toy Gun Modification Part 2

Picture of Toy Gun Modification Part 2

The battery case has four captive screws that need to be loosened to fully separate the gun body into two parts. Once the case is out, it can be set aside, since the entire turret will be powered by a single Lithium battery anyhow. The two halves of the gun body are only connected by the negative battery lead, so you'll need to pull this out in order to fully separate the case. Once the body is split, let the loose plastic bits fall out and remove the tail stock.

Step 4: Toy Gun Modification Part 3

Picture of Toy Gun Modification Part 3

At its core, the gun really only has two main mechanisms: a linear actuator that pushes the darts, and a pair of drums that accelerate the darts down the barrel. It would be quite possible to make a super compact version that simply placed these in a custom enclosure, but for the sake of time it is easier just to modify the gun. In order to make the next steps easier, we'll need to unscrew the drum, linear actuator, and trigger mechanisms. They are also held in with a handful of Phillips screws.

Step 5: Toy Gun Modification Part 4

Picture of Toy Gun Modification Part 4

With the mechanisms separate from the case, we can now dive into modifying the actual circuit. The gun has a lot of momentary safety switches to prevent the gun from running without being properly closed and triggers held. We'll be controlling this electronically, so rather than physically closing the switches, we'll just solder them permanently.

Red Wire:

This is the main power wire from the battery case. Since we won't have the case in place, we can just snip the wire after the switch and use this as the 6V+ lead.

White Wire:

This switch engages the accelerator drums. At first I thought it might be useful to spin them up via a separate circuit, but in practice the gun shot just as far when both the drums and actuator were turned on simultaneously. Simply cut the wire leading to the switch and solder it to the board where the other wire from the switch was previously.

Grey Wire:

This is a simple ground wire. Snip it at both ends to remove it from the circuit.

Blue, Green, and Brown Wires:

These are attached to the trigger switch. These can just be shorted across the DPDT switch. Make sure they don't short to each other!

Step 6: Painting

Picture of Painting

This step is quite optional, but give the turret a little more intimidating look. With the electronics removed, I decided to coat nearly everything in a couple coats of black paint+primer. Now is also a good time to cut the leg and body plates from 1/4" plywood. I've attached the vector profiles above.

Step 7: Sensor Mount

Picture of Sensor Mount

On to the sensor mount! This component provides a secure mounting place for the PIR sensor, LIDAR, and system status LEDs. I extended the wires from the LEDs and sensor by a couple of feet. The LIDAR mounts on top of the case and has its own extension wires, so we'll get to that later. The battery case nuts are 4-40, so I designed the mount plate to fit right over where it used to be with three new 1" 4-40 screws.

Step 8: Toy Gun Modification Part 5

Picture of Toy Gun Modification Part 5

With the gun painted, its circuit modified, and the sensor plate built, it's time to pack everything back into the gun body. There's very little clearance around the drum mechanism, so the wires from the PIR sensor and LEDs need to be fished through its base. After that, the power wires for the gun and sensor need to be retained by the original retainer piece, which you can see between the two mechanisms in the second photo. The wires extend out the top of the gun (soon to be the bottom) near the linear actuator. With everything in place I suggest testing the power connections one last time before sealing the gun up as it's quite tedious to screw and unscrew.

Step 9: Laser Mount

Picture of Laser Mount

The laser fits into a small aluminum tube that fits where the gun "sight" pieces used to be. The provides a mounting point for the laser, as well as a rigid, yet non-permanent, way to adapt the base of the gun to the servo mechanism.

First, screw the two riser plates into the dual channel plate

Then, slide the risers through the center hole.

Extend the laser wire leads by a foot. Extend the signal wire by two feet.

Wrap a small amount of electrical tape around the laser to increase its diameter.

Stuff the laser into the end of the tube.

Fit the tube into the base of the gun and fasten any loose screws to secure it.

Step 10: Lidar Mount

Picture of Lidar Mount

Extend the LIDAR VCC, GND, and I2C lines by a couple feet. (I used ribbon wire to keep things compact.

Mount the LIDAR to the sensor plate with four 6-32 x 1/2" spacers and screw in with four 6-32 x 3/8" screws from both sides.

Fold and tape the LIDAR wires down the side of the gun.

Combine the common 5V VCC wires and the common ground wires and heat shrink them.

Step 11: Main Circuit

Picture of Main Circuit

The circuit connections are split between the protoboard and jumpers between the Edison and PWM board. I've attached the electrical diagram above so you can see how everything connects. The protoboard mostly serves as a power bus for the 7.4V and 5V lines to connect everything. I broke out some connections to male headers to allow temporary connections for the LED. The radio receiver and power regulator both have their own female headers for mounting to the board as well. The headers on the PWM board provide a lot of great connection points for ground and VCC. Since I2C is a shared bus, I connected the SCL and SDA lines from the PWM board to the Edison and the lines from the Lidar to the remaining headers on the PWM board. The terminal block on the PWM board should be used as the main power input from the batter connection as it has a built-in high current polarity protection circuit. The Edison and PWM board are both screwed into the larger rear plates with 4-40 and 2-56 screws respectively.

Step 12: Power System

Picture of Power System

Attach the male XT60 connector to the power leads from the battery pack (double check polarity!)

Attach the female XT60 connector to a ground wire, and the positive lead to the one of the SPST switch terminals.

From the other switch terminal, attach a power lead as well as a higher gauge wire.

Solder a 1K resistor to the higher gauge wire and the other end to the anode of an LED.

Solder the cathode of the LED to the common ground wire/

Fit the LED panel adapter, switch and LED into the small wood plate with three holes.

Attach a piece of velcro to the battery to the outer mount plate.

Step 13: Base and Riser

Picture of Base and Riser

(2x) Screw a flat 1" shaft collar adapter to a dual channel plate

Screw the plates to both ends of a one inch by six tube.

Attach the base plate to the output of the servo block.

Attach a beam to the middle of the top plate.

Attach two round plates to the ends of the long channel bracket.

Step 14: Leg Assembly

Picture of Leg Assembly

Lay a leg plate flat on a table.

Per leg, pop in eight of the spacer pieces with the triangles pointing down towards the tapered end of the leg.

Loosely bolt (2") in the top piece (with the eight hole pattern) to the inset piece (with a single hole).

Place the other leg plate on top and bolt (1-3/4") the three leg plates together.

Screw the legs to the base plates at the ends of the long channel.

Step 15: Software

Picture of Software

The software is a single Arduino style C++ sketch running on the Edison. I've zipped the code as well as the associated and library for the LIDAR Lite. Once the library has been added to your IDE, you can download the code to the Edison!

Step 16: Loading Tips

Picture of Loading Tips

Load cartridge with 18 eighteen darts and pack it in. Sometimes the darts don't align properly with the linear actuator, so they need to be adjusted. Simply pop it forward with your finger until the dart rests right in front. This will prevent a jam.

Step 17: Operation

Picture of Operation

The turret has four modes of operation that autonomously switch states, but it can also be explicitly configured with the remote.

Disarmed (Button B):

LED: The green LED will be lit.

SENSORS: Lidar readings are stored at roughly 10 degree intervals. PIR readings are ignored.

LASER: The laser is on.

SERVO: The servo sweeps continuously with brief pauses while gathering LIDAR readings.

MISC: The Edison with enter this state on boot.

Armed (Button A):

LED: The red LED will be lit.

SENSORS: Lidar readings are stored at roughly 10 degree intervals. PIR readings are ignored.

LASER: The laser is on.

SERVO: The servo sweeps continuously with brief pauses while gathering LIDAR readings.

MISC: The turret records LIDAR readings at 10 degree intervals across a 100 degree range of motion. If a sensor reading has been taken previously and if the absolute value of this change is greater than a certain threshold, the turret will enter firing mode.

Firing (Button C):

LED: The red LED will be lit.

SENSORS: Lidar and PIR readings are ignored.

LASER: The laser is on.

SERVO: The is paused at the current angle for the duration of firing.

MISC: This is the only state when the gun is powered via relay. After firing the turret will go to sleep to allow a new magazine to be reloaded.

Asleep (Button D):

LED: The green and red LEDs will be off.

SENSORS: LIDAR readings are ignored, but PIR readings are stored.

LASER: The laser is off.

SERVO: The servo is stationary.

MISC: The unit will wait until the PIR detects motion and then enter disarmed mode to continue gathering readings. As is this will require someone to manually re-arm the turret with the remote. The code will have to be edited to switch to armed mode to have a totally standalone solution. The gun can usually fire about three separate times before requiring a new magazine.

Comments

buoyantair (author)2016-07-25

Awesome! :D

Salvagione (author)2015-12-01

OK, can I get the paintball upgrade that's waterproof? I see this as the perfect deer deterrent. And I'll be able to identify the offenders, during the day, by their colorful spots!

Aleator777 (author)Salvagione2015-12-01

Sure, $5k and I'll figure that right out!

AndrewW124 (author)Aleator7772016-04-13

Not for nothing, I'll shoot them with all the pretty colors you want for 2.5K. Plus meals. Lol

Samiraawong (author)2016-04-01

Love it!!!!

The Science Brony (author)2016-03-11

Don't let trump see this...

Fission_Chips (author)2016-02-20

*cough cough* Portal *cough cough* Nice job!

CannonF0der (author)2016-02-15

okay this is just ,freaking amazing!!!

nerfrocketeer (author)2016-02-08

Awesome! (Late comment, but still).

nerfrocketeer (author)2016-02-08

Awesome! (Late comment, but still).

DougB4 (author)2016-01-08

I am excited to build this for my nephew, it will help keep his sister out of his room!

So far I am getting all the parts and have modified the nerf gun. However, I was reviewing the circuits and I cannot tell where the Lidar connects to the Edison? I do not see a pin designation.

Thanks!

DEX155 (author)2015-12-03

it can be deactivated with a magnet being thrown at it or a stick in the gears

Derpycow45 (author)DEX1552015-12-03

Wack it with a stick!

Sledgehammer would shut it down.... so would a nuke... :)

Tony--K (author)2015-12-03

Awesome project!!

I'm just getting started with circuits, and I was wondering if there's a specific reason for using the Intel Edison with Arduino breakout, instead of an Arduino?

Derpycow45 (author)2015-12-03

By the way there arent any gears, its gravity fed with a backpack.

DEX155 (author)2015-12-03

and the USA government will probably be talking to you soon

DEX155 (author)2015-12-03

Couldn't you add a robotics chip with a wireless adapter to make it wireless or programmed for colors like for paintball

Derpycow45 (author)2015-11-30

Can you use paintball?

Aleator777 (author)Derpycow452015-12-01

It could definitely be readily adapted to trigger a paintball/bb gun. The when the turret is "firing" it just triggers a relay to complete the Nerf gun circuit, so it could be swapped out for an electrically-triggered device.

DEX155 (author)Aleator7772015-12-03

Brilleant

Derpycow45 (author)Aleator7772015-12-03

I waw wondering because i had a paintball minigun drawn out and planned, and that i was looking for a sentury that would be good and not very expensive.

Funky Diver (author)Derpycow452015-12-03

Easily. If your trigger is electronic, just do as the instructible, if it's mechanical just use a solenoid. There's a pretty great one on YouTube from a couple of years ago that you may be able to draw inspiration from. Full auto, using an autoshocker if memory serves.

Yonatan24 (author)Derpycow452015-12-01

Probably, If you build it differently...

DEX155 (author)2015-12-03

Awesome im totally trying this

laith mohamed (author)2015-12-03

Thank you for share it , its awesome ^_^

FirstSpear (author)2015-12-02

Absolutely brilliant, you wonderful nutter. I do love Instructables.

Made me a bit sad, though, reminded me that we are never going to see Half-Life 3. :(

anul20 (author)FirstSpear2015-12-02

Half life 3 is confirmed to be coming. The file for it is in the new source 2 engine that was released along be with left 4 dead 3, which will come first.

FirstSpear (author)anul202015-12-03

If that's a fib, it's a cruel one. You got a source for that? Meantime I'll do some searching. Everywhere says no, so far. Nothing on Steam, that I can find.

If true, you've made an old man very happy.

FirstSpear (author)FirstSpear2015-12-03

...meant to add that there's a full size replica Gravity Gun on UK Amazon for around £300 - bet Adam from Mythbusters has one. Probably doesn't work, though. Always something.

swanthog (author)2015-12-02

How much did it cost you?

NINJAPRO (author)2015-12-01

this would be awesome for airsoft.

Chakazuluu (author)2015-12-01

I was hoping to adapt this to mount a video camera on to follow me but after reading I see that won't work - oh well...

Aleator777 (author)Chakazuluu2015-12-01

You could adapt this to the Raspberry Pi and use some of the face tracking with the camera and the Open CV tutorials. I also considered using the PixyCam, but it only does color tracking for now.

Chakazuluu (author)Aleator7772015-12-01

Hmm..I didn't think of that - thanks I will look into it...

BradBuilds (author)2015-11-30

Awesome!

Aleator777 (author)BradBuilds2015-12-01

Thank you!

JayWeeks (author)2015-11-30

"Delightful!"

Aleator777 (author)JayWeeks2015-12-01

indeed :)

bravoechonovember1 (author)2015-11-30

:) I imagine that a 3D printed part would make it look like a portal turret

That would be an excellent addition!

simply add some audio and you're all set?
"Are you still there?"

Lol, I was about to say that very thing! '3d print a white casing and make it a portal turret'! :D

grim2104 (author)2015-12-01

smart idea but you could use a Vulcan in place of the nerf gun you are using

Aleator777 (author)grim21042015-12-01

I looked into using the vulcan, but I liked the design of this blaster and it was nice and symmetrical, which made balancing the turret much easier.

JeffS89 (author)2015-12-01

I like everything about it except for lack of stability.

Aleator777 (author)JeffS892015-12-01

Thanks. It is a bit wobbly and could definitely benefit from more weight in the feet. The cog is really high as is and allows for much jiggling.

heibert (author)2015-12-01

humanity has no chance

Aleator777 (author)heibert2015-12-01

Not anymore! Muah ha ha ha

dchristopher7 (author)2015-12-01

You can squeeze about 3 BB's into the head of the plastic tipped darts... this does create some lovely welting. ^_^

About This Instructable

55,940views

901favorites

License:

Bio: My name is DJ and I previously made electronic whatsits, 3D-printed thingamabobs, and laser-cut kajiggers for the Instructables Design Studio; now I build and repair ... More »
More by Aleator777:MiniSub ROVBasics of Thermal ImagingMiniature Autonomous Blimp
Add instructable to: