Here is my latest creation..Sniepir
This robot is a Lego/Nerf Sentry robot. It is a combination of Lego Mindstorms and the Nerf Stampede machine gun. It has two tracks that can move it around to put it in the best location to do the dirty work. Each track is controlled by two XL PF Motors, so it takes four to drive it around. It also has an elevation device that can tilt the gun up and down to take aim. The trigger device is controlled by a Medium PF motor.
This robotic sentry operates in several different modes. It can be operated remotely with two remote controls, it can be fired manually, it can be set up to navigate around autonomously and it can be configured statically as an invisible trip wire booby trap.
To operate it in R/C mode, the NXT is turned off. One remote control is used to drive and navigate. On the second remote, one lever is used to pull the trigger for about one half of a second, which fires a three round burst. The other lever is used to adjust the elevation of the gun up and down.
To operate autonomously, the NXT is turned on and any series of commands are sent to the PF receivers through the HT IRLink. The robot could be set up with a compass sensor or an acceleration sensor to take in additional information about its environment.
But the best way is to use the sentry robot in Trip Wire mode. I use a laser pointer mounted on a frame that is set up some distance from the robot. I mounted a light sensor in a black box with a large hole in one end on the side of the sentry. The box is full of clear Lego bricks used to diffuse the light around and make the target for the light beam larger. The laser pointer is turned on and pointed at the target. The light sensor then takes a reading of the light intensity. When the light intensity is lowered by about ten percent for more than twenty milliseconds, a three round burst is immediately fired directly at the light source and the object that is breaking the light beam. Kaploweee!
There is also another feature which is an ultrasonic sensor mounted under the barrel of the gun. It is used as a back up of the light sensor trip wire, but the effective distance in very short and the light beam is far more useful.