3D-Printer Enclosure Fan Control

3D-Printer Enclosure Fan Control

The Tukkari TLX Enclosure

I have bought the Tukkari TLX version of 3D/printer cabinet for Prusa i3 MK3+. This nice enclosure comes as a kit and it comes with a active carbon- and HEPA filter in the kit to reduce nanoparticles and fumes that can come from the 3D printing process.

To get the sometimes toxic particles out of my room someting needs to be done.

Take a look at Tukkaris page for the different products that the manufacture and sells>


Tukkari TLX Enclosure for Prusa i3 MK2/MK3 (White color)

Tukkari Printer Enclosure

A 120 mm. fan can be mounted either inside or on the back of your enclosure. As I plan to let the air out of the enclosure and guide it out of my room I install the fan on the back of the enclosure as shown here. The bolts are already included in the kit when buying the enclosure from Tukkari

Installing a fan to the enclosure (optional)

The enclosure comes with a filter that you can be mounted either on the inside or at the outside of the enclosure. As I want to mount a fan on the outside I mounted the filter on the inside.

The fan is an optional thing and are not included with the enclosure kit from Tukkari.

I ordered a 120 mm. noctura low noise 5V version to be able to power it from the Raspberry Pi I use as printer server.

In my case I ordered the Ultra Low Noise NF-F12 5V fan (5V USB cable included).

This noctua fan comes with different cable parts. When adding the USB Type-A to the end the cable length is long enough to be router from the back of the enclosure and into the left (seen from the front of the enclosure) cable entry and the to be mounted into one of the USB connectors on the raspberry Pi that I have added to the printer aluminum profile with a 3D printed box

Note! The image is for the PWM version. In the 5V version the cable part (USB-A) is included

Link to the fan at noctuas webpage:


Setting up Octoprint to to start and stop the enclosure fan

To be able to control the Fan in the enclosure several things needs to be done

Adding system menus to control the USB power on the Raspberry PI

Shell scripts to control power to USB connector on Raspberry Pi

I created two different shell scripts. One to turn on USB power and one to turn off the USB power. In my case I use the Raspberry Pi 3B+. The version has 4 USB-A ports. Unfortunately these are all controlled simultaneously. If you turn off one the three others also will be powered off. In my case I have a Webcam, the fan and a LaMetric display connected to my Raspberry Pi. That is not a problem that they are all turned off when I want to turn of the power for the fan for the enclosure. On the Raspberry Pi 4 you can turn the two blocks of 2 USB connectors on and off independently

To be able to turn of the power for the USB connectors from the command line you first need to install the uhubctl USB Power Contrll package. This can be installed like here:

git clone https://github.com/mvp/uhubctlcd uhubctlmake

This should generate uhubctl binary. You can install it in your system as /usr/sbin/uhubctl using:

sudo make install

Then you can call this library

usb_on.sh contains:
sudo /home/pi/uhubctl/uhubctl -l 1-1 -p 2 -a on

usb_off.sh contains:

sudo /home/pi/uhubctl/uhubctl -l 1-1 -p 2 -a off

To be able to call these two scripts from the Octoprint UI I will add two commands to the System menu on the printer interface. This can be done by changing the config.yaml file which can be found in the

/home/pi/.octoprint folder

