Hacked pulsed laser driver using Arduino

  • #1

Summary:

Want to be able to hack a laser pointer to pulse according to an input signal from an Arduino. Have transistors, stepper motor drivers, oscilloscope and other basic electronics to play with.

Main Question or Discussion Point

Hey all, I am trying to hack a 5mW laser pointer to be pulsed according to a driver signal from an Arduino. The laser pointer itself has an internal forward bias resistance of 22k and is driven by 2x AAA batteries.

An oscilloscope says that the output voltage from the Arduino is a +5V continuous square wave function as intended.

I tried at first driving a NPN transistor directly from the Arduino (emitter - base loop), with the collector-base loop containing the 2x AAA batteries in series to the laser but for some reason it is not powering the laser.

Any ideas why? Happy to test and provide pictures/diagrams if necessary.

What about driving the laser pointer using a stepper motor driver (like an A4988 chip) instead? I will need to have voltage and current dividers to protect the laser.

Also, one final question about safety. If the laser pointer is overdriven by voltage or current, do I risk the laser becoming a hazard to the eyes?
 

Answers and Replies

  • #2
Try driving the laser with the transistor circuit on its own without the Arduino first and get that working. Lasers are dangerous to eyes period. No? Overdriving an diode is likely just to burn the thing out. Unless you are already staring at the laser I don’t see how this could be a danger to eyes.
 
  • #3
853
402
Why do you want to do this? If I wanted to do this I'd use a 555 timer IC. Depending on your especial purposes, something else might be a preferable option -- and please understand that, even though some people use laser pointers as feline amusement devices (cat toys), lasers are seriously not toys.
 
  • #4
Hey sysprog, thanks for the advice. Because I don't have this IC in the lab at the moment and I would have to order it and it would take a few days to arrive. Thought I could get quick results with just a transistor.
Understood about lasers not being toys, I use safety googles.
 
  • #5
853
402
I'm shocked to learn that you don't have any 555s lying around! What are you? NOT Radio Shack? What's up with THAT? You probably don't have a DTMF decoder either!
:rolleyes:
 
  • #6
Borek
Mentor
28,137
2,648
NPN transistor "eats" some of the voltage (something like 0.6 V give or take), I would try MOSFET.

It doesn't have to be THE reason, but trying won't hurt.
 
  • #7
berkeman
Mentor
56,139
6,168
Understood about lasers not being toys, I use safety googles
I don't think you've said what wavelength/color your laser pointer is. What laser safety rating do your goggles have (not googles)?
 
  • #8
853
402
I don't think you've said what wavelength/color your laser pointer is. What laser safety rating do your goggles have (not googles)?
Thanks for those good words of warning.

Even a welder's helmet may not be secure enough against strong coherent light, but the power rating specified (5mW ) is such that stopping looking when you feel discomfort during a 'less than half a second' glance will probably not hurt (or seriously and permanently eff up) the retina -- "and don't let lasers get pointed into eyes!!!!!".

Regarding visible light laser spectra: blue is great for computer network channels because of the bandwidth, and green is great for firearm-aiming optical devices because we have for that range of frequencies more of the right variety of cones in our retinas, but I suppose almost everyone reading here on PF already knew all that. :wink:
 
  • #9
Firstly thank you everyone for your input :smile: I am eager to learn new things.

One question I had for you all was whether transistors are the solid state analogues of flashtubes? In flashtubes you need a trigger pulse across a smaller spark gap (analogous to the base-emitter junction) to turn the thing to a conducting state.

I'm shocked to learn that you don't have any 555s lying around! What are you? NOT Radio Shack? What's up with THAT? You probably don't have a DTMF decoder either!
:rolleyes:
Hey, you forget this is Stone Age physics. In my cave I have my club, bearskin, fire pit and a few other goodies. 555s appeared only a few thousand years later :wink:


NPN transistor "eats" some of the voltage (something like 0.6 V give or take), I would try MOSFET.



It doesn't have to be THE reason, but trying won't hurt.
Thanks, that explains some of the voltage drop. Why do transistors have a voltage drop but not MOSFETs?

