The SwarmTurret: Wifi Controlled Foam Dart Turret

by meub in Circuits > Raspberry Pi

33 Views, 0 Favorites, 0 Comments

The SwarmTurret: Wifi Controlled Foam Dart Turret

Screenshot 2025-05-14 at 7.35.35 PM.png
rotate-gif.gif
IMG_5899.PNG

The SwarmTurret is a wifi-controlled foam dart turret with streaming video that is fully controllable from a mobile device or desktop browser. I built the first one a few years ago and finally just got around to posting my updates to it.

I used the Nerf Swarmfire for this project because it has an electronic trigger and uses a motorized direct plunger firing mechanism which is quieter than most flywheel blasters. Also, the lack of a flywheel meant it can fire instantly without having to get up to speed.

This build has gone through several iterations, but this latest redesign is easier to build and better than my previous versions. Some of the major upgrades include:

  1. Reuse of existing plastic blaster shell for easier assembly and less printing
  2. New belt controlled y-axis for better stability, adjustable belt tension
  3. Better camera placement for improved accuracy
  4. Direct x-axis control instead of gears
  5. Upgrade from Pi 4 to Pi 5 to allow for faster web server performance
  6. Integrated power supply with on/off switch
  7. Web app improvements

You can find the code for this project on Github and 3D files on Printables.

Supplies

SwarmTurret-Demo

For this project you will need:

  1. Nerf Swarmfire (can find cheap on eBay)
  2. Raspberry Pi 4 or 5
  3. Adafruit Servo HAT
  4. 2x 18650 batteries and holder
  5. 2x 20KG High Torque Servos for X and Y axis control
  6. SG90 Servo for trigger
  7. M3 Nuts (10+)
  8. M3 Bolts of different lengths (8,10,12,20,35)
  9. Threaded Inserts
  10. 2x Y-Axis Bearings for mounting to Y-Axis Frame (8mm ID, 22mm OD, 7mm Width)
  11. 3x X-Axis Bearings for mounting in Turret Base (17mm ID, 40mm OD, 12mm Width)
  12. O-Rings
  13. 3x 8mm Flanges
  14. GT2 20&80 Teeth 8mm Bore Aluminum Timing Pulleys
  15. Logitech C310 Webcam
  16. Right Angle USB Extender for webcam
  17. 8 x 150mm Steel Rod for Y Axis Pivot
  18. Meanwell LRS-50-5 Power Supply
  19. 15A 250V Rocker Switch On/Off Power Socket

Disassemble Nerf Swarmfire

nerf-turret-swarmfire-internals.jpg

The first thing I did was disassemble the Nerf Swarmfire so it could be easily integrated into my turret. I removed all the screws, took off the battery compartment (also attached with screws) and removed the trigger mechanism. I also removed the on/off switch.

Cut Nerf Swarmfire Shell

IMG_5842.JPG

I then cut the blaster shell down so it can be reused for the turret. I measured 27.5cm or about 10 3/4 inches from the orange ring on the front of the blaster and used my miter saw to make a clean cut through both sides of the blaster shell.

Design and 3D Print Turret Underbody Parts

SwarmTurret Underbody 3D Print Timelapse

Next I used Autodesk Fusion to design the 3D printed parts that would allow the blaster to be mounted to an 8mm steel rod. The parts would also provide a place to mount the camera and make it easy to control the firing mechanism without wasting any space.

I also designed a cap to go on the back of the blaster where I had cut it. I took a picture of the back of the blaster shell, imported it as a canvas into Fusion, calibrated it and traced the outline to make sure it was a perfect fit.

Wire Up Batteries and Trigger Mechanism

2025-04-21_08-38-39_686.jpeg

I wired up the battery and trigger mechanism to make sure they worked. The wiring is fairly simple. Just connect the negative cable from the Swarmfire to the battery pack negative terminal. Then connect the positive cable from the Swarmfire to one of the Trigger Switch cables. Lastly, connect the other Trigger Switch cable to the positive terminal on the battery back.

Assemble Turret Underbody Parts

2025-04-21_08-44-51_218.jpeg
2025-04-21_12-22-43_112.jpeg