Edit the config.yaml file and add the following code (place it in just before the temperature: part of the file.

system:  actions:  - action: Uoff    command: /usr/local/bin/scripts/usb_off.sh    name: Turn USB Power Off  - action: Uon    command: /usr/local/bin/scripts/usb_on.sh    name: Turn USB Power On

After this and restarting the Octoprint you can then find two new commands in the Octoprint userinterface

User rights to run the shell command from Octoprint

Some more thing needs to be done before being able to control the USB power from Octoprint. You need to change the user rights for this.

Go to a shell and do the two following chmod commands

chmod a+x /usr/local/bin/scripts/usb_off.sh


chmod a+x /usr/local/bin/scipts/usb_on.sh

This will add permission for all users to execute the two .sh files

chmod: change mode (permissions) of a file.a+x: for all (a) users, add (+) the execute (x) permissionNow trying this out from the system menu results in the following where we get "Success" response from the system:

Make the fan turn on and off automatically when printing

To be able to turn on the printer when starting to 3D print it can be nice if this can be done using G-CODE commands that is commonly being used in computer-aided manufacturing to control automated machine tools like 3D-printer and CNC milling machines.

When in my case the PrusaSlicer tool slices a STL file into a machine script file, it could be nice also to be able to turn the enclosure fan on before starting to print. And to turn it off again after the print has been finalized.

Lets define two G-Code commands. In my case have made GCODE10 which call the usb_on script and a GCODE11 which calls the usb_off script. Look below to see the two definitions

Now we have these we need to be able to inject those GCODE commands during a print of a part. The most of the GCODE comes from the PrusaSlicer output file.

In the menu Printer | GCODE Scripts you are able to add more commands that call be call before, after a job completes and after a job is cancelled and after a job is paused.

In this case we will add the two newly defined GCODE commands in the start and after job completes section of this setup page. Look here where marked with arrows.

Now the enclosure fan turns on when the print job starts. And after the print completes it automatically turns off the enclosure fan turns off.

Adding a Fan Shroud to the backside of the fan

To be able to attach a tube to let the fumes out of the enclosure to open air. A shroud is needed to be attached to the fan on the rear side of the enclusure.

As this is a 120 mm fan I get the measures from a drawing which shows the default hole position for such a fan. I design it in SolidWorks. In version 3 of the file the holes has been changed to 4.2 mm. each and not 4.0 as can be seen on the image below

Here a viewer showing the final STL 3D-file. Below you can download a copy and print it for yourself for free.

Loading file
  • Fullscreen
  • Wireframe
  • Zoom In
  • Zoom Out
  • Rotation
  • Screenshot
  • Help


  • Rotate with the left mouse button.
  • Zoom with the scroll button.
  • Adjust camera position with the right mouse button.
  • Double-click to enter the fullscreen mode.
  • On mobile devices swipe to rotate.
  • On mobile devices pinch two fingers together or apart to adjust zoom.
  • On mobile devices 3 finger horizontal swipe performs panning.
  • On mobile devices 3 finger horizontal swipe performs panning.

Here you are welcome to download the file:

Or you can now also find it on Thingiverse where I have created it to my list of designs:


My other Thingiverse design:


Thats it!

Mission Complete!!

Share this content:


watch series Posted on00:52 - July 9, 2022

I got what you mean,bookmarked, very nice web site. Michal Wemmer

watch series Posted on00:18 - July 11, 2022

Way cool! Some extremely valid points! I appreciate you writing this post and also the rest of the website is really good. Laverne Kagan

bets10 giris Posted on16:24 - July 16, 2022

I visited several web pages but the audio feature for audio songs present at this website is truly excellent. Tanner Waughtal

bets10 giris Posted on13:28 - July 17, 2022

Merely wanna comment on few general things, The website design and style is perfect, the written content is really superb : D. Chad Laruffa

erotik Posted on02:28 - July 18, 2022

I was reading through some of your content on this website and I believe this website is real instructive! Continue putting up. Luke Redondo

sikis izle Posted on15:17 - July 18, 2022

Watch Online Bollywood 2018 Full Movies in Best HD Print Quality,Download These Movies From our Website,We Have All Indian Movies For The Year 2018. Jimmie Kerr

bets10 giris Posted on01:25 - July 19, 2022

You made some good factors there. I viewed the net for the issue and discovered most people will certainly go along with with your web site. Augustine Durett

bets10 giris Posted on05:03 - July 19, 2022

I have been checking out a few of your articles and i must say pretty nice stuff. I will surely bookmark your website. Arron Farris

zoritoler imol Posted on22:09 - August 2, 2022

Good ?V I should definitely pronounce, impressed with your site. I had no trouble navigating through all the tabs and related information ended up being truly simple to do to access. I recently found what I hoped for before you know it at all. Reasonably unusual. Is likely to appreciate it for those who add forums or anything, site theme . a tones way for your client to communicate. Excellent task..

bahis Posted on16:56 - August 7, 2022

New TOR address for the Wild Neutron hacking group. Garfield Orzalli

eskort bayan Posted on04:33 - August 8, 2022

Very happy to have the opportunity to read Lithuanian papers again. Antione Yanity

porno Posted on22:59 - August 9, 2022

Well I really enjoyed studying it. This information provided by you is very constructive for accurate planning. Moshe Giacomo

eskort bayan Posted on15:56 - August 10, 2022

Excellent, what a blog it is! This website presents valuable facts to us, keep it up. Sanford Thompkins

viagra Posted on00:27 - August 11, 2022

Looking forward to reading more. Great article post. Thanks Again. Great. Stanley Sagun

buy viagra Posted on19:13 - August 12, 2022

What a information of un-ambiguity and preserveness of valuable know-how about unpredicted feelings. Derek Liedy

eskort bayan Posted on01:13 - August 13, 2022

Hi there, after reading this remarkable paragraph i am also cheerful to share my knowledge here with colleagues. Allan Offermann

Gal Jerman Posted on21:26 - August 26, 2022

Top ,.. top top … post! Keep the good work on !

Mark Posted on09:45 - September 10, 2022

Thanks for your blog, nice to read. Do not stop.

Sheri Scott Posted on07:54 - September 15, 2022

Thanks consequently much for the article post.Really thank you! Much obliged.

Hairstyles Posted on04:54 - October 22, 2022

Thanks for your text. I would also like to say that your health insurance brokerage also works best for the benefit of the actual coordinators of the group insurance policy. The health insurance broker is given a summary of benefits looked for by someone or a group coordinator. Exactly what a broker can is hunt for individuals as well as coordinators which usually best match those demands. Then he offers his referrals and if each party agree, the particular broker formulates a binding agreement between the 2 parties.

Beauty Fashion Posted on11:26 - October 22, 2022

Thanks a bunch for sharing this with all folks you actually realize what you are talking approximately! Bookmarked. Kindly additionally talk over with my site =). We will have a hyperlink alternate contract between us!

