Those of you in the 3D printing community can probably recall a moment during one of your prints where you have said to yourself “Well now, that just isn’t right…” and it left you feeling like you must interfere. I cannot say that this happens to me a lot but when it does I find that the 3D printers usually do not have a suitable stop or pause button that is easy to push and at my fingertips. This is why I have decided that while there is a built in factory option to pause or stop a print, the method of click, rotate the knob, OH, don’t turn too far, ah, go back one, dang it, one forward, then click to stop, is too much for me. I would rather just press a button. This is what I did to solve it.
The Products I used
|Pushbutton Switch SPST-NO Standard, Illuminated Panel Mount, Front|
|2 Conductor Multi-Conductor Cable Black, Red 18 AWG 25.00’ (7.62m)|
If you happen to need of any the nuts, bolts, washers, or other hardware that I used in this project, check out the following post:
My printer sits higher than most as the bed rests at approximately chest level. Because of this I wanted a button that was directed down a little. Unfortunately I do suffer from the mortal condition that limits my ability to be foreseer of all futures. I expect at some point my printer will rest at a normal table level and the option to adjust it with a touch would be very nice.
I also have a touch display mounted on my 3D printer. it utilizes some of the same parts and attaches the same way. You can check it out here:
The 3D models
Click the arrows to expand each section.
Main Assembly - Button Shell Top.stl (329.8 KB)
Neck and Arms
[Printer Button Assembly - Arm 3H_Inset_Center.stl (upload://9FfArghxWW04fCW6O9sOBAinbv1.stl) (324.9 KB)
[Printer Button Assembly - Arm 3H_Outside.stl (upload://sbV4hDIaRpiKPwImHmR8Aj1iwGf.stl) (142.3 KB)
Printer Button Assembly - Arm 3H_Inset.stl (226.3 KB)
Printer Button Assembly - Arm 2H_Long.stl (113.6 KB)
Mount on the Right Side
Mount on the Left side
I have included many pictures (see below) to show each step of the assembly process.The way I have done this provides me with a very smooth and easy sliding mechanism while keeping the button or the display in the correct position very nicely.
Click the arrows to expand each section.
Mounting the sliding arms
I assembled this utilizing springs that I had on hand because I speculate that they will help to provide a more even and constant pressure over time. There is not any data available to support this. You many have just as good of luck using a standard bolt and nut.
Preparing the mounting bracket
The mounting bracket will replace the one you currently have on your Prusa printer. While it is true that I could have combined these two parts together, I was going for a modular feel that would allow for expansion using different types of attachments.
I have found that you will need to be sure to connect these two pieces together before adding the bottom bracket to the printer or the top bracket to the arms. You will not be able to connect the bolts or otherwise.
Joining the button enclosure to the mounting bracket
When I printed these models I provided space for the screw heads in the outside arms. I have changed that in the current models. I found that the bolts fit better without them. As an experiment I inserted some nylon nuts and found they pop in easily, are very sturdy, and eliminate the risk of stripping out my model as they can easily be replaced. In the end I do not think they are necessary here, but the idea is worth exploring more. [/left]
Installing the button
Because I soldered two sets of wires to the switch, one for the LED, and the other for the switch function, I marked each set with different colored electrical tape.
I designated Blue for the LED.
I designated Red for the switching function.
Note, if you are building this project, be aware the following before you proceed.
Firstly, when inserting the button into the housing, make sure there is a coil that goes around once. This will allow for some play in the wire. Secondly, notice how the wires weave through the arms. The wires go through nicely without getting crushed or pinched.
This is the easiest part. I simply removed the appropriate bracket from my Prusa printer and then replaced it with this assembly.
The Technical Stuff
Part 1 - The Raspberry Pi
As indicated in my previous post regarding the addition of the touch display, I am using a Raspberry Pi 4B to operate Octoprint. Octoprint in turn has the ability to operate my 3D printer.
If you are new to the Raspberry Pi I encourage you to check out the documentation on their website.
This is where I was able to find the guide to the GPIO. I was able to use it to determine which pins I should be connecting my wires to.
This guide, as well as more GPIO information, is available here:
The button I am using already has a resistor installed allows it to be powered by voltages under 12V. The 5V supply on the Pi is enough to light it up sufficiently. Since my Prusa is 24V, it seemed the best choice.
I decided to connect my LED to pins 4 (5V) and 6 (GND).
I needed to connect my button to an IO and decided to use GPIO17 (pin 11).
I chose to set an internal pull up resistor to pin 17 so that my event is triggered when it’s connected to ground as an active low pin. I will cover the settings for this later.
My connection table:
|Function||Pin Label||Pin Number|
|LED Anode||5V||Pin 4|
|LED Cathode||GND||Pin 6|
|Switch Input||GPIO17||Pin 11|
|Switch Ground||GND||Pin 9|
Part 2 - Octoprint
I am using the Octoprint software on my Raspberry Pi to control my printer. The installation is out of scope for this post, but you can find more information here:
The standard method of accessing an Octoprint server is to use a web browser. The default web address is http://octopi.local
That link will only work if the server is connected to the same network as the browsing device and the name has not been changed. The local IP address can also be used. It will look something like 192.168.1.18.
Part 3 - Installing the plugin.
I also needed a way to be able to take the signal from the button and interpret it. For that I chose this plugin:
Once at the main Octoprint interface, clicking on the wrench brings up the settings dialogue.
After navigating the left menu by scrolling down, select “Plugin Manager”. There is an option to search for a plugin, in this case it is “Enclosure Plugin”. If it is not installed, clicking the “Get More” button will bring up a dialog in which it can be downloaded. Finally, there are some prompts and a reboot of the Pi to complete the installation.
Part 4 - The Settings
G-Code is the simplest way to send instructions to the printer. I found a really good article explaining it here:
There are also Prusa specific commands available here:
I used the following G-code to instruct the printer to pause and then move the bed closer to me.
G1 X125 Y200 ENTER
M601 simply causes the printer to pause. This does not happen immediately because it will finish the current instruction set before reading this instruction.
G1 tells the printer to move. In this case the X axis is instructed to the X coordinate 125 and the Y axis instructed to Y coordinate 200.
The settings for this plugin require the addition of an output. The settings can be accessed by clicking on the wrench in the Octoprint home page. They will be found by selecting “Enclosure Plugin” in the left frame.
This is where I gave my output a name and the G code mentioned above. These are my settings:
Next I had to set up an input. The settings page does a good job of suggesting appropriate settings. I chose to set an internal pull up resistor to pin 17 so that my event is triggered when it’s connected to ground as an active low pin.
The settings for the input require that an output be selected. This is why the output has to be created first.
That is how I added a functioning and alarming looking big red button to my Prusa MK3S. This was a fun project and opens up all kinds of possibilities going forward.
Keep an eye out for more of my creations as time goes on and feel free to reply here with creations of your own.
I use Onshape to create most of my designs. If you haven’t given Onshape a shot yet perhaps you should. It is very good at allowing multiple people to make their own iterations of a project and is a real asset while we are social distancing. You can start by editing this file to suit your needs as well as sharing it with a friend. Click below if you would like to learn more about OnShape in general.