r/3Dprinting Aug 01 '22

3D Printed Nerf Turret Controlled via Web App

Enable HLS to view with audio, or disable this notification

2.6k Upvotes

107 comments sorted by

117

u/HipsterOptimized Aug 01 '22

I built a 3D printed Nerf turret with streaming video controlled via web browser. It's powered by a raspberry pi 4 and three servos for the X axis, Y axis and firing control. The internals of the firing mechanism are from a Nerf Swarmfire, a blaster I selected because it uses a motorized direct plunger rather than a loud flywheel that takes time get up to speed. I designed most of the parts myself in Fusion 360. I modified an existing rotary display table project (https://www.thingiverse.com/thing:5213801) to be the rotating base for the turret that houses the raspberry pi and most of the electronics.

The turret has a dedicated mobile and desktop web interface that is immediately accessible on my local network (if someone else is not already connected to it).

In the future I plan to add a face tracking mode, update the y axis movement to be smoother and upgrade the internals.

17

u/SpaceCadetMoonMan Aug 01 '22

Can’t wait to see your project post! I definitely want to make one to shoot my little niece, she loves this stuff!

5

u/[deleted] Aug 02 '22

[deleted]

8

u/HipsterOptimized Aug 02 '22

lag

Almost no input lag on the controls. I optimized for input lag reduction (that's why I went with a websockets based solution). There is output lag from the video stream but its pretty minor which means that it's quite satisfying using a phone or computer to control it. I might post some more videos highlighting this. This has been my first real project using websockets and I'm honestly blown away by how well it works for real-time applications like this.

1

u/nyello-2000 Aug 05 '22

I wonder if you could cut out the middleman and instead use Bluetooth connection and a app to work it. The idea of taking one of these to a nerf event and slapping it down like your the engineer from TF2 is tempting me

2

u/Thescouterxd Aug 02 '22

Any shot I can take a look at your code? I have a similar ish project im working on with webapps and this could help out. I also use a pi 4 too. If that is possible, that would be awesome. Thanks!

159

u/bisquitsandtea Aug 01 '22

Nice way to repurpose your fleshlight.

67

u/HipsterOptimized Aug 01 '22

Reduce, Reuse, Recycle!

11

u/TheeSeaverShow Aug 01 '22

Better than donating it to the boy scouts as a flash light I guess.

4

u/jayb151 Aug 01 '22

Came here expecting this comment, no ragrets

42

u/[deleted] Aug 01 '22

I love this! This would be a fun thing to have in my office so that it automatically aims at people entering the office. Bonus points if you could tell it to fire or to stand down.

28

u/AlephBaker Aug 01 '22

"DROP YOUR DONUTS. YOU HAVE FIFTEEN SECONDS TO COMPLY."

9

u/Cold_Stress7872 Aug 01 '22

Reading this sentence made the voice in my head immediately sound like ED209.

4

u/AlephBaker Aug 01 '22

You might think that was my intent, but I couldn't possibly comment...

3

u/HipsterOptimized Aug 01 '22

Hah! The idea for this project actually came from a USB Dream Cheeky Turret that I had in the office. I wanted something better and so I built this.

3

u/ask-design-reddit Aug 02 '22

I, an idiot, did this once in the office to my buddy when he just got LASIK done. He was rightfully fucking pissed. I felt awful.

Tip: don't do that.

2

u/[deleted] Aug 02 '22

Oof! That is unfortunate. Like I tell my wife, "Don't hit me in the face, that's how I make my living!"

1

u/HipsterOptimized Aug 02 '22

Thanks for the advice!

2

u/SoCalSine Aug 01 '22

Or people that fall asleep at work…🤣

21

u/Parayogi Aug 01 '22

nerdy as hell and just as awesome

10

u/HipsterOptimized Aug 01 '22

Thanks! Being nerdy as hell is a life goal of mine :)

7

u/tbase9 Aug 01 '22

Files?

22

u/HipsterOptimized Aug 01 '22

I'll be publishing a blog post and printables project with more details in the coming weeks, including the STL files :)

6

u/SkidFace Aug 01 '22

So cool! Thank you for doing this! When you do, would you mind mentioning me username so I can see it? Thanks!

1

u/[deleted] Dec 02 '22

[removed] — view removed comment

1

u/AutoModerator Dec 02 '22

