How to Make a Raspberry Pi Motion Tracking Airsoft / Nerf Turret
Vložit
- čas přidán 23. 07. 2024
- See how we built it, including our materials, code, and supplemental instructions, on Hackster.io: www.hackster.io/hackershack/r...
In this video we show you how to build a DIY motion tracking airsoft (or nerf gun) turret with a raspberry pi 3. The airsoft turret is autonomous so it moves and fires the gun when it detects motion. There is also an interactive mode so that you can control it manually from your keyboard. We used an airsoft gun for this project, but you can easily change modify this build to use a Nerf instead. This project is small, lightweight and entirely battery operated.
We created two separate operation modes: Interactive and Motion Detection. Interactive allows you to control the turret remotely and stream live video. Motion Detection uses openCV and computer vision to track moving targets in front of the camera.
Since this device fires projectiles, please use the necessary safety precautions while operating the turret. :)
Get a full parts list and written instructions on Hackster.io: www.hackster.io/hackershack/r...
Get the 3D printable parts files on our Patreon: / tracking-turret-37733071
USEFUL LINKS:
Get the code and the project instructions on our github page: github.com/HackerHouseOfficia...
Adafruit I2C setup guide: learn.adafruit.com/adafruits-...
Adafruit stepper motor HAT: github.com/adafruit/Adafruit-...
OpenCV 3 on a Raspberry Pi 3: www.pyimagesearch.com/2016/04/...
Get our 3D printer: robo3d.myshopify.com?rfsn=1004615.c5abe
MATERIALS
1 x Raspberry Pi 3
Amazon Affiliate Link - goo.gl/oVJcxK
1 x Electric airsoft gun
1 x Raspberry Pi compatible webcam (We used a Logitech C210)
1 x Stepper Motor HAT: www.arrow.com/en/products/234...
2 x Stepper Motor NEMA 17 200 steps/rev: www.adafruit.com/products/324 or www.ebay.com/itm/US-Ship-Nema-...
1 x Single Relay: www.amazon.com/gp/product/B00...
1 x Step up converter: www.amazon.com/gp/product/B01...
1 x Mobile cell phone battery: www.ebay.com/itm/12000mAh-Dual...
1x Female to female jumper wire kit: www.adafruit.com/products/826
2 x Micro usb cables
2 x 90 degree metal brackets
10 x #8 1/2" screws
16 x #8 washers
8 x M3 screws
1 x 2' by 2' 1/4" MDF sheet
OTHER LINKS:
Subscribe to Hacker Shack: / @hackershack
Follow Hacker Shack on Instagram:
hackershack...
Music by Joakim Karud / joakimkarud
Disclaimer
The methods shown in this video should be used
as a guide only. We do not endorse firing projectiles at live targets.
HACKER SHACK ACCEPTS NO RESPONSIBILITY FOR
ACCIDENTS OR INCIDENTS ARISING FROM INDIVIDUALS
UNDERTAKING ANY OF THE TASKS DESCRIBED. IN
PARTICULAR, IF UNSURE YOU SHOULD ALWAYS CONTACT
A QUALIFIED EXPERT BEFORE PROCEEDING. - Věda a technologie
Here’s a pro-tip guys. If you need two of the same, cut them at the same time by stacking two pieces of MDF on top of each other. That also makes finishing them easier, because you sand and vile the same amount and through holes align perfectly.
Thank you for this!! I plan on making a Glados/Jarvis like ceiling mounted following camera to start workshop livestreams. This video is definitely going to be helpful
Great projects! Keep 'em coming. Subscribed.
Sentry goin’ up!
TF2 😎
Engineer gaming
Engineer gaming
Tiny adjustment: just add an airsoft laser on one of the rails and on video it will show exactly where the barrel is pointing. Bonus points: add an IR laser so only the camera can see the laser but not the people being shot!
This project IS AWESOME!!! 🤙
Thanks for doing this cool project.
Thanks guys! This is awesome. A very cool channel too.
Nice detailed video!
It’s taken awhile for me to see this….totally awesome project to do with the family
awesome project bro
1:06 am
Brain:dude get some rest bro
Me: nah I think I’ll design an airsoft killstreak
1:46am right now🤔
4:16 AM, y'all are lacking
Hi Hacker House! Like your long videos. Very informative and good for beginners.. I just want to ask what software did you use making the model?
great video dude maybe ill make something with this in the future
Hi, great project! Which program did you use to make a 3d project of it?
Gonna use this to make a war machine (ish) shoulder turret! thank you!
Excellent project. You should make a product to put this on security cameras.
I want to create a spotlight that will follow any trespassers who wander down our driveway at night looking to break into our car. This is perfect solution. Thank you.
can you please upload to shoot a target by image processing (face detection) and gesture control gun
What do i have to study, to learn things like this?:D Thanks! Great Videos!
Does the camera have to be connected to the computer as well as the raspberry pi at the same time to do the interactive mode? Is it possible to load that motion tracking code onto the raspberry Pi and running independent of a computer?
This is what I wanted to Make! 👍but for my outside camera, which doesn't have Motion Auto tracking. I plan on building a frame that holds the camera, and moves when the sensor picks up movement. There's a part I can't see with the Camera, I don't want to install another camera, this will be another alternative, and its cool!
Do you think it would be possible to use this tracking turret program to make a motion tracking spot light that I can put in my backyard?
This is awesome! Thank you for the inspiration and instructions. We are trying to build our own, but with a big Nerf gun and trying to use Scratch 2 instead of Python (not sure how we will do the facial recognition, but it’s easier for us kids;) We got it to fire the gun and a laser pointer so far ... take a look and give us some tips:)
i want to buy a turret already made, i'll put my own airsoft, you want to build and sell one?
great , but which program of design do you use
I really want to learn anf build all this. But i get totally lost here, having just some arduino experience. It would be sooo nice if there would,be a long video out there starting for beginners to make me/us confident that it will work and that its worth to buy all the hardware!
what program are you using for the mac to windows converter.
Cool, could I make a bigger version and use this for a telescope object tracker.
Bro, this is legit!
one of my goals is to be able hunt my back yard while at work...with a "lazer" pointer of course :)
If I were to take out the turret and replace it with a flashlight/laser, would the code still work or would I have to change the code? It is mostly the camera tracking I am hoping will still work.
What airsoft replica were you using, could you possibly give me a link?
imagine winning an airsoft round by setting this up and drinking beer
Hey i have a Problem with the live video preview everything from the installation works fine and when i start turret.py it also works but then it asks me if i want an live video preview and when i hit yes an error occured. Could somebody please help me i really new to Raspberry pi oh and i am trying to use the original raspicam. are there some changes to make
Hey hi great video. Is it possible to make it with servo motors
nice pretty good build how long did it take to build that
Does the code also work if you want to use servos or is the code just for stepper motors??
How can I get it work with picamera? With a usb camera work very well, but i wanna use with the infrared picamera
Could make your turret shoot ballistic rubber bullets and smarter where it targets and shoots certain people (burglars for example and not you, your family nor friends), so it only recognizes burglars, and other enemies. Like maybe find and download images of recent criminals then upload it to your thing and it will remember and recognize them. It's Rotating speed could be adjusted to be faster.
I wanna build a beefed up rover with a pepper ball gun to keep hippies off my lawn 😂
I can't wait to do this to my airsoft gun
Can we use servos instead of stepper
Hey nice project. But can you tell me how to use 28BYJ-48 what have i to do i am a real noobie on raspi
what should i do to get this working with python3 and opencv4??
Can you make laser turet to kill fly.. might . Maybe using CNC laser
Do you have to be hooked up to the monitor all the time?
very cool
hope you use arduino for your doorlock project, pi might just be overkill and it will be just pain in the ass if i would like to make one after :P
Does this system need connection to your pc in its autonomous mode?
Is it supported in raspberry stretch??
Why we can't mount webcam on gun in motion detection mode?
Is the code up somewhere else? The link in the description is broken.
Do you know if it would be hard to flip it upside down and make it ceiling mounted? (School project with a nerf gun)
I need to make something like this, but much smaller...something that can be shoulder mounted, like a predator shoulder cannon. Hm...
Raspberry pie seems to lag For object tracking. I'm trying to speed the processing time so I can better track moving targets.
how well does this track and lead for faster moving targets?
atvar8 even though I didn't make it I'm sure it doesn't track fast moving objects, python programming language has no such capabilities
@@RubberBoss It's not a python issue it's just a matter of implementation. You'd need ranging to get good lead info.
Do you need to use a rasberi pi to do this could you use an autduino instead
how long distance can it be ?
When i run this command "workon turrent" say "command not found" . how i can solve it.
Thanks.
does it work upside down i wanny mount it under my roof
I HAVE to make one.
One basic question about drawing a circle with a cable and a pen.. Why didn't you use a compass for this ? i know some people like to do things on hard mode but a compass is not what you would call a expensive item to get.
It was too large for our compass
where we get thise all items
can you add laser to kill mosquitoes?
Sentry goin up
sentry goin up
Total price?
I immiediately had an idea for a cosplay that could be done of predator from the movies. To do so youd need a shell resembling a futuristic cannon. Likely to shorten the legs just slightly. The rotating platforms diamater reduced just slightly and hook the bottom (non moving disc) to a door hinge to give it motion and an electric piston. To let it go from an neutral to active position (on back to on shoulder and ready to fire). Hook up the conyrols to a small device if possible such as a phone and set phone in wrost mounted bracer similar to predators wrist weapon. Youll be able to look as though your predator activating his blaster via wrist controller device. Highly reccomended additive is tracer drum or mag and tracer pellets for add glowing green effect and a 3 lasers connected to left,right and bottom of barrel to give it that signature tri beam aiming system.
Please feel free to let me know what yall think of this idea
Some crazy people have already done that, I do not remember the name of the channel, but you can search "real predator sentry" on youtube.
NEEDA SENTRY HERE!
Thanks good video and instructions, but do you perhaps have an updated github-repository, since the provided one doesn't work anymore? :-)
Can we do it with Arduino
Where can I buy something like this? Can I pay you guys to build a custom one based on the airsoft gun I want to use?
Can we be able to do this project in arduino uno?
Not with just a Arduino by itself. You need something more powerful to manage the camera
now I just want to mount a air soft LMG to this.
Do you sell this ?
there is no such repository for this project
I wonder if this would keep the cats off my kitchen counter.
Could I use a Arduino?
can we replace motion detection to color detection in this project
sure
need a link to the gun, anyone can help me? even anything similar, i need to shoot something when i want using code
Is possible to specific the object to track and fire?
Probably if implementing with Deepstack (Artificial Intelligence). It is integrated to Blue Iris surveillance software. You would be able to include or exclude human, cat, dog, bird, car bus, etc.
"Take for instance this heavy caliber tripod mounted lil' old number designed by me, built by me, and you best hope... Not pointed at you." -Dell Conagher
Imagine taking this to the airsoft game.
Amazing, thorough, and precise explanation :-). the code link is broken :-(. any chace to get it?
*Edit* - NM. found it on the Hacker.io page :-)) THNX!!
how did you do this ecactly
Dude 100🍺. Using a ChuKuNu would have been nice though.
Sir,Can you tell the budget of this project?
Mubtasim Mim Sorry, I'm late. It's more than 200$ as you'll need Raspberry Pi (≈100$) and an airsoft gun (≈≥100$).
Raspberry PI 40€ Airsoft mini MP5 20-40€ depends on quality and motors 35€ for 3 I think
Can i order some from you?
I think ill build this
POOTIS SPENCER HERE!
36:13 Seems like aiming doesn't work.
i THINK this is because the fps of motion tracking is low. I didnt watch the whole video, but from what i know, the FPS of motion sensing/object detection is REALLY low on the RPI. You can buy something called the google coral but it is still only at 1-2 fps. Conclusion, The aiming on his robot has low fps and has bad aim.
@@MystixHalo the tracking on the RPI is actually decent, if you do not render the image to the screen. I had a project where I streamed the video from a webcam connected to an RPI to a central server, and it was getting about 30 FPS with OpenCV. I believe this is because the CPU has to do all of the rendering and not a dedicated GPU
@@DudethatGross Thank You
Linus made one too !!
the lonly light bulb linus is an idiot
*too
BeardedAlien what ?
You spelled it wrong.
Well seeing as we are correcting people, it should be wrongly not wrong.
will you sell this turret and software? i'll provide my own airsoft
How would I get an electric nerf gun working for this?
GitHub link doesn't seem to work anymore : (
kindly make a tutorail on live video streaming with low latency
Im gonna install one of these on the roof of my house
Level 1 sentry in a nutshell
Now to Make a mini Phalanx Cwis…
Hello,
I am trying to make this project but im getting and error when i run turret.py file. it says : File " /usr/local/lib/python2.7/dist-packages/Adafruit_MotorHAT/Adafruit_MotorHAT_Motors.py', line 231
PLEASE HELP!!
I'm getting the same issue : PLEASE HELP! turret.py
22
Traceback (most recent call last):
File "turret.py", line 411, in
t = Turret(friendly_mode=False)
File "turret.py", line 177, in __init__
self.mh = Adafruit_MotorHAT()
File "/usr/local/lib/python2.7/dist-packages/Adafruit_MotorHAT/Adafruit_MotorHAT_Motors.py", line 232, in __init__
self._pwm = PWM(addr, debug=False, i2c=i2c, i2c_bus=i2c_bus)
File "/usr/local/lib/python2.7/dist-packages/Adafruit_MotorHAT/Adafruit_PWM_Servo_Driver.py", line 59, in __init__
self.setAllPWM(0, 0)
File "/usr/local/lib/python2.7/dist-packages/Adafruit_MotorHAT/Adafruit_PWM_Servo_Driver.py", line 95, in setAllPWM
self.i2c.write8(self.__ALL_LED_ON_L, on & 0xFF)
File "/usr/local/lib/python2.7/dist-packages/Adafruit_GPIO/I2C.py", line 114, in write8
self._bus.write_byte_data(self._address, register, value)
File "/usr/local/lib/python2.7/dist-packages/Adafruit_PureIO/smbus.py", line 236, in write_byte_data
self._device.write(data)
IOError: [Errno 121] Remote I/O error
Jason Stroup i managed to solve the error..email me on vishaldeo1994@gmail.com and il help you out
How did you solve this? I tried to use --upgrade and still get the same error after
This all project I you made comes under which engineering plzz
A combination of electrical, mechanical, and computer science. However probably the most important knowledge required is computer science, since most of the electrical and mechanical components are pre-built.
mechatronics