These guys built a fully-functional, autonomous sentry gun for Defcon 15, and it works quite well, as you’ll see in the videos.

To control the three servos (pan + tilt + firing), we are going to use the Pololu 8-channel servo controller. Normally we might use an atmega to do the control, however I already created code to control the pololu controller for another project and it�s really inexpensive/easy to use. If it required more complicated feedback or logic, a microcontroller might have been the better choice, but in this case it wasn�t, so the right decision was just to use the Pololu controller

[via Hackedgadgets]