Hacked pulsed laser driver using Arduino

  • Thread starter Thread starter neanderthalphysics
  • Start date Start date
  • Tags Tags
    Arduino Laser
Click For Summary

Discussion Overview

The discussion revolves around the attempt to modify a 5mW laser pointer to be pulsed using an Arduino as a driver. Participants explore various circuit designs, components, and safety considerations related to laser usage.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant describes their initial setup using an NPN transistor to control the laser but reports it is not functioning as expected.
  • Another suggests testing the transistor circuit independently of the Arduino to ensure it works before integrating it.
  • Some participants propose using a 555 timer IC instead of a transistor for pulsing the laser, citing potential advantages.
  • Concerns are raised about the safety of overdriving the laser, with participants discussing the risks of eye damage from laser exposure.
  • There is a discussion about the voltage drop across transistors compared to MOSFETs, with suggestions to try MOSFETs for better performance.
  • Participants inquire about the specific wavelength of the laser and the safety rating of the goggles being used.
  • One participant mentions the potential for laser pointers to exceed their stated power ratings, raising additional safety concerns.
  • Another participant corrects the circuit configuration, emphasizing the correct connections for the laser and batteries in relation to the transistor.

Areas of Agreement / Disagreement

Participants express various opinions on circuit design and safety, with no clear consensus on the best approach to pulsing the laser or the implications of laser safety. Multiple competing views on the use of different components and configurations are present.

Contextual Notes

Some participants note that the voltage from the two AAA batteries may not be sufficient for certain laser types, and there are unresolved questions about the specific characteristics of the laser pointer being used.

Who May Find This Useful

Individuals interested in electronics, laser safety, and circuit design, particularly those looking to integrate Arduino with laser systems.

neanderthalphysics
Messages
53
Reaction score
6
TL;DR
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.

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?
 
Engineering news on Phys.org
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.
 
  • Like
Likes   Reactions: sysprog and neanderthalphysics
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.
 
  • Like
Likes   Reactions: neanderthalphysics
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.
 
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:
 
  • Haha
Likes   Reactions: berkeman
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.
 
  • Like
Likes   Reactions: sysprog
neanderthalphysics said:
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)?
 
  • Like
Likes   Reactions: sysprog
berkeman said:
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:
 
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.

sysprog said:
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:
Borek said:
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?

berkeman said:
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.
sysprog said:
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.
 
  • Like
Likes   Reactions: berkeman
  • #10
neanderthalphysics said:
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:
  • Like
Likes   Reactions: sysprog
  • #11
neanderthalphysics said:
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

  • voltage_time_history.png
    voltage_time_history.png
    6.8 KB · Views: 319
  • circuit_diagram.png
    circuit_diagram.png
    13.6 KB · Views: 329
  • #13
neanderthalphysics said:
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.
 
  • Like
Likes   Reactions: neanderthalphysics
  • #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

  • circuit_diagram_v2.png
    circuit_diagram_v2.png
    14 KB · Views: 311
  • #15
Borek said:
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
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%20Pointer%20Safety%20Factsheet.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
 
  • Informative
Likes   Reactions: 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

  • voltage_time_history.png
    voltage_time_history.png
    7.3 KB · Views: 288
  • #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

  • voltage_time_history.png
    voltage_time_history.png
    7.2 KB · Views: 287
  • #19
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
neanderthalphysics said:
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.
 
  • Like
Likes   Reactions: davenn
  • #22
Paul Colby said:
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.
 
  • Like
Likes   Reactions: Paul Colby
  • #23
Thank you for your advice.
I implemented the changes you suggested but it is still not working.
 

Attachments

  • circuit_diagram_v2.png
    circuit_diagram_v2.png
    15.1 KB · Views: 274
  • voltage_time_history.png
    voltage_time_history.png
    7.2 KB · Views: 279
  • #24
neanderthalphysics said:
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
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.
 
  • #26
OK thanks for your input.
I replaced the laser diode with a resistor, and the battery with a lab PSU set at 3V.
I am still getting a flatline of voltage across the resistor. The PSU reports no current flowing through it.
Think all my experimentation has killed the transistor?
 

Attachments

  • voltage_time_history.png
    voltage_time_history.png
    6.8 KB · Views: 231
  • circuit_diagram_v4.png
    circuit_diagram_v4.png
    11.5 KB · Views: 244
  • #27
neanderthalphysics said:
the battery
What battery ? Don't see none...
 
  • #28
Okay, one needs a battery. ##V_{BE}## should be about +0.7V for a silicon NPN for it to be saturated. ##V_{CE}## in this state would be zero should the battery be absent. Your scope trace shows a negative ##V_{BE}##. Signs of voltages and currents really matter here. An NPN is like a current control where a small current, ##I_B##, injected -into- the base results in an ##I_{E}## ##\approx \beta I_{B}## where ##\beta\approx 100##. I think the transistor (any NPN transistor) spec sheet would have all these things plotted and would be helpful for you.
 
  • #29
OK guys, got it working :smile:
Thanks for everyone's help.
The problem was the transistor - it was faulty.
Replacing it with another transistor got the circuit to work.
The circuit without the battery with a PSU instead is attached below.
 

Attachments

  • circuit_diagram_v5.png
    circuit_diagram_v5.png
    10.7 KB · Views: 285
  • voltage_time_history.png
    voltage_time_history.png
    7.8 KB · Views: 235
Last edited:
  • Like
Likes   Reactions: Paul Colby
  • #30
Looks as if it only works because the transistor is abused to short-circuit the "voltage" source (the psu)
 
  • Like
Likes   Reactions: rbelli1

Similar threads

  • · Replies 7 ·
Replies
7
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
7K
Replies
6
Views
5K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 13 ·
Replies
13
Views
7K
  • · Replies 8 ·
Replies
8
Views
5K
  • · Replies 38 ·
2
Replies
38
Views
6K