Smartifying the Original Prusa MK4 3D printer enclosure

I recently acquired a very nice Original Prusa MK4 with its enclosure (which was quite the labor to put together!).

Prusa MK4 printers are fully compatible with Home Assistant — they have their own built-in integration that allows limited control of prints, and lets the user see the status + a preview of the printout. On that basis, I’ve already made a dashboard for myself, so I can monitor printing time and state.

Since I’ll be printing filaments that emit styrene and other noxious gases, in addition to the enclosure I also ordered the advanced filtration system (and its requisite base board + power supply). The base board and supply can also power and control an LED strip (24 volts), and the board includes a two-push-button front panel to turn the light and the fan on and off (not depicted here).

What does “a smart enclosure” mean?

To me, it means:

  • Things that need to happen must be automatic:
    • I shouldn’t have to push a button to run the fan. If the filament I’ve set the machine to print with is not one of the known non-toxic filaments, the fan shouldn’t run needlessly.
    • However, in any other case, the fan should run for the entire duration of the print, and keep going 15 minutes after the printer.
    • Then, the fan should be quiet.
  • Functionally and aesthetically, it should remain “stock”:
    • “Digital buttons” notwithstanding, the push buttons on the base board (which attaches to the front panel) should operate correctly, allowing me to manually start and stop both enclosure light and filtration fan as I please.
    • Aesthetically, it should look as close to an unmodified Original Prusa enclosure plus the add-ons Prusa Research sells.
  • Stretch goal: video dashboard!
    • There should be a camera (ideally a device like an ESP32-CAM) filming, that allows me to view what’s going on through my Home Assistant office dashboard.
    • When the camera is filming, the enclosure light should automatically come on. This should be pretty easy to accomplish with Home Assistant, since an automation can turn the light on when the camera begins streaming, and the light can then be turned off when streaming stops.

The technical parts can be done with an ESPHome-programmed ESP32 device. The aesthetic and functional parts can be done with a little care.

Full story goes on here!

We are already well on our way to getting the enclosure to be smart. A prototype already lights up a fake “fan” and “LED strip”, using the correct input voltage and the Prusa Base Board buttons.

Follow on to the blog post to keep updated on this ongoing adventure!

I’ve done some of what you’ve got here on a Prusa Mini. I have an overhead LED light, and as ESP32 cam for monitoring. I can control the light remotely so that I can check on prints, and also have a physical switch on the printer that will toggle the lights.

A few suggestions based on my experience:

  • You may find that 24V LEDs flicker annoyingly as the supply voltage fluctuates under printer load. I use 12V LEDs and an LM2956-based buck converter to drop the voltage. With a little bit of hacking, it’s possible to control the LM2956 directly from an ESP32 GPIO output as the LM2956 has an enable pin with a logic threshold of 1V. This avoids the need for a relay. Unfortunately, the standard cheap LM2956 boards on Amazon don’t have the enable pin broken out, so you need to cut the PCB trace and then solder directly to the regulator pin. A bit fiddly, but works very nicely.

  • The ESP32-Cam boards are apparently more reliable when powered off 5V. I used the 5V supply from the main board of my printer, but a separate 5V regulator would probably be sensible.

  • The ESP32-Cam has its own “flash” LED. I have this and the overhead lights setup as a light group in HA, and the physical switch toggles both the overhead lights and the flash LED together.

I’ll be using a separate 24 volt power supply shipped from Prusa Research to power the LED strip. The lights are 24 volts so I expect no issues. No main board or printer power supply hacking will be required, to stick with the “stock” look and functionality.

I have tried an M5Stack CAM but it overheats and gives terrible framerate. To test others out, I ordered a number of ESP32 camera devices to see which one works best and gives me the best framerate. I also ordered a separate IP camera, and I’ll see if that is more reliable / has better picture quality than the ESP CAM ones (I have the requisite regulators to step down 24 volts to USB power). We’ll see how this goes.

Thanks for the tips!

Ah, separate 24V supply should work fine. I was piggy-backing of the printer’s supply.

I’ll be interested to hear how you get on with other ESP32 cameras. Mine certainly gets quite warm, and the framerate is pretty lousy, but it’s good enough for checking if there are issue with the print. Most of them seem to use the same camera, so I’ll be surprised if there’s much difference.

1 Like

I’ve rolled together a relay-controlled LED strip which I will be using on this project, although I am seriously mulling the use of a MOSFET module instead.

The project is complete. The fully smart, sensor-powered smart enclosure automatically cleans the air when it needs cleaning, has controllable lights via Home Assistant, and sports a camera that allows the user to observe his prints in real time.

Take a look!