The Zombie Gun

This post details the operation of the anti-zombie Nerf gun.

The gun is mounted on a turntable, the interior of which is shown below.

A servo is mounted in a 3-legged “caddy”.  The legs of the caddy have Lego wheels which run on a track to support the turret, providing very smooth movement combined with a very stable gun mount.  There is also a centre bearing (which is under the servo in this diagram).  The servo drives a Lego gear which engages on a 3D printed rack.  Since the diameter of the rack is about four times that of the gear, the mechanism divides the travel of the servo by about four.  Hence the ±90° turn of the servo results in a ±23° turn of the turret. 

A tilt mechanism, which is shown below, is mounted on top of the turntable.  Here, two Lego gears are used, one attached to the servo drive shaft, the other to the gun’s side support.  Again, a reduction ratio is used so that the ±90° turn of the servo results in a ±23° tilt of the gun.

Finally, the interior of the gun is shown below.

The motors, flywheels, and barrel liner (which is rifled!) are used from a Nerf gun.  A Lego pinion is attached to a servo; it engages in a 3D printed rack so that it can push a Nerf dart between the flywheels, hence firing the gun.

As it stands, this design would have a problem.  Vibrations from the motors cause the Nerf darts to creep forward into the path of the flywheels.  Hence, the gun will fire darts even if the trigger servo has not moved.  To counter this, the lid of the gun has a hole into which a tuft of bristles from a toothbrush have been glued.  This provides enough resistance to stop the darts wandering into the flywheels due to vibration, but not so much that the gun can’t fire.

The complete unit is shown below.

The gun has a Raspberry Pi camera mounted under the barrel; hence it “looks” wherever the gun is pointing.  A dedicated Pi 4 is held within the lower box, which attaches to the back of the robot.  An interface circuit connects to the Pi via the Pi’s header, to a servo interface that was built for the “Feed the fish” game in 2022, and to the robot via an AX-12 serial servo interface.

We plan to mark the zombie targets with a bright red spot of light from a torch.   Code has been written to drive the servos until the centre of the red spot of light coincides with a specified pixel in the camera’s field of view.  When the light spot stops moving in the field of view, then the trigger is operated.  The actual pixel chosen for this can be set in the gun’s parameters in order to align the aim of the gun.

Leave a comment