I have been building a laser diode driver in Falstad, but for the first 200 μs there is a current spike of over 70 A! This would mean instant death for my laser diode.

If you are curious the laser diode is a NUBM08, and I have been running it with my lab bench power supply (before you guys yell at me in the comments: I have high quality goggles from Laserglow), and it works perfectly.

I want to make it battery operated now as I though it would be a fun project. It is built with four LM317s in parallel. Before you ask, I do know about the LM388, but I need to get this driver done soon, so I can't order them and get them here on time. I also don't have any switch-mode converters and I only have a couple of days (otherwise I would just order a cheap laser diode driver off AliExpress).

Schematic: enter image description here

I have attempted to add smooth start capacitors to both the laser diode and the regulators, but this didn't suppress the spike. I also added a reverse bias Zener diode parallel to the laser diode as I remember it suppressed the transients I got from simulated ESD, this didn't work either however. I am wondering:

  1. How to fix this
  2. If I can't fix this: is this just a problem with Falstad? I don't have an oscilloscope to verify if it is just Falstad.
  3. If it is also a problem in real life, would this kill my LD over time? I know that laser diodes aren't very tolerant of high current/voltage spikes, and so I want to solve this problem in the simulation (if it isn't simply a problem with the simulation) and not have to spend $20 on another laser diode (I am not expecting it to die after first use, however, I don't want to have to replace the diode after a few hours of light use). The period of 70+A is only 200 μs, which might not damage the diode. Here are some waveforms:

enter image description here

This is after I added the 4.6 V Zener diode:

enter image description here

This is just the linear regulators on startup. I am thinking I should just implement a soft-start system, and tried doing so with capacitors. The capacitors did absolutely nothing. I have no power MOSFETs/IGBTs/BJTs (just small-signal TO-92s), so I didn't implement a soft start the way GreatScott did in one of his videos.

Could somebody here help me with this? I am competent with both electronics and lasers. I have not done anything with mains yet, but regularly do stuff with low voltage, high current (melting metal, carbon arcing, etc.) and I have safely operated a 5 W laser before on numerous occasions. I am just not as good at certain areas of this field.

  • \$\begingroup\$ Post the simulation so folks can have a look at it. In Falstad do 'save as link', copy to your clipboard, then insert a link in your question with that saved link. \$\endgroup\$ Mar 2, 2023 at 17:57
  • 2
    \$\begingroup\$ Try putting a 1 ohm resistor in series with either the supply or the LED. Falsenad doesn't properly simulate regulators because it's a toy and will tell you bad fibs (it's not the real thing). \$\endgroup\$
    – Andy aka
    Mar 2, 2023 at 18:13
  • \$\begingroup\$ tinyurl.com/falstadthing \$\endgroup\$ Mar 2, 2023 at 18:20
  • \$\begingroup\$ I cant get it to work its fine though, the solution is another reverse bias diode in parallel on other side of ld \$\endgroup\$ Mar 2, 2023 at 18:22
  • 1
    \$\begingroup\$ @ocrdu We really need some sort of merge function on editing. :) \$\endgroup\$
    – JYelton
    Mar 2, 2023 at 18:27

2 Answers 2


You are using a simulator. With unknown models for components. They may be assumed ideal, which does not model a real world component. Wires, regulators, capacitors may not have any resistance at all.

If at the start of a simulation the capacitor is discharged to 0V, and at the next time step it should be charged to some non-zero value defined by the ideal voltage regulator during the arbitrary small time step, then it basically needs a big surge of current to do that in one time step.

Your addition of "smooth start" capacitors may be the cause, because they do cause the voltage to ramp up, but they also start at maximum current that is available.

I don't know what your target voltage is, but laser diodes are rarely voltage driven, but current driven.


There's an awful lot of detail that's missing. A biggie is that this is an 8 diode block. With the diodes wired in series, the operating voltage varies between 29 and 38V.** Datasheet link here: https://beamq.com/laser/laserdiode/nichia-nubm08.pdf

Total input wattage for the block is about 125W. Each laser is rated at 5W output. This is seriously dangerous device, and needs appropriate safety design.

So, let's consider your approach with LM317s.

If you wire the diodes in series, this means your LM317s will need at least 42V in to handle up to 39V out. However, the LM317 voltage output limit is 37V, so you will fry the device (and your expensive laser) in the process. So that's not workable.

If you split up the array as two strings of 4 and duplicate your LM317 circuit, your input and output worst case become 22.5 and 19.5V, respectively. That's a possibility on a 24V supply.

Split them into 4 strings of 2 and you get 11.25 and 9.25V. Also could work, if your design actually worked (more below.)

Is there a simpler way? You bet. I just recently answered a question on LED current limiting that would also apply here: LED supply 5-30 V - Zener diode? Perhaps this approach could work for you, assuming you can get a big enough pass transistor of appropriate voltage rating. You would need a 40V supply, or like I proposed with LM317s you could break up the strings and duplicate the regulators to use lower voltage.

This circuit ensures stable laser current by using current sense feedback. It will also be more efficient since you could wire the LEDs in series, assuming you have a high enough voltage available.

This answer has more suggestions. One uses op-amp buffered feedback for greater accuracy than is provided by a 2-transistor limiter: Simple constant current regulator for a 1.6A laser LED

Note that OP's circuit also used multiple LM317's with two key differences: diode isolation, and local current sensing at each regulator. This is closer to your idea and has a chance at actually working, since the regulator feedbacks are separated.

Which brings me back to your proposed, and very troubled, use of the LM317. Even if you split the array and duplicate the circuit as I suggest, your circuit as-is isn't going to work out. What will happen is that the LM317 with the 'highest' voltage will 'win' and regulate, and the others will turn off. You won't get the 3A current you want.

Falstad doesn't simulate this inter-component inequality, it assumes each instance of LM317 and all the resistors are same. So while it might work in simulation, in the real world it will fail.

In other words, your approach is wrong, but the simulator isn't telling you that.

Note that this isn't a knock on Falstad. It's an issue with any circuit simulation. Even a reputable package like LTSpice will suffer this problem without doing some extra work to model variation. (In LTSpice, a ‘Monte Carlo’ sim that varies the resistor values, which would reveal this problem.)

You can also model component inequality in Falstad by hand: tweak the LM317 voltage dividers a bit to represent deviations due to component tolerance. You'll see that the one with the highest will ‘win’ and try to take all the current.

I modeled the LM317 series sense approach with 2 diodes in series running on 12V (simulate it here).

enter image description here

It has a troubling turn-on transient, too. Maybe an issue with the model? Hard to say. Do you want to risk $100+?

One final, practical idea: use a constant-current LED driver module with the laser diodes connected in series. Use a module rated for 24 ~ 48V and up to 4A.

Even better, choose a module that's actually designed for lasers. This company provides modules specifically for driving laser diodes, with monitoring and safety built-in: https://www.teamwavelength.com/product-category/laser-diode-drivers/


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.