SKR 2 Laser Issue

So I’m having an issue where my laser is turning on during bootup and I have to toggle the laser on and then toggle it off to turn it off. So I know active state as low is correct, as I am able to toggle the laser on and off just fine. It’s just that the laser comes on right after start up.

I currently have power and ground going to my power supply and the ttl going to my fan 2 port.

I commented out my fan 2 pin (PB5) in the pins_BTT_SKR_V2_0_common.h so I can use that pin for the PWM.

I didn’t comment out the pin for the ENA which is Heater 0 (PB3)

Any suggestions on what to do? Does the ENABLE pin need to see any voltage?

See below for laser details and config_adv.h code.

I have this laser : PWM/TTL 450nm 7W Focusable Blue Laser Module/Blue Laser Engraver | eBay

“PWM/TTL 450nm 7W Focusable Blue Laser Module/Blue Laser Engraver”

Here’s my config_adv for the laser:



#define SPINDLE_LASER_PWM_PIN PB5 //FAN 2 (Rightmost Pin) on SKR 2. Refer to SKR USER Manual for Picture

#define SPINDLE_LASER_ENA_PIN PB3 //PS-ON (left most pin).

#define SPINDLE_LASER_USE_PWM // Enable if your controller supports setting the speed/power


#define SPINDLE_LASER_PWM_INVERT    true  // Set to "true" if the speed/power goes up when you want it to go slower

#define SPINDLE_LASER_FREQUENCY     2500   // (Hz) Spindle/laser frequency (only on supported HALs: AVR and LPC)



A few thoughts, partly from my experience, and partly from reading on the forum, which may or may not be helpful:

  • There have been situations where the signal pin is left floating and therefore the laser will come on when the control board is booted (as you describe). The common solution is to put a 10K resistor between the signal pin and ground. This pulls the signal pin to ground during the boot cycle.

  • The laser (or laser control board) must share a ground with the SKR board.

  • Fan pins are often ground-side switching for PWM. Some lasers/laser control boards can handle this form of PWM, but others require additional circuitry.

  • Even though your laser says, “Working Voltage: 12V,” it is possible, even probable, that it will handle 5V TTL signals. If so, you can get around any ground-side-switching issues by changing to a 5V pin.

  • While not directly related to your question, I assume you are using inline (or possibly M3/M5) to fire your laser. If not, consider making the change.

I think I would be more inclined to use the servo output rather than the fan2 output. It doesn’t have that pesky FET inverting your signal . Disable any reference in your firmware to using a servo and edit your pins.h file to select PE5 as your laser PWM output pin and that should be it.
The servo connector J8 has +5v, gnd and signal sbut you will just need to utilise just the signal and find a separate +12v and ground to drive the laser. Ensure the ground you use is common to the ground in J8, if not you will need to add the ground at J8 to the +12v ground at the laser.
You might want to add a 1K resistor in the signal line seeing as how the servo line goes directly into the MCU to reduce any chance of damaging the MCU with voltage spikes.

The Spindle_laser_enable_pin is an output… You are not using the laser enable hardware so it doesn’t matter what pin you assign to it. also set Spindle_laser_pwm_invert to false.


I’ll try the resistor.
The laser only has one ground, which is ran to the power supply. The SKR 2 shares the same ground there.
I have kept the voltage regulator that came with the laser and wired it inline so it can be 0 - 5v. I tested the strength from low power (4) to full power (255) using the controls on the LCD Display.
It’s configured as inline. (refer to last line in code)

thanks! I’ll give this a shot first and see if it helps.

If your laser turns on when signal is not connected (floating), use the resistor for sure. My cheap laser turns on when not connected and a 2.2K helps with that. I created a dongle as per this post: Help connecting Banggood laser to SKR Pro 1.1 board - #7 by Tuco

1 Like

How did you add your resistor? Between which two wires? PWM and ground? I see you wrote between logic and ground. My laser doesn’t have that breakout board.

Yes, between signal/PWM and ground. Again, likely only necessary if the laser turns on when PWM is not connected at all (dangerous, be careful!)

So I tried using a 2.2k ohm resistor between the signal and ground and the laser didn’t want to start anymore. I also tried using the SERVO (PE5) pin and ground to common ground with the laser without a resistor to see if I could atleast get the laser to work on the PE5. Didn’t work there.

I’m thinking the 1k ohm resistor might do the trick for the PB5 fan pin. Waiting to get them tomorrow.

I removed the step down voltage regulator that came inline with the laser.

When using fan2, laser powers on getting anything above 0v. (10 volts at 0, 0 volts at 255). Doesnt turn off unless I max out the power (odd).
When using SERVO laser doesn’t power on at all despite getting voltage (3.5 volts at 255, 0.1 volts at 5)

EDIT: I changed this to true: #define SPINDLE_LASER_PWM_INVERT true
That inverted the logic for me, so when its 255 its close to zero, off is 3.3v.

Laser still doesnt power on though. I think it needs to see 5v+ to excite it?

Seems like this laser is 0v - 10v. 0v is off, 10.3v is max power. Seller said it was a 0-5v laser…

The board defaults PB5 to 10.3v on startup. Can toggle it on and off. How can I tell the board to do 0v on startup?