I have an Ender 3. I want to add an emergency stop button. Ideally it’ll plug in to the printer’s micro USB port and run the M112. I use default firmware and don’t plan to change it thanks.


1 Answer 1


The most effective way to effectuate an emergency stop is to pull the plug or turn the printer off. An alternative is a software stop using a print server program like e.g. OctoPrint.

Indeed M112 is capable of stopping the printer:

M112 is the fastest way to shut down the machine using a host, but it may need to wait for a space to open up in the command queue. Enable EMERGENCY_PARSER for an instantaneous M112 command.

In order to use emergency stop functionality, you need a firmware capable of doing an emergency stop by having this enabled in the Configuration_adv.h printer configuration file, otherwise it will have to await the queue to be emptied first. I doubt if this is standard enabled in your default firmware (the Marlin default is disabled).

From Marlin's Configuration_adv.h:

 * Emergency Command Parser
 * Add a low-level parser to intercept certain commands as they
 * enter the serial receive buffer, so they cannot be blocked.
 * Currently handles M108, M112, M410, M876
 * NOTE: Not yet implemented for all platforms.

Please note that this might not be implemented; it has not been implemented for all platforms.

An earlier question "Can G-code scripts be run automatically on inserting an SD card when using Marlin Firmware?" has an answer that hints to changing the sources on SD card insertion. In your case the USB needs to be monitored, and it a signal is detected the printer stopped.

So, since:

I use default firmware and don’t plan to change it

without modification of your firmware it is not possible to do what you want. But, there are perfectly viable options mentioned and available to do what you want (executing an emergency stop). Alternatively you could even use a (n Arduino powered) relay to cut the power based on the signal you want to send.

  • $\begingroup$ What about prolonging one of power cables (a ground preferably) to the front panel, and mount there a bueatiful red, normally connected, emergency button on this wire? Then you press it and power is momentarily detached. $\endgroup$
    – octopus8
    Commented Mar 16, 2021 at 16:02
  • $\begingroup$ Easiest way would probably be shorting 5V to ground with your button. How good your board will handle that depends on the board though. $\endgroup$
    – towe
    Commented Mar 17, 2021 at 8:31
  • $\begingroup$ I just thought of breaking a ground wire incoming from power supply to the board. So after button press, the powering circuit gets open and there is no power provided to the board. Reboot-like. $\endgroup$
    – octopus8
    Commented Mar 17, 2021 at 8:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .