Sunday, 28 June 2009

Arduino + Laser Pointer + Servos = Homemade Laser Cannon

After discovering how ridiculously easy it was to control a servo motor from the Arduino, I wondered what 2 servos and a laser pointer could do...



Long story short, I now have a computer controlled laser cannon muhahha!

The whole thing is controlled via serial commands, which let me:
  • Control pitch (Y) and yaw (X)
  • Turn the laser on and off
  • Make the laser flash or not
  • Follow a pre-programmed "sweep" pattern
  • Control whether or not the laser turned off while moving and on again

I started by sending the commands by hand from the Arduino IDE, but then I wrote a Java app that let me control all the options using a GUI, which made things a lot easier. It can also record the position of the laser at given times, and play these back, allowing the laser to follow a path:



Finally, I added some physical aiming controls (two variable resistors to control X and Y). This makes it a lot easier to point it at objects, and I can use it along side the Java interface.

If you want to build your own, the Arduino PDE file is here. There's not much actual "building" required - if you have two servos, Blu Tac them together and sticky tape a laser pointer on the side. I'm using a heavy shot glass as a frim base for mine ;)

The laser pointer and servos drew too much power for my Arduino to handle on its own, so I have them hooked up to an external 4.5V supply. The servos have a separate +V and signal wire so they were easy enough to wire up, but I had to use a transistor to switch the laser pointer.

I'm not quite finished the Java app yet, but if you're interested leave a comment and I'll post what I have so far.

6 comments:

Anonymous said...

great post, i like this video, cooool






http://www.laser-pointers.net

Anonymous said...

hello I would like to have your java applet for my studie at the TUE so I can try som things out I wonder if that's okay?

I don't have any experience with java yet so can you also sent me an explanation about how I should Use it.

Kind Regards,
M.P Karapun

green laser pointer said...

WOw this is really video. I like your invention. It is just like a robot.

Green laser pointer - http://www.techlasers.com

ringi said...

Is that a analog or digital servo?

All 4 Christ said...

First: Very nice project

Second: If you are show the world how awesome your talents are, the least you could do is share the sketch and PCB layout. I know when I get this project finished I will gladly share!

Unknown said...

Hi. Your link to the PDE file does not seem to be working. Do you mind sharing the code via email? Thanks a lot