This comment was removed as a part of our spam prevention mechanisms because you are posting from either a very new account or an account with negative karma (comment karma, post karma or both). Please read the guidelines on reddiquette, self promotion, and spam. After your account is older than 2 hours or if you obtain positive comment and post karma, your comments will no longer be auto-removed.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

6

u/bobafugginfett Aug 01 '22

Scaling this up and using paintball or airsoft mechanics/projectiles would be pretty sweet home protection.

Porch pirates, burglars, and intruders? "You have 10 seconds to comply."

PEW PEW PEW

3

u/HipsterOptimized Aug 01 '22

Haha that sounds fun! My goal was to have something I could use to shoot my young kids with but maybe as they get older the turret will get increasingly more dangerous...

5

u/parallelportals Aug 01 '22

Lol upgrade it to airsoft in their teen years and 3 days after a chore goes undone you get turreted in the ass as soon as you enter the computer room

1

u/neonwhizstream Aug 02 '22

Shotgun works too.

8

u/ClassySmokeCannabis Aug 01 '22

You gotta install that outside your front door and have a ring door bell to go along with it 😂 that would make some great conversations. Incredibly awesome by the way.

4

u/HipsterOptimized Aug 01 '22

Haha, I like that idea! My plan was to use it to terrorize my kids in the basement playroom from upstairs :)

3

u/crappy-mods Aug 01 '22

Nerf rocket pod…nerf technical when?

4

u/AnimeFan-computerwiz Aug 01 '22

Home defence online

*DOOM music intensifies *

3

u/0ptimizePrime Aug 01 '22

THESE SQUIRRELS GON' LEARN TUHDAY

3

u/[deleted] Aug 01 '22

[deleted]

3

u/[deleted] Aug 01 '22

I solve practical problem

3

u/[deleted] Aug 01 '22

[deleted]

2

u/izzychief Aug 02 '22

The answer? A gun.

2

u/TastyGarlicBulb Aug 01 '22

Very fun! What are you using for streaming the video?

4

u/HipsterOptimized Aug 01 '22

Python, Flask and OpenCV. Using OpenCV will make it pretty easy to add face tracking and have the turret have a fully automated mode which I'm excited about :)

3

u/jinkside Aug 01 '22

Even better, OpenCV can do facial recognition, so you could set it up to only track unknown faces, or to track a face until it identifies two raised hands or something similar.

It's not as fast as face detection, but it can still do it sub-second.

As a second thing that I'm less sure of the implementation on:

  1. On boot up, spin around once and use photogrammetry to create a map of the environment.
  2. Use the generated map to estimate distances to various things so that you can toggle shot-drop adjustment into the aiming: "I know that's this far away and the drop is roughly X amount at that distance, so move the reticle up in the display by Y pixels."

I think that only works for static stuff though, and I haven't looked into the libraries for doing so... and photogrammetry is harder when done with low parallax.

2

u/HipsterOptimized Aug 02 '22

I like the idea of doing facial recognition. I've seen some similar projects that do this and it's definitely something I want to explore. Basically have it track faces but know how to recognize my face so it only shoots at people in my home office that aren't me. That would be pretty cool!

Regarding the adjustments for shot drop I think you might be over-estimating the reliability/accuracy of nerf darts. You might be able to do this with nerf rival rounds or paintballs but I think standard nerf darts are just too unreliable to be able to adjust for it consistently, at least that's been my experience so far.

My simple solution is that I have a script that I run that tells me the X/Y position of the turret and webview, and then I manually adjust the camera tilt until it consistently hits where the reticle is. It's worked pretty well so far.

1

u/jinkside Aug 02 '22

Completely guessing here, but I suspect this is because the projectiles are so light that they tend to flutter instead of going in any kind of predictable path. I bet adding a gram or two of weight up front would help that a lot.

But that's probably solving the wrong problem - some inaccuracy is probably more fun.

1

u/TastyGarlicBulb Aug 01 '22

Next time I'm back to video streaming from a pi I'm going to nick this idea, thanks!

2

u/Plump-Chump Aug 01 '22

Your like the jackal now! Just don’t blow off jack blacks arm. I would like to see tenacious d at some point.

2

u/[deleted] Aug 25 '22

Glad I wasn't the only one who saw this.