Beauty Fashion Posted on04:00 - October 25, 2022

Based on my study, after a in foreclosure process home is marketed at a sale, it is common for the borrower to still have any remaining unpaid debt on the bank loan. There are many financial institutions who seek to have all expenses and liens repaid by the subsequent buyer. However, depending on specific programs, laws, and state legal guidelines there may be a number of loans that aren’t easily fixed through the exchange of financial products. Therefore, the duty still remains on the client that has got his or her property in foreclosure process. Thanks for sharing your thinking on this blog.

Beauty Fashion Posted on09:57 - October 25, 2022

One other important part is that if you are a senior, travel insurance regarding pensioners is something you ought to really think about. The older you are, a lot more at risk you might be for having something poor happen to you while overseas. If you are not really covered by many comprehensive insurance policy, you could have a few serious issues. Thanks for revealing your advice on this web site.

Beauty Fashion Posted on14:45 - October 25, 2022

Have you ever considered about including a little bit more than just your articles? I mean, what you say is fundamental and all. However just imagine if you added some great graphics or videos to give your posts more, “pop”! Your content is excellent but with pics and video clips, this blog could definitely be one of the very best in its field. Great blog!

Hairstyles Posted on23:40 - October 25, 2022

Hmm is anyone else experiencing problems with the pictures on this blog loading? I’m trying to find out if its a problem on my end or if it’s the blog. Any responses would be greatly appreciated.

Beauty Fashion Posted on04:09 - October 26, 2022

The very core of your writing whilst appearing agreeable at first, did not really work well with me personally after some time. Someplace within the sentences you managed to make me a believer but only for a while. I however have got a problem with your leaps in assumptions and you might do well to help fill in all those breaks. When you actually can accomplish that, I would undoubtedly be impressed.

Beauty Fashion Posted on19:37 - October 26, 2022

Excellent read, I just passed this onto a colleague who was doing a little research on that. And he actually bought me lunch as I found it for him smile Thus let me rephrase that: Thank you for lunch!

Beauty Fashion Posted on04:52 - October 29, 2022

Hello there! Do you use Twitter? I’d like to follow you if that would be okay. I’m absolutely enjoying your blog and look forward to new posts.

Leave a Reply