PC Controlled Laser Turret

uzzors2k, Tue Apr 07 2009, 07:47PM

As a side project I've been working on a PC controlled laser turret the last few weeks. The idea was to cheaply and quickly whip up some kind of turret with a laser mounted on it, so if I ever wanted to, I could experiment with laser tracking. I didn't succeed in doing it quickly, but it was done cheaply. The mechanical part was the most difficult for me, so I put the least effort in it. tongue Rotational movement is provided by two sets of gear assemblies taken from old CD-ROM drives, which are simply glued together. The laser was taken from an old laser pen, which also had a LED flashlight. The laser/LED assembly was glued to one of the gears. That constitutes the basic hardware, which now only needs some means of being controlled.


1239131924 95 FT0 Img 0665

Given my conversion to AVR I chose to use the ATTiny2313 for this project. In terms of PC control I could use the parallel or serial port, but parallel is newb, and the AVR has a USART module built in, so serial it is. Some circuitry was made. More specifically I used a MAX232 to convert RS-232 level to TTL for the µC, some gatedrivers for motorcontrol, and otherwise there's just support circuitry for the AVR chip. The firmware for the AVR does nothing but receive an incoming serial byte, do some rudimentary error check, and write it to portb. I used MikroC Pro to make the firmware, but given the code's simplicity it could have been done just as easily in assembly.

1239132626 95 FT0 Img 0702

To ease steering the turret I also decided to make a dedicated windows application which could send the correct codes at the punch of a button. This was a first for me, and I made the mistake of starting with Visual C++, which blew me away. I now see why Visual Basic is more popular. After three days of work I churned out a simple little program far beyond what I had expected to achieve. It even gives error messages instead of crashing!

1239133003 95 FT0 Turret Software Screenshot

All in all it's a fun little gadget, but the gear reduction is too low so it's very jerky. I know servos are meant for this sort of thing, but I didn't have any. I'm not good at writing about projects after they're done, so do ask! Here's the firmware, schematic and software.
]firm_and_soft-ware__schemmie.zip[/file]

1239133173 95 FT0 Img 0705
Re: PC Controlled Laser Turret
hotcrazyfruit, Wed Apr 08 2009, 01:52AM

what you should do is get an astronomy laser pointer and get rid of the current limiting resistor i it. then set stuff on fire. that would be impressive.
Re: PC Controlled Laser Turret
Dr. H., Wed Apr 08 2009, 03:40AM

Good day guys

hotcrazyfruit wrote ...

what you should do is get an astronomy laser pointer and get rid of the current limiting resistor i it. then set stuff on fire. that would be impressive.


But be shure that the turret won't go crazy and set your house on fire hee hee ill

Are those DC motors that you are using for positioning ?

Cheers smile
Re: PC Controlled Laser Turret
..., Wed Apr 08 2009, 05:41AM

That is quite awesome! I agree though, you should steel a diode out of a fast (20x or so) dvd-burner and get a housing for it (you can get them on ebay pretty cheep, check out Link2 for a ton of info on such projects) and increase the laser power.

As to the motors, it seems like you have enough gear reduction, you just need to slow the motors down. you could probably rig something with a resistor and a few diodes from the output of the avr, so that one pin gives default full speed and another gives ex 1/10 speed, and have 2 buttons on your program large step or small step.
Re: PC Controlled Laser Turret
uzzors2k, Wed Apr 08 2009, 06:13PM

I'm using 5V DC motors for positioning. With the voltage drop from the gate drivers the motors only see 2.5V. I've thought about different ways to get better precision, but as is the motors have very little torque. To the point that any further decrease in power would make them too weak to overcome the mechanical resistance from the signal wires!

I just purchased and received a PHR-803-T module on ebay, so we'll see about the laser upgrade. wink
Re: PC Controlled Laser Turret
Dr. H., Wed Apr 08 2009, 06:42PM

Why don't you consider upgrading to steppers ? There are some very cheap half-step drivers that will give you very good positioning with some gear reduction, and you will be able to exactly point it where you want. Also you only need direction and clock signal for every stepper.

Cheers smile
Re: PC Controlled Laser Turret
Renesis, Wed Apr 08 2009, 08:20PM

Nice project, that is not something you see everyday.

You could use a couple of servo motors like those used on rc cars. They are both cheap and powerful.

Wouldnt it be neat if you could steer the turret with your mouse, like a first person shooter game?
Re: PC Controlled Laser Turret
ConKbot of Doom, Wed Apr 08 2009, 09:52PM

