I have a circuit I designed for a raspberry pi to turn a laser off and on. I designed it to supply approx 22mA but it's barely getting 11mA. I've tried numerous tests but I can't figure out what's wrong

Circuit: enter image description here

Vcc = 5V, GPIO BCM 21 = 3.3V, voltage loss across laser (L1.V) = 4V

For that circuit, I tried to get R2 with the eq $$Vcc−I2R2−L1.V−Q1.V_{CE}=0 \\ R2 = \frac{1}{22mA} (5V - 0.02V (negligible) - 4V)$$ which gave me $$R2 \approx 49\Omega$$

Using that, I've tested these values $$ \begin{align} I_{R2} &\approx 10.8mA (!) \\ I_{R1} &\approx 1.8mA \\ L1.V &\approx 4.6V \\ Q1.V_{CE} &\approx 0.02V \\ \end{align} $$

edit updated L1.V from 4 to 4.6
update the laser isn't just a simple diode, it has integrated APC

2n4401 npn bjt
syd1230 laser (link is to HML1230 docs because SYD1230 docs do not appear to exist and laser closer resembles HML1230 in appearance, ie. has focusable acrylic lens)

I've looked over all the data sheets (the whopping 2 of them), rechecked calcs, design... I can't figure out what I didn't account for. Why isn't \$I_{R2}\$ closer to the expected 22mA

  • \$\begingroup\$ Whats the actual voltage across the laser and the resistor and the transistor when you turn it on? Are those your calculated values or measured? Also across R1? Did you measure the resistors or just used the color value? \$\endgroup\$
    – Passerby
    Jul 11, 2017 at 4:53
  • \$\begingroup\$ Can you link to laser datasheet? 4V seems like an odd value for a bare diode \$\endgroup\$
    – sstobbe
    Jul 11, 2017 at 4:55
  • \$\begingroup\$ Posted the datasheet for the laser. The total voltage is 4.99V, I made a recording mistake on L1.V originally. R1 was read from the resistor, R2 was measured \$\endgroup\$
    – Alter
    Jul 11, 2017 at 5:39
  • 2
    \$\begingroup\$ Note this is not a bare diode: "Built In APC Driver", you can replace your resistor with a diode to drop 5V to ~4.4V for Vin spec of diode module \$\endgroup\$
    – sstobbe
    Jul 11, 2017 at 5:40
  • 1
    \$\begingroup\$ APC = Automatic Power Control, its a current source with optical feedback, if its a good module the current should be the same at any allowable supply voltage \$\endgroup\$
    – sstobbe
    Jul 11, 2017 at 15:31

1 Answer 1


Did you check the power supply from which you power the LASER branch? Summing all the voltage drops in that branch gives 0.02V + 4V + 12mA × 49Ω = 4.6V, which are not the 5V you should have.

It seems that your power supply cannot handle so much current and is dropping out.

Check that your power source for that branch is not overloaded by other loads in your circuit, since 12mA seems a bit too low to overload a power supply, even small on-board regulators.


After you corrected your question and added the LASER's datasheet it becomes apparent that you are outside of that LASER's specs. Just for a tiny 0.1V, now, but you could have damaged your laser during power-up when the whole 5V could have been fed to the LASER module.

That module expects 4V constant voltage supply (±0.5V max). Connect the module to a bench power supply set at exactly 4V and try if it's still working. If it is, then follow the advice in a comment of @sstobbe: get rid of R2 and put a diode in series with the module.

For extra safety, since at low currents diodes have a smaller voltage drop and so a 0.7V drop cannot be guaranteed (e.g., it could be 0.56V, depending on the diode actual model), it would be better to put two diodes in series, at least initially, just to be sure you work on the lower side of the specs.

After you measure the actual voltage drop across those diodes you might remove one and see if it works still in specs (but if it works with two diodes, maybe it's better to leave it that way, just in case your power rail has a small hiccup).

  • \$\begingroup\$ you caught a mistake I made, apparently I recorded the voltage for the wrong test (I tested R2 = 97 Ohms before the one I posted). I checked the power supply and get 4.99V, with roughly 4.5-4.6V loss over the laser and 10.8mA \$\endgroup\$
    – Alter
    Jul 11, 2017 at 5:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.