I don't think you've said what wavelength/color your laser pointer is. What laser safety rating do your goggles have (not googles)?
Green laser pointer. I am using orange goggles with a 5 log reduction in the wavelength range.


Thanks for those good words of warning.

Even a welder's helmet may not be secure enough against strong coherent light, but the power rating specified (5mW ) is such that stopping looking when you feel discomfort during a 'less than half a second' glance will probably not hurt (or seriously and permanently eff up) the retina -- "and don't let lasers get pointed into eyes!!!!!".

Regarding visible light laser spectra: blue is great for computer network channels because of the bandwidth, and green is great for firearm-aiming optical devices because we have for that range of frequencies more of the right variety of cones in our retinas, but I suppose almost everyone reading here on PF already knew all that. :wink:
Yeah but we have to still be careful about the stated powers of laser pointers. I read some warnings that some laser pointers true powers exceeded the declared ones, at great hazard to the user's eyes.

By the same token from a safety perspective green lasers are best at causing lasting retinal damage...
I could switch to red but I also don't happen to have one lying around ATM.

I don't understand why the bandwidth is greater for blue (because of the higher frequencies?) If data is transmitted by on/off states then the bandwidth for IR should be the same as UV.
 
  • #10
Tom.G
Science Advisor
2,869
1,632
I tried at first driving a NPN transistor directly from the Arduino (emitter - base loop), with the collector-base loop containing the 2x AAA batteries in series to the laser but for some reason it is not powering the laser.
Aiie, there be a problem! The LASER and battery should connect to Collector and Emitter. Negative to Emitter and Positive to Collector.

And maybe another one -- are those AAA batteries perhaps Lithium batteries. A quick web search shows at least some Green LASERs have a threshold volatge around 6V, not the apparent 3V you may be using... but you don't say.

The Emitter should also be connected to the Arduino Ground (Common), and the Arduino output to the Base.

There should also be a series resistor between the Base and the Arduino output to limit Base current. You didn't give a part number so YOU look up the transistor data sheet for the maximum base current and select the resistor accordingly.

Oh, by the way, 5mW of laser power Will cause eye damage, even by reflection from a surface. If I recall correctly, here in the US, anything above 2mW must generally be enclosed with interlocks to shut it off if the enclosure is opened. Eye discomfort is assuredly NOT a means of detecting damage, the eye retina does not have any pain receptors. The first indication of damage is you have a blind spot; for life.

Cheers,
Tom
 
Last edited:
  • #11
326
143
Summary: Want to be able to hack a laser pointer to pulse according to an input signal from an Arduino. Have transistors, stepper motor drivers, oscilloscope and other basic electronics to play with.

Hey all, I am trying to hack a 5mW laser pointer to be pulsed according to a driver signal from an Arduino. The laser pointer itself has an internal forward bias resistance of 22k and is driven by 2x AAA batteries.
Edit: your circuit is incorrect. Laser and batteries must be connected in emitter-collector loop, not collector-base.
Also, 2xAAA may have a problem driving blue lasers with NPN driver. Either add third AAA cell or use MOSFET drivers.
 
Last edited:
  • #12
Hi everyone.
Attached are my circuit diagrams and oscilloscope traces. The legend on the graph corresponds to the locations marked in the circuit diagram.
The voltage of the two AAA batteries is 2.74V. By themselves they run the laser pointer fine.
The driving signal is a +5V/0V, 2 second period, square wave.
Will read the latest responses now.
Any other readings/info you need I will be happy to provide.
 

Attachments

  • #13
Borek
Mentor
28,137
2,648
Why do transistors have a voltage drop but not MOSFETs?
I am afraid I am not qualified to answer that in more details than "these are different devices with different principle of operation, no wonder they behave differently". Precise answer needs to dissect how the np junction works.
 
  • #14
Thanks guys. How does this circuit look?
I note that the maximum base current of a TIP117 transistor is 50mA, which is more than the maximum current per GPIO of 40mA.
 

Attachments

  • #15
