I have a circuit where the base transistor (PN2222a) leg is plugged into the pin 9 of the Arduino. When I power everything up and send the signal from the Arduino to the transistor base leg, the laser diode doesn’t light up, but my design strictly follows Complete Tech Guide to Laser Diodes. In addition, the Arduino is powered through a cable that is plugged into the computer and I am using a LED rocker switch if that helps.
Is there anyone has ideas? Thank you in advance.
I am assuming the emitter of the transistor is connected to ground. The base needs a series resistor as the base / emitter junction will be at 0.6V and effectively kill the Arduino output. The pn(2n) 2222 is a very fast and good switching transistor but you have to treat it right.
To calculate the value of this resistor you have to know the collector (laser) current, supply voltage and hfe of the transistor. You will probably need to know the expected voltage drop of the laser to calculate a laser current limiting resistor.
As you can see there is a bit more in this than just “plugging it in” and expecting a result.