How to Make a Raspberry Pi Motion Tracking Airsoft / Nerf Turret

Sdílet
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

Komentáře • 263

  • @rdoetjes
    @rdoetjes Před 4 lety +40

    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.

  • @jerowns
    @jerowns Před 3 lety +13

    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

  • @RayneD17
    @RayneD17 Před 7 lety +4

    Great projects! Keep 'em coming. Subscribed.

  • @braydenbailey5451
    @braydenbailey5451 Před 3 lety +38

    Sentry goin’ up!

  • @techuila
    @techuila Před 4 lety +9

    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!

  • @mxcollin95
    @mxcollin95 Před 4 lety +1

    This project IS AWESOME!!! 🤙

  • @jacquacooper
    @jacquacooper Před 3 lety

    Thanks for doing this cool project.

  • @jordanbowling2246
    @jordanbowling2246 Před 7 lety +1

    Thanks guys! This is awesome. A very cool channel too.

  • @extrem2497
    @extrem2497 Před 7 lety

    Nice detailed video!

  • @roundthetrack7680
    @roundthetrack7680 Před rokem

    It’s taken awhile for me to see this….totally awesome project to do with the family

  • @muhammadsameer883
    @muhammadsameer883 Před 6 lety

    awesome project bro

  • @arnoldjiujitsufuckboi6376

    1:06 am
    Brain:dude get some rest bro
    Me: nah I think I’ll design an airsoft killstreak

  • @plongkie224
    @plongkie224 Před 7 lety +2

    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?

  • @yourmumisacrumpet4882
    @yourmumisacrumpet4882 Před 3 lety +1

    great video dude maybe ill make something with this in the future

  • @MrSzymon092
    @MrSzymon092 Před 7 lety +2

    Hi, great project! Which program did you use to make a 3d project of it?

  • @rasmusljungdahl3238
    @rasmusljungdahl3238 Před 3 lety +1

    Gonna use this to make a war machine (ish) shoulder turret! thank you!

  • @SciHeartJourney
    @SciHeartJourney Před 3 lety +1

    Excellent project. You should make a product to put this on security cameras.

  • @agwheeler2000
    @agwheeler2000 Před 2 lety +4

    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.

  • @asadmahmood5234
    @asadmahmood5234 Před 4 lety +4

    can you please upload to shoot a target by image processing (face detection) and gesture control gun

  • @Daniel-pd1bz
    @Daniel-pd1bz Před 7 lety +4

    What do i have to study, to learn things like this?:D Thanks! Great Videos!

  • @brandonclayton5479
    @brandonclayton5479 Před 4 lety +2

    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?

  • @shadowboxing1729
    @shadowboxing1729 Před 5 lety +1

    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!

  • @mRendyIrawan
    @mRendyIrawan Před 4 lety +1

    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?

  • @amazingsciencebros1629
    @amazingsciencebros1629 Před 4 lety +9

    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:)

    • @cryptoworldgames
      @cryptoworldgames Před rokem

      i want to buy a turret already made, i'll put my own airsoft, you want to build and sell one?

  • @khalatmesto4180
    @khalatmesto4180 Před 6 lety +1

    great , but which program of design do you use

  • @Gallardo6669
    @Gallardo6669 Před 5 lety +2

    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!

  • @cameronackerman4396
    @cameronackerman4396 Před 7 lety +1

    what program are you using for the mac to windows converter.

  • @jeremytheimer7443
    @jeremytheimer7443 Před 3 lety +1

    Cool, could I make a bigger version and use this for a telescope object tracker.

  • @sexyduce5
    @sexyduce5 Před 5 měsíci

    Bro, this is legit!

  • @dannys2290
    @dannys2290 Před 6 lety +3

    one of my goals is to be able hunt my back yard while at work...with a "lazer" pointer of course :)

  • @justinyoung5180
    @justinyoung5180 Před 4 lety +1

    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.

  • @guestacc6903
    @guestacc6903 Před 6 lety +1

    What airsoft replica were you using, could you possibly give me a link?

  • @ravenweikel6423
    @ravenweikel6423 Před 4 lety +4

    imagine winning an airsoft round by setting this up and drinking beer

  • @seaha3750
    @seaha3750 Před 6 lety +3

    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

  • @pushpanpavurala1763
    @pushpanpavurala1763 Před 5 lety

    Hey hi great video. Is it possible to make it with servo motors

  • @luisneuner8506
    @luisneuner8506 Před 4 lety +1

    nice pretty good build how long did it take to build that

  • @jacquesadendorff1175
    @jacquesadendorff1175 Před 6 lety

    Does the code also work if you want to use servos or is the code just for stepper motors??

  • @MyNotSoHumbleOpinion
    @MyNotSoHumbleOpinion Před 5 lety

    How can I get it work with picamera? With a usb camera work very well, but i wanna use with the infrared picamera

  • @siik-ghostface
    @siik-ghostface Před 3 lety

    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.

  • @mattfluty8677
    @mattfluty8677 Před 3 lety +1

    I wanna build a beefed up rover with a pepper ball gun to keep hippies off my lawn 😂

  • @silentwolf9923
    @silentwolf9923 Před 2 lety

    I can't wait to do this to my airsoft gun

  • @shrinkz804
    @shrinkz804 Před 4 lety +1

    Can we use servos instead of stepper

  • @seaha3750
    @seaha3750 Před 6 lety

    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

  • @hastinbagewadi1863
    @hastinbagewadi1863 Před 5 lety

    what should i do to get this working with python3 and opencv4??

  • @DARK11611
    @DARK11611 Před 3 lety

    Can you make laser turet to kill fly.. might . Maybe using CNC laser

  • @gabaca1210
    @gabaca1210 Před 4 lety

    Do you have to be hooked up to the monitor all the time?

  • @Trmmaryland
    @Trmmaryland Před 3 lety

    very cool

  • @herantd
    @herantd Před 7 lety +7

    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

  • @dgkway
    @dgkway Před 3 lety

    Does this system need connection to your pc in its autonomous mode?

  • @vipinkp1771
    @vipinkp1771 Před 5 lety

    Is it supported in raspberry stretch??

  • @muhammadauria5004
    @muhammadauria5004 Před 6 lety

    Why we can't mount webcam on gun in motion detection mode?

  • @MacroAggressor
    @MacroAggressor Před 3 lety +1

    Is the code up somewhere else? The link in the description is broken.

  • @Moai_Manson
    @Moai_Manson Před 6 měsíci

    Do you know if it would be hard to flip it upside down and make it ceiling mounted? (School project with a nerf gun)

  • @GrimGearheart
    @GrimGearheart Před 5 lety

    I need to make something like this, but much smaller...something that can be shoulder mounted, like a predator shoulder cannon. Hm...

  • @tactusxii
    @tactusxii Před rokem

    Raspberry pie seems to lag For object tracking. I'm trying to speed the processing time so I can better track moving targets.

  • @atvar8
    @atvar8 Před 7 lety +7

    how well does this track and lead for faster moving targets?

    • @RubberBoss
      @RubberBoss Před 6 lety

      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

    • @appa609
      @appa609 Před 3 lety

      @@RubberBoss It's not a python issue it's just a matter of implementation. You'd need ranging to get good lead info.

  • @treverbelmont8393
    @treverbelmont8393 Před 3 lety

    Do you need to use a rasberi pi to do this could you use an autduino instead

  • @simasfm7997
    @simasfm7997 Před 4 lety

    how long distance can it be ?

  • @TOP1_ENG
    @TOP1_ENG Před 3 lety

    When i run this command "workon turrent" say "command not found" . how i can solve it.
    Thanks.

  • @danrandom9005
    @danrandom9005 Před 6 lety

    does it work upside down i wanny mount it under my roof

  • @Spartan-Of-Truth
    @Spartan-Of-Truth Před 3 lety

    I HAVE to make one.

  • @shared-knowledge
    @shared-knowledge Před 4 lety

    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.

  • @subramanyanaik123
    @subramanyanaik123 Před 6 lety

    where we get thise all items

  • @defektruke
    @defektruke Před 4 lety

    can you add laser to kill mosquitoes?

  • @niborex133
    @niborex133 Před 6 lety

    Sentry goin up

  • @ravenweikel6423
    @ravenweikel6423 Před 4 lety

    sentry goin up

  • @oliviergoggins
    @oliviergoggins Před 5 lety +1

    Total price?

  • @frostofice8278
    @frostofice8278 Před 3 lety

    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

    • @heimdrock
      @heimdrock Před 3 lety

      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.

  • @BroskySam9716
    @BroskySam9716 Před 3 lety

    NEEDA SENTRY HERE!

  • @riaank.4585
    @riaank.4585 Před měsícem

    Thanks good video and instructions, but do you perhaps have an updated github-repository, since the provided one doesn't work anymore? :-)

  • @satyapratapsingh8915
    @satyapratapsingh8915 Před 6 lety

    Can we do it with Arduino

  • @artnaz93
    @artnaz93 Před 7 měsíci

    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?

  • @sornamusicalcover
    @sornamusicalcover Před 5 lety

    Can we be able to do this project in arduino uno?

    • @thornclawofwarriors
      @thornclawofwarriors Před 4 lety

      Not with just a Arduino by itself. You need something more powerful to manage the camera

  • @FishDish159
    @FishDish159 Před 3 lety +1

    now I just want to mount a air soft LMG to this.

  • @teamkiller5269
    @teamkiller5269 Před 7 lety

    Do you sell this ?

  • @hamzaarain4238
    @hamzaarain4238 Před 4 lety +1

    there is no such repository for this project

  • @bonnierussell7824
    @bonnierussell7824 Před 3 lety

    I wonder if this would keep the cats off my kitchen counter.

  • @innateswing6607
    @innateswing6607 Před 27 dny

    Could I use a Arduino?

  • @azaanali1668
    @azaanali1668 Před 7 lety

    can we replace motion detection to color detection in this project

  • @liamalon923
    @liamalon923 Před rokem

    need a link to the gun, anyone can help me? even anything similar, i need to shoot something when i want using code

  • @tuffyman3067
    @tuffyman3067 Před 3 lety

    Is possible to specific the object to track and fire?

    • @cybergnetwork588
      @cybergnetwork588 Před 3 lety

      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.

  • @nikitaf93real
    @nikitaf93real Před měsícem

    "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

  • @AntTheFanOfMurderDrones.
    @AntTheFanOfMurderDrones. Před 4 měsíci

    Imagine taking this to the airsoft game.

  • @Maloshrazvan
    @Maloshrazvan Před 5 lety

    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!!

  • @projectmanagement2356
    @projectmanagement2356 Před 5 lety

    Dude 100🍺. Using a ChuKuNu would have been nice though.

  • @mubta0082
    @mubta0082 Před 5 lety +3

    Sir,Can you tell the budget of this project?

    • @SAM_Vertigo1
      @SAM_Vertigo1 Před 4 lety

      Mubtasim Mim Sorry, I'm late. It's more than 200$ as you'll need Raspberry Pi (≈100$) and an airsoft gun (≈≥100$).

    • @bommeljoschenjoyer
      @bommeljoschenjoyer Před 3 lety

      Raspberry PI 40€ Airsoft mini MP5 20-40€ depends on quality and motors 35€ for 3 I think

  • @kevinbuckley7879
    @kevinbuckley7879 Před 3 měsíci

    Can i order some from you?

  • @bommeljoschenjoyer
    @bommeljoschenjoyer Před 3 lety

    I think ill build this

  • @KaijuMaster2099
    @KaijuMaster2099 Před 3 lety

    POOTIS SPENCER HERE!

  • @alexeykrylov9995
    @alexeykrylov9995 Před 5 lety +26

    36:13 Seems like aiming doesn't work.

    • @MystixHalo
      @MystixHalo Před 3 lety

      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.

    • @DudethatGross
      @DudethatGross Před 3 lety

      @@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

    • @MystixHalo
      @MystixHalo Před 3 lety

      @@DudethatGross Thank You

  • @orkanozgur3749
    @orkanozgur3749 Před 7 lety +16

    Linus made one too !!

  • @cryptoworldgames
    @cryptoworldgames Před rokem

    will you sell this turret and software? i'll provide my own airsoft

  • @SpikeMcCann
    @SpikeMcCann Před 2 lety

    How would I get an electric nerf gun working for this?

  • @smeshdoggo1954
    @smeshdoggo1954 Před 3 lety

    GitHub link doesn't seem to work anymore : (

  • @mohammadzeeshan3546
    @mohammadzeeshan3546 Před 5 lety +1

    kindly make a tutorail on live video streaming with low latency

  • @murilo0825
    @murilo0825 Před 8 měsíci

    Im gonna install one of these on the roof of my house

  • @billwilliamson7102
    @billwilliamson7102 Před 4 lety

    Level 1 sentry in a nutshell

  • @minnesotastatesirens2732

    Now to Make a mini Phalanx Cwis…

  • @vishaldeo2306
    @vishaldeo2306 Před 6 lety

    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!!

    • @jasonstroup12
      @jasonstroup12 Před 6 lety

      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

    • @vishaldeo2306
      @vishaldeo2306 Před 6 lety

      Jason Stroup i managed to solve the error..email me on vishaldeo1994@gmail.com and il help you out

    • @AyeChea
      @AyeChea Před 6 lety

      How did you solve this? I tried to use --upgrade and still get the same error after

  • @neelpatel1781
    @neelpatel1781 Před 5 lety

    This all project I you made comes under which engineering plzz

    • @ipodtouch470
      @ipodtouch470 Před 5 lety

      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.

    • @saz98
      @saz98 Před 3 lety

      mechatronics