Connecting the two servos and the electronic trigger to the Arduino is relatively simple. The wiring is shown in the first picture. The 1k resistor protects the Ardunio from electric shorts and the diode prevents stray electricity and sparks. You can of course leave your circuit on the breadboard, but I decided to use a perfboard.
The voltage of the battery pack connected to your gun motor controls the firing rate. If you want your gun to shoot faster feel free to use a second battery pack, or one with a higher voltage rate.
Thanks a lot lo Bob Rudolph for writing the awesome code for the sentry gun (you can also download it here
). Just upload the files to your Arduino. Make sure to adjust the servo positions to your gun!
PSG Arduino code: