<p>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.</p>
<p>Indeed <a href="https://marlinfw.org/docs/gcode/M112.html" rel="nofollow noreferrer"><code>M112</code> is capable of stopping the printer</a>:</p>
<blockquote>
<p><code>M112</code> 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 <code>EMERGENCY_PARSER</code> for an instantaneous <code>M112</code> command.</p>
</blockquote>
<p>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).</p>
<p>From <a href="https://github.com/MarlinFirmware/Marlin/blob/2.0.x/Marlin/Configuration_adv.h" rel="nofollow noreferrer">Marlin's Configuration_adv.h</a>:</p>
<pre><code>/**
 * 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.
 */
//#define EMERGENCY_PARSER
</code></pre>
<p>Please note that this might not be implemented; it has not been implemented for all platforms.</p>
<p>An earlier question &quot;<a href="/q/6778">Can G-code scripts be run automatically on inserting an SD card when using Marlin Firmware?</a>&quot; has an <a href="https://3dprinting.stackexchange.com/a/6814/">answer</a> 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.</p>
<p>So, since:</p>
<blockquote>
<p>I use default firmware and don’t plan to change it</p>
</blockquote>
<p>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.</p>

CC BY-SA 4.0
2021-03-16T16:02:23.010Z
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.
octopus8
CC BY-SA 4.0
2021-03-17T08:31:15.450Z
Easiest way would probably be shorting 5V to ground with your button. How good your board will handle that depends on the board though.
towe
CC BY-SA 4.0
2021-03-17T08:51:26.207Z
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.
octopus8
CC BY-SA 4.0
2021-03-16T13:11:42.770Z
2021-03-16T13:11:42.770Z
0scar
<p>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 <code>M112</code>. I use default firmware and don’t plan to change it thanks.</p>

<safety>
How do I add an emergency stop button over Micro USB?
Jaiveer
# How do I add an emergency stop button over Micro USB?

(Asked by: username_0 on 2021-03-16)

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.

**Tags:** safety


---

## 1 answers

### Answer by username_1 on 2021-03-16. Score: 3

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](https://marlinfw.org/docs/gcode/M112.html):

> `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](https://github.com/MarlinFirmware/Marlin/blob/2.0.x/Marlin/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.
 */
//#define EMERGENCY_PARSER

```

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?](/q/6778)" has an [answer](https://3dprinting.stackexchange.com/a/6814/) 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.

> **Comments:**
> **username_2**: 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.  
> **username_3**: Easiest way would probably be shorting 5V to ground with your button. How good your board will handle that depends on the board though.  
> **username_2**: 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.  

---