After I made sure it was wired correctly, I assembled the blaster shell parts. I attached the SG90S servo with M3 bolts and the trigger mechanism (also with M3 bolts) to the Rear Battery and Trigger Mount piece. I then glued in the Front Battery Mount and Rear Battery and Trigger Mount into the slots cut out of the Underbody Main Piece as shown in the first picture.

Then, I glued in a M3 Nut into the Blaster Shell Mount piece, and lastly glued the Blaster Shell Mount piece itself into the Swarmfire blaster shell (texture side facing up) so the underbody piece has something to attach to in order to hold it in securely. See the second picture.

Assemble Webcam/Flanges and Attach to Swarmfire

2025-04-21_12-19-19_878.jpeg
2025-04-21_12-39-16_406.jpeg

I attached the Logitech Webcam with a M3x20 bolt and M3 Nut and tightened it enough so the camera is adjustable but doesn't move around too easily. I then attached two 8mm aluminum flanges to either side of the 8mm rod hold using 4 M3x12mm bolts.

I then inserted the Underbody Main Piece in to the Swarmfire's battery compartment. The Underbody Main Piece slides in to a front slot of the old battery compartment and attaches with an M3 bolt into the Blaster Shell Mount that was previously glued in on the back side of the old battery compartment.

Design and Print Y-Axis Frame Parts

Screenshot 2025-05-07 134336.png
SwarmTurret Y-Axis Frame 3D Print Timelapse

Next I used Autodesk Fusion to design and print the Y-Axis Frame parts. One of my main complaints of my previous design was that there was not enough tension on the Y-Axis belt. I solved this by designing a servo mounting plate that allowed the Y-Axis Servo position to be adjusted to get sufficient tension on the belt. This made the Y-Axis control very precise and eliminated the wobble of the previous design.

You'll need to print four copies of the Hex Nut Handle.

Cut the 8mm Steel Rod, Insert Into Large GT2 Timing Pulley

IMG_6022.jpg

I cut the 8mm steel rod to a length of 135mm. Then I filed down the cut edge of the rod as this prevents it from being stuck in the flanges that connect it to the Underbody Main Piece. Then I inserted rod into the Larger 80T GT2 Timing Pulley.

Assemble Y-Axis Frame

IMG_6001.jpg
IMG_6005.jpg
IMG_6006.jpg
IMG_6010.jpg
IMG_6008.jpg

I attached the Y-axis servo to the Servo Mounting Plate with four M3x15mm screws. I then inserted the Servo Pulley Mount piece into the smaller 20T GT2 Timing Pulley and made sure to orient the internal holes with the set screws on the timing pulley. I attached the Timing Pulley to the servo and used an M3x20mm screw to go through the Servo Pulley Mount piece and GT2 Timing Pulley and made sure it threaded onto the output shaft of the servo. I then tightened the set screws on the sides of the timing pulley to grip the output shaft and lock them together.

Next, I inserted the X-Axis bearings (8mm ID, 22mm OD, 7mm Width) into the holes in the Y-Axis Frame Main Piece and attached it to the Lid Piece using two M3x10mm screws and M3 Nuts.

Lastly, I used two Hex Nut Handle pieces with M3 nuts inside of them to attach the Servo Mounting Plate to the Y Axis Frame Main Piece.

Design and Print Turret Base Parts

SwarmTurret Base 3D Print Timelapse

I designed the base of the turret in Autodesk Fusion. I needed to create enough room in the base for the integrated power supply, X-Axis Servo and the Raspberry Pi. I also created ventilation holes, a cutout for the power port, and a bridge piece that allows the X-Axis servo to be mounted so the output shaft is in the exact center of the base. I also designed a Servo Mounting Plate that allows the servo to rotate the lid while providing clearance for cables.

Wire Up Pi, Pi HAT, Servo and Power Supply

2025-04-24_22-09-14_903.jpeg

I attached the power port to the outside of the Turret Base Main Piece with two M3 screws and M3 Nuts. Then I wired up the internal components of the turret base starting the the power supply. I attached the positive, negative and ground from the external power port to the AC inputs terminals of the Meanwell LRS-50-5. I then spliced some cables and used some crimp terminal connectors to run power from the DC Output terminal to both the Raspberry Pi and the Adafruit Servo HAT separately.

