In 2017, I built something I'd always dreamed of creating: an autonomous nerf turret that could detect and track targets in real-time. This project combined computer vision, hardware integration, and control systems—challenging me to learn CAD software and work across the full stack from sensing to actuation.
Computer Vision with Kinect
For the sensing system, I chose the Microsoft Kinect camera. The Kinect was revolutionary for its time—it used structured light depth sensing and infrared imaging to create 3D maps of the environment. By projecting a pattern of infrared dots and measuring their distortion, it could determine the distance to objects in real-time. The device came with built-in skeleton tracking algorithms that could identify human body positions and joint locations at 30 frames per second, making it perfect for this project and affordable at around $100.
Mechanical Design & Actuation
I designed and 3D printed custom mounts to create a two-axis gimbal system. For actuation, I used powerful servo motors salvaged from RC cars to control the pitch and yaw of the nerf gun. These servos provided the torque needed to rapidly reposition the gun while maintaining precise angular control. To automate firing, I integrated a relay module connected directly to the trigger mechanism—essentially giving the turret a robotic finger.
The Algorithm
Target Acquisition: Using the Kinect's skeleton tracking, identify all humans in the field of view and calculate their center of mass.
Aim Control: Command the servo motors to position the turret so its reticle aligns with the target's center of mass.
Dwell Time: Track whether the target remains within the firing zone (a generous area to account for natural movement) for at least 5 seconds.
Fire: Once the dwell threshold is met, activate the relay to fire continuously until the target exits the zone.
Re-acquisition: Return to scanning mode and repeat the process for new targets.
Simple, effective, and incredibly fun to watch in action.
Demo Video
Evolution: Custom Blaster Design
The next iteration focused on weight reduction. The stock nerf gun was bulky and heavy, limiting the turret's speed and responsiveness. I completely disassembled the blaster and stripped out the firing mechanism, reverse-engineering it to create a much more compact version.
In the process, I discovered I could improve performance by increasing the voltage to the flywheel motors. This modification significantly increased both the rate of fire and projectile range—turning it into a surprisingly formidable device.
Lightweight Blaster Demo
While I never got around to mounting this improved blaster onto the turret platform, the project taught me invaluable lessons about mechanical design, motor control, and the satisfying challenge of building something that exists at the boundary between hardware and software.
Technical Stack
- Microsoft Kinect for depth sensing and skeleton tracking
- Custom 3D-printed gimbal mounts
- RC servo motors for pan/tilt control
- Relay module for automated firing
- Python for computer vision and control logic
- Arduino for hardware interfacing