Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: Conscripted on March 29, 2010, 02:46:39 PM

Title: How to controll a laser pointer from a microcontroller
Post by: Conscripted on March 29, 2010, 02:46:39 PM
Good afternoon all,

I'm in the design phase of a new project. I need to connect a laser to a microcontroller and I'm not sure what the best approach is. I intend to use a cheap off the shelf laser. I suspect that the laser may draw to much power to be powered by the microcontroller itself. Anyone have any experience with this?

Thanks
Conscripted
Title: Re: How to controll a laser pointer from a microcontroller
Post by: SmAsH on March 29, 2010, 02:57:44 PM
If you use a cheap laser could you not just use the battery that came with it and put a transistor where the switch normally is? Yes, a laser would draw to much current :)
Title: Re: How to controll a laser pointer from a microcontroller
Post by: Soeren on March 29, 2010, 06:44:17 PM
Hi,

I need to connect a laser to a microcontroller and I'm not sure what the best approach is. I intend to use a cheap off the shelf laser. I suspect that the laser may draw to much power to be powered by the microcontroller itself. Anyone have any experience with this?
A simple NPN transistor and two resistors will do, if the LASER can live off the same voltage as the controller. If it's a standard 3-cell pointer, a diode like 1N400x inline will drop a 5V line to around 4.35V, which should be just right for a 3-cell.

Do you need a schematic for this?
Title: Re: How to controll a laser pointer from a microcontroller
Post by: nottoooily on March 30, 2010, 02:28:49 AM
Be careful with the super-cheap laser pointers. I've found that the laser itself has about the same operating life as the batteries. Maybe I just got a bad batch, but it could be endemic!
Title: Re: How to controll a laser pointer from a microcontroller
Post by: Conscripted on March 30, 2010, 05:55:30 AM

Do you need a schematic for this?


A schematic would be great thanks
Title: Re: How to controll a laser pointer from a microcontroller
Post by: Razor Concepts on March 30, 2010, 08:46:07 AM
Replace LED and resistor with laser:
(http://www.techshire.com/freebies/LED4dummies_images/LEDNPN.jpg)
Title: Re: How to controll a laser pointer from a microcontroller
Post by: Soeren on March 30, 2010, 06:09:57 PM
Hi,

Replace LED and R1 with LASER and diode, in case of a 5V supply.
Make R2 somewhere around 3k3 to 4k7.

Title: Re: How to controll a laser pointer from a microcontroller
Post by: Hawaii00000 on March 30, 2010, 08:16:19 PM
I just thought I'd tag this on while we're talking about it. I tried this one with a spare transitor and a cheap laser, but I didn't work completely. It was on constantly (even when it wasn't supposed to be) but it got brighter when power was applied to the transisor. Suggestions?
Title: Re: How to controll a laser pointer from a microcontroller
Post by: Soeren on March 30, 2010, 11:05:13 PM
Hi,

It was on constantly (even when it wasn't supposed to be) but it got brighter when power was applied to the transisor. Suggestions?
You clearly didn't drive the transistor from a CMOS output, so it didn't shut off the transistor fully.
If you just used a switch, a push button or a functional equivalent which didn't drive the base low, put a resistor (say 10k) from the base to the emitter/ground.
Title: Re: How to controll a laser pointer from a microcontroller
Post by: amando96 on April 03, 2010, 11:03:00 AM
I like using these bad boys:
http://www.datasheetcatalog.org/datasheet/fairchild/4N35.pdf (http://www.datasheetcatalog.org/datasheet/fairchild/4N35.pdf)

they are easy to use, and a laser malfunction won't damage your micro!
It's also a good idea to use these with serial port/USB diy projects, your ports will be safe from little errors that could damage them...

Title: Re: How to controll a laser pointer from a microcontroller
Post by: Soeren on April 03, 2010, 11:33:21 AM
Hi,

they are easy to use, and a laser malfunction won't damage your micro!
It's also a good idea to use these with serial port/USB diy projects, your ports will be safe from little errors that could damage them...
A transistor (in OC configuration) won't backflow a malfunction either. It's a waste of money using opto-couplers here.
Title: Re: How to controll a laser pointer from a microcontroller
Post by: Admin on April 06, 2010, 10:26:34 PM
Not what you wanted to know, but still fun to watch :P

http://www.societyofrobots.com/robotforum/index.php?topic=4887.0 (http://www.societyofrobots.com/robotforum/index.php?topic=4887.0)

Robotic Cat Toy (http://www.youtube.com/watch?v=6sxnma4btrg#ws)

(http://afrotechmods.com/cheap/cat_toy/completed.jpg)