Introduction: How to Build an Arduino- Controlled Laser Gun With Recoil (a Work in Progress)

So this all started when I decided I wanted an air rifle. I've always enjoyed target sports and having now gained access to a garden, what better time to treat myself! However, when I started to look at the costs and potential hazards (including living behind a children's nursery), it made me think again. With a background in making random things such as motorised bicycles, fighting robots and drones, I decided to make my own laser rifle controlled by an Arduino board!

As you'll see, it's all very simple stuff and there's probably better ways of doing things but this was a step into the unknown for me as I haven't done any electrical component work for about 10 years, plus I've never done any programming before so bare with me and feel free to comment on ways to improve the end result!

From looking at the title and reading the blurb above, you're probably wondering 'what's he gonna shoot with that?!'. needless to say I'm 0.5 steps ahead of you! The original plan was to complete the rifle then begin making simple arduino targets using other instructables, but then I found this sweet-looking open source target system which uses paper targets and a webcam ( I'm obviously yet to give it a go but it looks much better than anything I was planning......

This is a work in progress so as I build and develop the gun, I'll provide updates and info.

Step 1: The Circuit and Components

Attached is the layout, along with a photo of the test circuit.

The components that I've used are:

  • Top Shot Elite PS3 or Xbox gun - perfect for a project like this as it has plenty of built in buttons and is built for both grown-ups and kids alike. Mine cost £3 so these definitely aren't expensive!!
  • The laser mount - printed in ABS so that it can be bonded easily with Acetone to the gun.
  • 3.3v 8hz Arduino Pro mini
  • 3v 0.85mw green laser (
  • two STP55NF06L N-Channel MOSFETs (ignore the label in the photo)
  • 24v 16kg solenoid (
  • ISD 1820 audio board and speaker (for the blaster sound!)
  • Diode - 15SQ045 15A/45V
  • 3s 11.1V 1000mah lipo
  • voltage step-down board that outputs 3.3v
  • voltage booster that outputs 24v
  • Single resistor on the test circuit's push button (can't remember the value)

The tools I used are:

  • online 3d printing service
  • breadboard and jumpers
  • soldering iron and kit
  • Glue gun
  • Heatshrink
  • Velcro
  • Assorted nuts and bolts

Step 2: The Arduino Code

I was fortunate to find someone who pretty much wrote this code for me as I struggled to grasp how to make the gun fire a single blast regardless of how long the trigger is depressed. I'm tweaking the code as I go along so this will change. However, its simple and works well!