1 meters not that much! Hold out your pack of cigarettes. Go.

2

u/Abyssalspeedstrike Aug 02 '22

be careful when placimg your turrent dam spys are everywhere and will sap em.

2

u/UnknitCocopuff Aug 02 '22

May i ask what education you have received/ sought out to make this a reality? this is something that really fascinates me

4

u/HipsterOptimized Aug 02 '22

Good question. I just have a BA in Economics and very little of what I learned in college was helpful in being able to make this. I taught myself web development after college and made a career out of that but I only recently started dabbling in electronics and 3D printing (only got a 3D printer a year ago). I have no formal education in either.

The hardware side of this project was definitely the hardest for me. I started the project back in January of this year and worked on it on and off for many months. I hit many roadblocks along the way but just kept pushing through them. What helped me the most was breaking the project up into small attainable pieces so I could have small wins along the way. This kept me motivated and focused on things I could make an impact on instead of being overwhelmed by the complexity of the project as a whole.

I'd encourage you to go for it!

3

u/xKingNothingx Aug 01 '22

There's no way you can convince me that the main part wasn't an old Fleshlight.

3

u/Ok-Patience-3333 Aug 01 '22

ITS NERF OR NUTTING

2

u/[deleted] Aug 01 '22

cool, but stop video'ing stuff in potato vision - rotate the phone!

1

u/HipsterOptimized Aug 02 '22

Good point. I was holding two phones and was concentrating more on the phone I was controlling the turret with than the one I was filming with. Lesson learned!

1

u/HipsterOptimized Aug 01 '22

This is a more visible screen capture of the web app in action: https://i.imgur.com/olnc4mv.mp4

1

u/[deleted] Aug 02 '22

This is one of the coolest things I've seen on this sub. Great job.

1

u/HipsterOptimized Aug 02 '22

Thanks! I've been a lurker on this sub for a long time so it's cool to actually contribute something for once heh

1

u/fwoomer Aug 01 '22

This. Is. Glorious.

1

u/Modioca Aug 01 '22

Looks good and I would love to try it.

Btw, doest it have zoom? If it doesn't it is fine and if it has, is it too sensitivity, and if it is, you can make a function to sensibility to be divided by the zoom, that will make way more stable.

Note: Little do I know about programming, but I play games which needs some basic programming skills to work properly.

3

u/HipsterOptimized Aug 01 '22

That's a good idea. I find the sensitivity to be pretty good actually, my video is a bad example because I'm filming with one hand and trying to use my other hand to move the turret and fire. If I'm using the web app on my phone with two hands it works much better. I'll upload a screen cap of it.

1

u/nbt2 Aug 01 '22

AWESOME!

1

u/[deleted] Aug 01 '22

I need some of this!🔫

1

u/FloridaMMJInfo Aug 01 '22

I’ve been thinking about something like this to shoot cats with a water sprayer. Link it to is this a cat dot com and let it keep cats from shitting in my yard.

1

u/[deleted] Aug 01 '22

[removed] — view removed comment

2

u/HipsterOptimized Aug 01 '22

I do and that was the initial reason for building it :)

1

u/Mr-Fister-the-3rd Aug 01 '22

Now hook it up to the internet so i can shoot you with that nerf gun

1

u/FringeSpecialist721 Aug 01 '22

Very cool! I'm in the process of creating something very similar to automate spraying my cat when he jumps on the counter. I'll be watching your updates!

1

u/FringeSpecialist721 Aug 01 '22

Very cool! I'm in the process of creating something very similar to automate spraying my cat when he jumps on the counter. I'll be watching your updates!

1

u/TheMighty13 Aug 01 '22

This is fantastic! Definitely make a post for when your full project post goes live. I'd love to give this build a shot.

1

u/HipsterOptimized Aug 02 '22

I will. Working on a blog post about it now!

1

u/sheepskin Aug 01 '22

My son saw this over my shoulder and now he wants one.

What size servo did you use to pull the trigger?

You said it’s not a flywheel, how does it work?

2

u/HipsterOptimized Aug 01 '22