I also made sure the Adafruit Servo HAT was properly attached to my Raspberry Pi 5. It's not pictured here but it's important to note that the servos are plugged in to the Adafruit Servo HAT in the following configuration:

  1. Y-Axis Servo: Pin 12
  2. X-Axis Servo: Pin 13
  3. Trigger Servo: Pin 14

Add Threaded Inserts in Turret Base

2025-04-26_08-21-31_771.jpeg
2025-04-26_08-22-05_140.jpeg

I heated up some M3 threaded inserts using my soldering iron and inserted them into the holes on bridge supports on either side of the Turret Base.

Install Bearings in Turret Base

IMG_6015.jpg

I installed the X-Axis Bearings (17mm ID) on the pegs on the inside walls of the turret base. The lid rests on these bearings which allow it to spin smoothly when attached to the x-axis servo. I also used some o-rings stretched over the pegs to keep the bearings from falling off.

Attach Bridge Piece, X-Axis Servo and X-Axis Mounting Plate

IMG_6016 (1).jpg
IMG_6014.jpg
IMG_6012 (1).jpg
IMG_6024.jpg

I attached the Bridge Piece to the threaded inserts using two M3x10mm screws making sure the "Vent" label was on the side of the Turret Base with a vent. Then I used four M3x10mm screws to attach the X-Axis Servo to the Bridge Piece.

I installed two long M3x35mm screws facing up on X-Axis Servo Mounting Plate and tightened them down with M3 nuts to prevent them from rotating.

Attach Y-Axis Assembly and Lid to X-Axis Servo Bolts

IMG_6026.jpg
IMG_6027.jpg

This step was tricky. First, I threaded the camera USB cable and trigger servo cable up through the center hole and made sure the Y-Axis servo cable was threaded down into the hole and plugged into the Servo HAT.

Then, I set the Lid Piece ( still attached the Y-Axis Frame Main Piece) on top of the X-Axis Servo Mounting Plate so that the two M3x35mm screws poked through the two open holes on both the lid and Y-Axis Frame. I did need to enlarge the holes a bit with a drill and use a screwdriver through the center hole to push the 35mm screws into position. Once they were in position though, they slid up nicely through the Lid and Y-Axis Frame and poked out the top. Then I used the two remaining Hex Nut Handle pieces with M3 nuts inside them to tighten the Lid down. When I was done, the lid was be locked to the X-Axis servo and spun smoothly on the X-Axis bearings mounted inside the Turret Base.

Attach Turret Underbody Y-Axis Frame

IMG_6029.jpg
IMG_6034.jpg

The last hardware step of this build is to attach the turret underbody to the Y-Axis Frame. I slid on the 8mm rod attached to the 80T Timing Pulley through the 8mm ID bearings on the Y-Axis frame. While doing this I made sure the rod also went though the flanges attached to the Turrent Underbody. I tried to center the underbody on the Y-Axis Frame and line up the 80T Timing Pulley with the 20T Timing pulley underneath it so the belt was parallel with the Y-Axis Frame supports. Then, I tightened the set screws on the underbody flanges.

Next, I added another flange to the 8mm rod on the side opposite the Timing Pulley on the outside of the Y-Axis Frame to make sure the 8mm stayed centered.

Turret Control Web App

Screenshot 2025-05-14 at 7.02.05 PM.png

I experimented for a while and ultimately landed on web sockets based web app to control the turret. This allowed the turret to respond quickly to input from the app and provided embedded streaming video which enables true remote control of the turret. I also liked that this solution doesn't require users to install anything, and because the turret would only be accessible on my home network, I wasn't worried about security issues.

My implementation was heavily inspired by Tobias Weis' robotcontrol-javascript project. The app has a dedicated mobile and desktop web interface with streaming video that allows it to be controlled via WebSockets from a computer or mobile device. I've tested on Google Chrome on iOS, Mac and Windows and is working for me on those platforms.

You can find the code and installation instructions on Github.

Have Fun!

main.png

Congratulations if you made it this far. Enjoy your new toy!