Renesis wrote ...

Nice project, that is not something you see everyday.

You could use a couple of servo motors like those used on rc cars. They are both cheap and powerful.

Wouldnt it be neat if you could steer the turret with your mouse, like a first person shooter game?
and with a laser you could use the main laser itself with a few photodiodes as a home position setup... have it look up till the laser hits a photodiode directly above it to home elevation, and then rotate down 30 degrees and rotate till you hit one to home azimuth
Re: PC Controlled Laser Turret
hotcrazyfruit, Thu Apr 09 2009, 04:00AM

i just remembered of another way, you could use the same technology old ball mice use. having a perforated wheel, then a photo transistor and led . then mounting the wheel to the axel of the part that rotates and elevates the laser. probably use an IRED so it doesent glow) and have a circuit count the number of times the photo transistor receives a pulse of light. this could be used to calculate the angle of the laser, as long as you know how many perforations there are in the wheel. take apart an old mouse and see for your self, its actually quite a far fetched idea, and i was surprised when i took one apart to see that.
Re: PC Controlled Laser Turret
Ryan Parle, Thu Apr 09 2009, 01:37PM

One of my other hobbies is AstroPhotoraphy, and i have been helping a friend develop his own system for a motor driven encoded mount for his telescope.

We have actually used an old serial ball mouse to alow confirmation of the mount being in the correct position, we drive the mount using stepper motors ripped out of an old printer and the driver board is an Omnima driver board.

others have used the ardunio (SP) board to controll their mounts, in order to supply the current needed by the motors a seperate driver baord was made, i dont know the specs, but i would imagine for somthing as small as this project the it might be possible to drive the motors directly.
Re: PC Controlled Laser Turret
Killa-X, Sat Apr 11 2009, 12:21AM

Skylasers is going to be creating adjustable slider lasers soon, for like 0-40, 0-80, 0-130, and so on. If you don't mind spending the money, you could buy an adjustable slider green burning laser. Then connect a servo to the slider and have your computer control the power, to be a pointer, or a burning laser :)
Re: PC Controlled Laser Turret
uzzors2k, Sat Apr 11 2009, 03:28PM

If/when I make another one I'll put an airsoft gun on it and use steppers methinks. Mouse control would awesome, especially with a webcam to see the target.
Re: PC Controlled Laser Turret
Conundrum, Sat Apr 11 2009, 05:15PM

3200 step driver in EPE... then there's the Lightscribe read diode hack.. :)

Re: PC Controlled Laser Turret
Killa-X, Sat Apr 11 2009, 06:24PM

How advanced are you into coding... I know once on the show 'prototype' they develop a way to use a special marking on a persons shirt, that can draw a 3D shape on it to keep track...

Where I'm going is this: Are you advanced enough to mount a camera to it, and have it track? I use to play with Autoit back in the days, and I did Pixel tracing... So I was able to shine a green laser on the wall, and my computer mouse would move to that location. Same deal with you, except your gun moves to that location.

Tad advanced, buy possible no? Auto / Laser follow is fun!!
Re: PC Controlled Laser Turret
uzzors2k, Mon Apr 13 2009, 01:47PM

I'm not that good at programming, at least not yet. I know enough about C, Basic and now Java to get things done, but I imagine image processing is a totally different league of uber hacking. I see paint-ball turrets are being made all the time now, and tracking software can be purchased on ebay (for 1000$). I expect some powerful open-source software will become available sooner than I have time to make another turret, so I'll just sit tight for now. It would rock though, a my-little-turret to acompany my-little-carbine.
Re: PC Controlled Laser Turret
Killa-X, Mon Apr 13 2009, 08:03PM

Hah... Most I've down with chips in C, was program a Yahtzee type game onto a 24X4 character LCD.. Only allows 7 custom characters, so the dice worked out good :) I've messed with codes that I've got offline that play Pacman on your TV, but I never fully learned how it works yet. Needs at least 64KB of space, so I have the ATMEGA644P chip :)

Nice.. Gun there, Uzzors.. Good luck with your project though!
Re: PC Controlled Laser Turret
Renesis, Mon Apr 13 2009, 08:31PM

my-little-carbine.

Powerlol'd! Thats especially designed for unicorn-hunting cheesey
Re: PC Controlled Laser Turret
uzzors2k, Tue Apr 14 2009, 01:08PM

Killa-X wrote ...

Nice.. Gun there, Uzzors.. Good luck with your project though!
Don't even begin to think I would own one of those! cheesey