I am afraid I am not qualified to answer that in more details than "these are different devices with different principle of operation, no wonder they behave differently". Precise answer needs to dissect how the np junction works.
Thanks, I like it that you know the limits of your knowledge and are not afraid to say it :smile:

But let's hazard a guess for the sake of discussion. Could it be because MOSFETs are voltage operated devices, which means near zero current flow through the gate (hence 0-current x Resistance = 0 voltage drop) while transistors have a small base current which means a small voltage drop?
 
  • #16
853
402
Tom.G said:
Oh, by the way, 5mW of laser power Will cause eye damage, even by reflection from a surface. If I recall correctly, here in the US, anything above 2mW must generally be enclosed with interlocks to shut it off if the enclosure is opened. Eye discomfort is assuredly NOT a means of detecting damage, the eye retina does not have any pain receptors. The first indication of damage is you have a blind spot; for life.
Pain is not the only kind of discomfort we can experience. Even reflected laser light from a cat-toy pointer off non-shiny surfaces is irritating to me and causes me to turn my gaze. Laser pointer beams inadvertently cast briefly across audiences can cause discomfort without causing pain or ocular damage.

From: https://www.ehs.uci.edu/programs/radiation/Laser Pointer Safety Factsheet.pdf
Possible optical hazards include startle effects, flash-blindness, glare, and after-images if a person is struck in the eye. Reports of those exposed include automobile drivers, airplane and helicopter pilots, sports figures, and the police. This is very dangerous since such exposures can cause serious accidents. Longer eye exposures can cause more permanent eye damage including retinal burns.
But when I just now asked myself, what would Safety Joe do, the answer was always be heedful of the advice of such advisors as @Tom.G
 
  • #17
Here are the oscilloscope readings for the circuit with the laser + battery put across the emitter-collector terminals. The laser remains unactivated.
 

Attachments

  • #18
Here are the oscilloscope readings with 3xAAA batteries in series instead of 2. The laser is still inactive.
I tested the laser again with 2x AA batteries directly connected to it. It works.
 

Attachments

  • #19
Paul Colby
Gold Member
968
206
Hey, it's early and all but isn't the battery in the schematic in #14 upside down? If not it could explain why my stuff never works.

[note added in proof] upside down relative to the transistor. Seems like the laser diode should be flipped around as well.
 
  • #20
I thought it is +ve terminal of the battery to +ve terminal of the diode and vice versa?
 
  • #21
Paul Colby
Gold Member
968
206
I thought it is +ve terminal of the battery to +ve terminal of the diode and vice versa?
The current by convention flows from the + terminal to the - terminal of the battery. What has me confused is that the current flow for a saturated NPN is down through the collector and out through the emitter. In your diagram the current is flowing up through the emitter and out the collector.
 
  • #22
Tom.G
Science Advisor
2,869
1,632
Hey, it's early and all but isn't the battery in the schematic in #14 upside down? If not it could explain why my stuff never works.

[note added in proof] upside down relative to the transistor. Seems like the laser diode should be flipped around as well.
Yes! Most definitely.
 
  • #23
Thank you for your advice.
I implemented the changes you suggested but it is still not working.
 

Attachments

  • #24
davenn
Science Advisor
Gold Member
8,909
6,411
Thank you for your advice.
I implemented the changes you suggested but it is still not working.

you DIDNT change it .... the battery terminals are still incorrect relative to the transistor
 
  • #25
Paul Colby
Gold Member
968
206
I also suggest replacing the laser with a 1k dummy load resistor. The laser is a diode which permits current flow only in one direction so getting it in wrong is a show stopper. Check the voltages across the the resister and make certain the transistor is switching as expected before substituting the laser.
 

Related Threads for: Hacked pulsed laser driver using Arduino

Replies
4
Views
5K
  • Last Post
Replies
4
Views
3K
  • Last Post
Replies
5
Views
4K
Replies
7
Views
2K
Replies
8
Views
2K
  • Last Post
Replies
3
Views
3K
  • Last Post
Replies
7
Views
7K
Replies
2
Views
4K
Top