Electrical – Improve switching speed for a <50mW laser with an Arduino and Transistor

arduinolasertransistors

I'm trying to build a "laser harp" device similar to this: (http://www.instructables.com/id/Frameless-Laser-Harp/), but I'm having trouble switching my laser on and off fast enough, and for full disclosure, I'm very comfortable with software, but this is my first experience with circuits and hardware.

Basically, I have a <50mW green laser bought off Amazon for under $20, so, yes, it's not the greatest laser in the world. It draws 300mA at 5V.

My 2N2222 transistor's collector is connected directly to a 5V source, the emitter is connected to ground, and the base is connected to a digital pin on my Arduino.

I can successfully turn the laser on and off from code, but if the digital pin is on for less than 100 milliseconds, the laser loses brightness quickly. I have to have the digital pin on for at least 60 milliseconds to get the laser to light up at all.

I can switch an LED on and off very quickly, so I know my transistor can switch fast enough, but my guess is that the laser needs a certain amount of current before lighting and that it takes a while for the transistor to get to that point.

My question is this:

Using a 2N2222 transistor and this 300mA laser diode, is there a way to switch it on and off with 1ms resolution? Do I need different components to make this happen?

EDIT:

This is the closest I can get to a datasheet for this laser… from amazon:

  • Dimensions: φ12x51mm( with PCB circuit size)
  • Output Wavelength: 532nm (+-10nm)
  • Output Power :<50mW
  • Laser Shape: Dot
  • Beam Divergency: <1.5mard
  • Shell material: Brass
  • Circuit Control: ACC line
  • Reverse Polarity Protection: Yes
  • Working Voltage: DC = 3.7V
  • Working Current: I <250mA
  • Warm-up time: None
  • Operating temperature: 0 C ~ +40 C
  • Storage temperature: -10 C ~ +55 C

Best Answer

As mentioned in the comments, it sounds like your laser has a built in current regulator that may not be intended to switch that fast.

If so, you might want to remove the driver from the laser and add your own 300mA switched current regulator. Something like this should work.

schematic

simulate this circuit – Schematic created using CircuitLab

Though watch the power dissipation. A 2N2222 is going to be marginal depending on the forward voltage of the diode. If need be, switch to a pair of higher power transistors.