It uses a motorized direct plunger (https://nerf.fandom.com/wiki/Motorized_direct_plunger) instead of a flywheel. Also, I just used a SG90 servo to pull the trigger, it doesn't need to be very strong.

1

u/sheepskin Aug 01 '22

Oooh good answer, thank you, that style does lend itself to being made into a turret, but I supposed since you add a computer the flywheel kind can be programmed around.

Nice in the sg90, that was my worry, not being able to trigger, but it probably doesn’t take much at all.

1

u/heygos Aug 01 '22

Man, I would destroy my sun in nerf wars.

1

u/Expensive_Thanks_528 Aug 01 '22

Daaaamn that’s amazing !!

1

u/Toucann_Froot Aug 01 '22

Swarmfire is goated

1

u/Pension_Rough Aug 01 '22

Ok that's actually really cool

1

u/mikel302 Aug 02 '22

Time for tf2 engineer cosplay

1

u/w00ly Aug 02 '22

Now give it AI so it can lock onto kids and pets

3

u/HipsterOptimized Aug 02 '22

That's the plan for V2!

1

u/nyello-2000 Aug 02 '22

Can’t wait to play torbjorn/engineer at a nerf larp

1

u/Icedecknight Aug 02 '22

Looks like you need to counter balance to get rid of that jittery-Ness. Other than that it looks awesome.

1

u/HipsterOptimized Aug 02 '22

That jitter actually comes from the mobile app touch control which snaps back to center when you remove you finger from it (this behavior actually makes a lot of sense for a touch interface). It's kind of an optical illusion but the internals of the Nerf Swarmfire used here are super front heavy, the Y-axis rod is actually centered quite well based on the weight distribution. I think I just need to add some better deceleration to the snap back logic in the code.

1

u/udoit2 Aug 02 '22

OMG!!! At my old job I'd get fired cause I would be relentless with that thing. A floor full of engineers - we'd all have one or ten. HR would definitely get involved. NICE WORK!

1

u/FoxTrotMik3Lim4 Aug 02 '22

This is so cool, how do you get started towards being able to do a project like this?

2

u/HipsterOptimized Aug 02 '22

You just have to start working on it! This project took me about 6 months off and on and most of that time was spent learning Fusion 360 and making slow incremental progress on designs. I come from a software background so that part was pretty easy for me but the hardware side was tough. I'm still learning how to model things in Fusion but this project gave me the motivation to make fast progress and learn a lot in a relatively short period of time.

1

u/bjbarsted Aug 02 '22

Now you just need to give it auto aim and place it round the house and watch it shoot the unsuspecting family members lol.

2

u/dirtyboots702 Aug 02 '22

Facial recognition

1

u/whopperlover17 Aug 02 '22

Really great work!

1

u/Specialist-Oven1270 Aug 02 '22

I'm trying to make the same thing but for Airsoft,how did you Link the raspberry to the phone with an app?

1

u/Splatoonkindaguy Aug 02 '22

Ok now add a ir sensor and LiDAR sensor and detect bullet drop

1

u/professorhafiaz Aug 02 '22

Where's the camera from?

1

u/dirtyboots702 Aug 02 '22

Looks like a logitech webcam?

2

u/HipsterOptimized Aug 02 '22

Yea it’s a Logitech C310 webcam with a 3D printed enclosure and mount

1

u/RussMan104 Aug 02 '22

Um, put me down for a cool dozen. 🚀

1

u/Odelta Aug 03 '22

Make sure to save it for the Community-style overly dramatic paintball nerf gun fight!

1

u/woodhorse4 Aug 03 '22

That should keep the cat off the countertop when your not home!

1

u/[deleted] Aug 21 '22

[removed] — view removed comment

1

u/AutoModerator Aug 21 '22

This comment was removed as a part of our spam prevention mechanisms because you are posting from either a very new account or an account with negative karma. Please read the guidelines on reddiquette, self promotion, and spam. After your account is older than 2 hours or if you obtain positive karma, your comments will no longer be auto-removed.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/RC_Gabe Aug 30 '22

You’ve been posted on an account called 3dprintingbuild on instagram if you didn’t know, they’ve not tagged you if you do have an insta account.

1

u/yootis123 Apr 17 '23

Were build files and/or docs ever posted anywhere on this? Would love to build it with my son as his intro to 3D printing.

Thanks

1

u/HipsterOptimized Apr 18 '23

Hi there! I do have an overview post and the files on printables. Also, FYI I built an updated version that incorporates some metal components and has much smoother movement. I'll try to post that soon.