GRBL Fire Button

Hi Guys, new here but been running the LightBurn for almost a year now.

I want to change my original controller for my 3018 laser to arduino + cnc shield since the USB port will give out soon and I have the arduino +cnc shield just gathering dust. Trying to figure out stuff, once I put 12V on the +/- of the laser even without anything connected to the PWM lead, the laser fires up @100% so I figured that I need some kind of relay/switching.


  1. What pin does the “Fire” button for focus trigger? Is it the D12 (SpinEn Pin)? When I measured it @ off state, I measured 3.5V and 4.9V when on.
  2. What relay/mosfet module should I go and install in between the laser and the power supply?

Thanks a bunch guys.

745 / 5000

Resultados de traducción

Hello in arduino grbl v 0.9 or higher the pins that control the laser are by default 11 and 13. In grbl, the parameter $ 32 = 1 (laser enable) must be configured, so that it works as a laser machine. Pin 11 is PWM and controls the laser power. Values are assigned by gcode with parameter S between 0 and 1000, where 1000 = 100%. Pin 13 is Laser On (5V), it can go to a relay to energize the laser module, also the laser module can be directly energized since Pin 11 (PWM) controls whether it turns on or not. To focus the laser the minimum power S = 1 is used, example: M3 S1
G1 X0.1 F1
This will activate the laser at 0.1% power so it can be easily focused. to turn off simply use the code M5


Hello, thanks for the reply. So it should be wired like this right?

The problem is, when I run the code you gave, I don’t get a 5VDC on pin 13 and GND. I should get a 5VDC between that so I can trigger a relay right?

  1. sure grbl is configured as laser?
    send $ 32 = 1 and try again
  2. try with M4 instead of M3, M4=ON, M3=OFF
  3. Caution, it is not recommended to apply a relay directly between GND and pin 13, it may be damaged. A relay module is used for arduino
  4. Edit config.h and enable #define USE_SPINDLE_DIR_AS_ENABLE_PIN // Default disabled. Uncomment to enable.
    with this pin13 activates and deactivates the laser
    M3 & M4 = ON
    M5 = OFF
1 Like
  1. Yes.
  2. This worked. What’s the explanation for this? On my old controller board, M3 turns the laser on and M5 turns it off.
  3. How should I wire the relay? What relay should I use to connect the laser module and the power supply for the laser using the pin 13 as the trigger?
  4. Done with this earlier.
  5. Also, this fire button does not turn my laser on with the arduino unlike my old controller board. activating the fire button doesn’t do anything to the pin 13. image

Use DIR PIN on cnc shield to control relay.
The Fire Button works (if config.h are edited)

1 Like

Aside from this, what else should I edit?

It’s weird that M3 is off and M4 is on while M5 does nothing. As far as I read somewhere here. the fire button is basically a macro of

G1 F1000 S100

Given that only M4 turns the pin 13 on and M3 turns it off, the fire button won’t work for me.

when M4 AND M3 is on off… = grbl as CNC mode.
M3 & M4 = as change dir output not for laser control
Please set grbl for laser machine apply $32=1 on Serial Monitor in Arduino IDE
$$ list all config values


It’s already in laser mode and enabled the use_spindle_dir_as_enable_pin


M4 turns the pin 13 on and M3 turns the pin 13 off. Fire button does nothing. :frowning:


You can power the laser directly without the need for a relay.
The PWM 11 output of the cnc shield (Z +) or (Z-) can control the firing of the laser.

My gosh, I’m an idiot. I’ve been editing the config.h from the original folder, not the arduino library. facepalm. Really really stupid. I got it sorted now! Got the fire button working!

I’m planning to connect it like this:

A lot of people say that you can just turn the laser on via PWM but with my laser, it’s not possible. Once you apply the 12V supply to the laser, it turns on right away even without connecting it’s PWM signal to anything.

I tested my old controller board with lightburn. When the fire button is off there is no 12V across the laser supply and has 12V when you activate the fire button. So I think my laser works with the board with a relay that is activated via M3 command.

My laser doesn’t have the separate controller. I think that one has a switch/mosfet triggered by the PWM from Pin 11.

Is it really smart or functional to use a relay to control the laser?

If I’m reading this right, this is a tragedy… :frowning: :cry:

Good luck …


The relay would act as an on/off for the power supply for the laser. This is a diode laser, not CO2. What would you suggest for me to do? Any tips? Thanks!

A relay cannot keep up with the electronics. To us it’s quick, as it was a hundred years ago. It’s still faster than us…

This is the typical output for PWM (laser) from a grbl board and came with my CNC3018.


I suspect you are making too big a deal about this and need to find the correct connections. From reading your posts, it fires on 12v applied to the power irregardless of the PWM input state. This may be your problem as it should not fire, if it is controlled by the PWM input and there isn’t any. If your documentation states this pin has a logical 1 for it to fire, you should be able to ground it and stop it from firing. If not, the laser has a hardware problem.

Some low cost lasers depend on the power to turn them off and on.

@Cortapalos showed the configuration and probably knows more about it than I.

Did you get that to work OK?

What kind of laser are you running, i.e. how much power does it require?

Do you have the documentation on your specific laser?
This should tell you about the PWM option.

The grbl board you are running must have a schematic somewhere… can you post it or a link?

Sounds like a combination of hardware and software configuration issues. Hang in there…


Hello again
If your laser has 3 Pins (GND, V +, TTL) this can be controlled by pwm. The 3rd pin that is not Power, should be the PWM control. This pin must not be left open or without connection, it must go to GND to not activate the laser and + 5V to activate it.
Try to energize the laser with 12V and the 3rd pin (if it exists) to GND … if it does not fire, it is a good signal.

Hey Jack, thanks for your inputs. mosfet sounds a lot smarter than relay! Yeah, I read somewhere that with lasers some doesn’t fire without the 5V in the PWM lead but that’s not the case with me. Will try to look at your schematic and my board. Pretty sure that my old board has the IRF540 in there.

I’m sure that my laser doesn’t have a problem since it is being controlled by the 12V power input, not the PWM. I’m running a 15W diode laser that came with the 3018 with a generic GRBL controller.

I’ll post the board with the laser connected in a few. Thanks man! Hope you can guide me til the end too! Will hang in here til this gets settled.