Introduction: DIY Closed Loop Controlled Filament Dryer

When printing with materials such as Nylon, PETG, or Ninjaflex, one can find that some of these filaments can be hygroscopic (absorbs water.. in this case, from the atmosphere). Once water is absorbed into filament, the print quality and ease of printing can plummet and make for some pretty miserable prints.

One way to dry filament is to put it in an oven. This is great if you want to spend the money on a food dehydrator or your spouse doesn't mind you putting plastic into your nice new kitchen oven. However, one other way it to use a chamber and a light bulb. This method works well but different materials can require different temperatures due to glass transition temperature (the point where plastic begins to soften). By using arduino, we can build a closed loop control drying box that works similar to your oven. Set your max temperature allowed, your amount of temperature tolerance, the number of hours you'd like to dry and you're good to go. The controller heats the chamber up to your max set temp, turns the light off until the chamber hits the Max temp - tolerance then turns the light back on again to continue cycling. After the specified number of hours, the controller switches to "Humidity Hold mode". The user inputs a maximum percentage humidity to hold in the chamber and the controller only turns the light on long enough to keep the humidity below that percentage. It's a nice energy saver mode if you're not going to get to your newly-dried filament right away and bag it up. Through our testing, I've been able to dry nylon that was submerged in water for a few days and get perfect prints again. You can see the results of the dryer in my 3 part Youtube series here: Part 1 Part 2 Part 3

If you prefer the instructions in a full Word document, here is a link to the document that takes you step by step through the entire assembly process; pictures included

If you run into any issues of have any questions, don't hesitate to contact me on twitter @jimscuba2386. It's a really fun project and I hope a few of you take the time to give it a shot!

Step 1: Assembling the Control System

Required Tools

Allen wrenches (M3, M2.5)

Soldering iron

3D printer with ABS filament (or PC) and PLA or PETG

Wire strippers/Flush Cutters

Xacto Knife


Metric Tap Set

Silicone Adhesive

Small Flathead Screwdriver

Step 2: Parts List

6 X 6mm M2.5 SHCS – Used to secure the temperature/humidity board

to the 3d print

3 x 6mm M3 SHCS – Used to secure the feather double board to the front of the 3D print and to secure the protective cover to the printed base.

Stranded Wire

Adafruit Feather 32u4 Basic Proto -

FeatherWing OLED – 128x32 OLED Add-On -

Adafruit Power Relay FeatherWing -

FeatherWing Doubler -

Feather Stacking Headers -

Adafruit HTU21D-F Temperature & Humidity Sensor -

5V micro USB power supply

Aluminum Foil

12” (or longer) x ¼” Wood or Metal Rod

Micro USB programming cable

5 Gallon Bucket with Lid -

75 Watt Incandescent Lightbulb – You can use a lower wattage but you may not achieve the max temperature you want or as quickly as you want.

Portable work light - Make sure it’s rated for the light wattage you’re using!

Step 3: 3D Prints Pt. 1

The STL files for these models can

be found on Thingiverse at:

Base Plate – Print with temperature resistant material. ABS was used in this project and is recommended. The ambient temperature can achieve over 70C so lower temperature filaments are NOT recommended. I’ve designed the plate so that if you print it vertically, it will only require a small amount of support material. Please see the image for the location of the required material.

Drill and tap the indicated holes with the indicated drill sizes and taps.

Step 4: 3D Prints Pt. 2

Sensor Clip – Print with temperature resistant material such as

ABS. This printed part will also be in the chamber and can see temperatures exceeding 70C. Print on its side as shown and a small amount of support material may be needed in the area indicated.

Step 5: 3D Prints Pt. 3

Radiation Shield Frame – A very simple to print part. It will also be in the

chamber, so it should be printed with heat resistant material such as ABS. No support material is needed.

Step 6: 3D Prints Pt. 4

Cover – Print with any material you’d like. Print the cover

face down as shown below. This will minimize the amount of support material required. You can also print it flipped over, but it will need much more support material. This will give a better looking part though since all the support material print defects will be on the inside of the case and out of view.

Step 7: 3D Prints Pt. 5

4 x Buttons – Print with any material you’d like. These are

very small items to print. It is suggested that you print with a brim to make sure they stay stuck to the print bed.

Step 8:

-Unpackage the Feather doubler kit. The kit comes with a set of stacking headers and a set of female headers. Install these into the board in their designated areas and solder the back of the board making sure the headers are perpendicular to the PCB.

-Use flush cutters to cut off all the stacking header pins once it is soldered to the board.

Step 9:

- Install extra set of stacking headers into the 32u4 Feather Basic Proto.

-Solder the pins on the back of the feather being sure not to cut off the pins.

Step 10:

-Open OLED FeatherWing kit. The kit should come with a pre-assembled OLED and a pair of male pin sets.

-Stick the two sets of pins into one of the doubler kit female header ports.

-Place the OLED FeatherWing on top of the male pins and solder all the pins. We are using the doubler as a holding fixture to make things easier to solder.

-After soldering, remove the feather + pins assembly from the doubler and set aside.

Step 11:

-Open the feather Relay Wing kit. The kit should come with a preassembled relay board and a pair of male pin sets.

-Similarly to the previous step, insert the pins into one of the doubler female header ports.

-Place relay kit on top of male pins and solder all the pins; using the doubler as a holding fixture.

-After soldering, remove the feather + pins assembly from the doubler.

-Flip the relay board over and you’ll see that there are jumpers we can solder. This selects which pin from the 32u4 will operate the relay. In code, we have set pin 12 to operate the relay, therefore, solder the indicated jumper with a bead of solder.

Step 12:

-Open the HTU21D-F sensor package. It comes with a male header set. We will NOT be using this header for this project.

-Cut 4 strands of wire each about 16 inches (~40cm) long. Strip and tin the ends of both ends of each wire.

-Insert a wire into Vin, GND, SDA, and SCL from the BACK side of the PCB. Solder each wire on the front (chip side) of the board. Trim any excess wire sticking through the front of the PCB with flush cutters. Note which color wire goes to which labeled hole.

Step 13:

-Route the four wires through the duct in the part (See below). Note: 3D printed part in picture may look slightly different than current part.

Step 14:

-Insert the four wires coming through the front of the 3D printed base and insert them into the BACK of the doubler in the correct pin positions and solder on the front side of the PCB. Trim any excess wire with flush cutters. See below of the locations of where to insert the wires.

-Using 4 x M3 x 6mm SHCS, attach the double board to the 3D printed base in the four corner holes. Noting that the doubler position with the four wires attached should be oriented towards the top.

Step 15:

-Install the relay wing on the bottom doubler (not the one that has the 4 wires soldered to it).

-Install the Feather 32u4 on the top doubler.

-Stack the OLED wing on top of the Feather 32U4.

Congratulations! You have successfully assembled the controller system and electronics!

Step 16: Building the Drying Chamber

Tools Required

Drill/Drill Bits

Dremel Tool or Xacto Knife

Silicone Adhesive

Flush Cutters

Step 17:

-Use a ~6mm drill to drill ~14-20 air Inlet holes in the side of the 5 gallon bucket near the bottom. Clean up the holes as necessary with a Xacto.

-Use a ~6mm drill to drill ~ 14 air exit holes around the edge of the lid of the 5 gallon bucket.

-We will now create the holes used to insert the rod that
will be used to hang the filament rolls. Using a drill slightly larger than your hanging dowel, drill a hole in the side of the bucket ~10” from the bottom. On the exact opposite side at the same height, drill an identical hole.

-Insert dowel through both holes to ensure proper alignment. Trim ends of down so they are slightly longer than the width of the bucket.

Step 18:

-We now need to make a hole to insert the 3d printed baseplate. Using a Xacto or Dremel tool, create a hole with dimensions ~23mm W x 22mm H at roughly half the height of the bucket.

-Once the hole is created, ensure the temperature sensor end of the 3d printed base plate can fit through the hole. Adjust hole size as needed.

-Using the Dremel or Xacto, create a small rectangular cutout next to your previous hole with dimensions ~15mm W x 7mm H (See below). This will be used to route the power cable for the light. NOTE: The small rectangle must be to the right of your larger cutout.

Step 19:

-Spread a thin layer of slicone adhesive on the inside of the lid and apply a layer of aluminum foil covering the entire inside of the lid.

-Using the lid as a template, trim the excess foil just inside the feature where the lid would interface/lock to the bucket. (See below)

-Once dry, using a 6mm drill bit, or any similar sized poking device, poke the holes through the foil that line up with the holes drilled in the lid earlier. We need to make sure we don’t seal off those original holes with foil!

Step 20:

-In the same way, apply a thin layer of silicone adhesive to the inside walls and inside bottom faces of the bucket.

-Apply aluminum foil covering all the inside walls of the bucket (See image below). Allow adhesive to set. TIP: Use your bucket lid as a stencil to make a circular foil piece for the bottom of the bucket.

-In a similar way, use a 6mm drill to poke holes through the foil where you drilled the 6mm holes at the bottom of the bucket, the holes for the dowel rods, and the hole cut for the temperature sensor. Ensure proper airflow through the bottom holes.

Step 21:

-Place the work light in the bottom of the bucket and run the plug through the 22mmx23mm hole created earlier leaving some electrical cord slack in the bucket so the light lays on it’s side in the bottom of the bucket.

Step 22:

-Insert the temperature humidity sensor (wired earlier) through the hole so it is on the inside of the bucket.

Step 23:

-Once through the hole and inside the bucket, insert the sensor into the printed clip in the orientation shown below.

-Attach sensor with 2 x M2.5 SHCS

Step 24:

-After ensuring the light cord is not plugged in (Safety first! You’re working with wall voltage and current!), use flush cutters to cut ONE of the two wires on the light cord in close proximity (~2”-3”) to the outside of the bucket.

-Use an Xacto to separate the cut wire from the non cut wire.

-Using flush cutters or wire strippers, remove about 10mm of insulation from the cut wire.

-Assuming the wire is stranded, use your fingers to twist the wires so they are not frayed.

Step 25:

-Insert one of the wires into the COM (middle) terminal on the relay. Use a small flathead screwdriver to tighten the terminal. Give the wire a tug to make sure it’s not loose and ensure no non-insulated wire strands are sticking out of the terminal.

-Repeat the previous step with the second end of the wire. Insert this wire into the N.O. (Normally Open) terminal. With the assembly oriented with the OLED on top, the N.O. terminal should be the lower one. Screw the terminal down and tug on the wire to ensure it’s not loose.

Step 26:

-Take the four small buttons you printed earlier and insert them into the four holes from the inside of the cover. You may need to use an Xacto to make the holes slightly larger to ensure the buttons slide smoothly.

-Take the base assembly and insert it face down into the case noting the proper orientation where the OLED and buttons should line up with the button pins and the hole for the OLED in the cover. Also make sure the light power cords route correctly through the protective cover.

-Use 3 x M3 x 6mm SHCS to attach the cover to the base assembly making sure the light cord wires route properly through the protective opening. There should be one screw on the top and two on the bottom of the assembly.

-Test and make sure you can press all of the 3D printed buttons and feel the buttons “click”.

Step 27:

-Liberally apply silicone adhesive to the surface indicated below.

-Push the square 3D printed feature on the back of the base plate through the 22mmx23mm hole in the bucket while carefully routing the light power cord through the 7mmx15mm slot.

-Either lay the bucket on its side or use tape to temporarily hold the assembly in place while the silicone dries. Remove the tape once dry.

Step 28: Building the Radiation Shield

Tools Required

Silicone Adhesive

Aluminum Foil

Step 29:

-Ensure you’ve printed the shield frame out of ABS.

-Take a spool of filament and lay it on a piece of foil

-Unroll foil until there is enough area of foil to lay 3 spools easily

Step 30:

-Fold over foil 3x so that the final approximate width is slightly wider than your spool.

-Fold in corners of the foil followed by the edges until you have a (roughly) foil circle sized slightly larger than your spool.

Step 31:

-Place the 3D printed frame in the center of the foil circle and adhere to foil using silicone adhesive.

-Allow to dry

-Poke hole through foil through the center of the 3D printed frame.

Congratulations! Your assembly is complete!

Step 32: Loading the Code

-Install the Arduino IDE found here:

-Follow this guide to install the drivers for the feather ecosystem (specifically the “Using the Arduino IDE” and “Arduino IDE setup”):

-In order for the code to properly run, you need to install the libraries for the temperature sensor and the OLED display. Adafruit has a great writeup on how to do this. Follow their instructions.

-The OLED library can be found here:

-The temperature/humidity sensor library can be found here:

-Download both libraries, unzip the files and place the extracted folder into your /Arduino/libraries/ folder.

-Download the code found here:

-Open the downloaded file.

-Plug in your micro USB cable from your laptop to your 32u4 feather port.

-Under Tools : Board: Select “Adafruit Feather 32u4”

-Under Tools: Port: Select the correct COM port associated with the feather card.

-Click the upload button

-Once the code finishes uploading, unplug the USB cable, plug the 5V power supply into the feather micro USB port and plug the light cord into the wall. You’re all set to run!

Step 33: Inserting Filament Into the Dryer

-Slide hanging rod out of one side of the bucket

Step 34:

-Slide radiation shield onto hanging rod with aluminum foil facing towards reflected light, 3D frame facing away from light.

Step 35:

-Slide roll of filament onto hanging rod behind radiation shield.

Step 36:

-Slide hanging rod back into position through rod hole in bucket.

Step 37:

-Clip temperature sensor onto roll. If sensor clip is not a tight fit on a specific roll, use a piece of filament on the roll placed over the 3D printed hook to hold the sensor in place.

-Spin the roll such that the sensor is at the highest point on the roll (closest to top of chamber).

Step 38:

-Tightly close the chamber lid.

Step 39: Using the Program

-After plugging in the feather, press the reset button to start up the LCD.

Button Layout

Step 40:

The program will have you make four selections

1. Max Temperature – This is the maximum temperature the controller will allow the ambient temperature to rise to. Keep in mind the glass transition temperature of your filament. Some may need a lower temperature to fully dry compared to others.

2. Tolerance – This is how many degrees the control system will allow the temperature to fall before turning the light back on to heat the chamber. If you keep this number small, the temperature will be more constant but the light will have to turn on and off frequently. A larger value will allow the chamber to cool a bit longer and keep the light from flashing on and off quickly.

Max temp: 60C, Tolerance 5C: The light will turn on until the chamber reaches 60C then will turn the light off until the chamber reaches 55C. It will then turn the light on until the chamber reaches 60C again.

3. Time at Maximum Temperature – This is the number of hours the controller will hold the temperature in the chamber between max temp and (max temp – tolerance) before switching to power save/humidity mode.

4. Max % humidity after Hours – This is the power saving mode that the controller switches to after the number of hours (set in 3) is met. Set the humidity to the maximum allowable % humidity you’d like to keep in the chamber until you can come remove the filament. The light will heat the chamber until one of two conditions is met:

1. Max temperature (set in 1) is
reached and will not turn on again until the temperature falls below the tolerance (set in 2) and the humidity is above the max % humidity (Set in 4)

2. Humidity in the chamber falls below the Max % humidity (set in 4) and the percentage humidity doesn’t change by more than 0.3% in a 30 second time period, indicating the chamber has reached minimum humidity. This way, hopefully, you’re only using the light to keep the humidity below a desired percentage as opposed to trying to use the light to keep the chamber at a desired temperature. If the filament is dry, as long as you keep the ambient air dry it shouldn’t absorb any moisture waiting for you to remove the filament from the chamber. It should use a lot less electricity.

Step 41: Displayed Data Screen 1 – Drying Mode

T(c): Current chamber temperature in Celsius

H(%): Current chamber humidity

Heat: Current state of heating element

Tme: Total time elapsed since drying started

MinT: Minimum allowable temperature (in Celsius) in chamber. This is the temperature in which the heating element will turn back on.

Max: Maximum allowable temperature (in Celsius) in chamber. This is the temperature in which the heating element will turn off.

Step 42: Display Data Screen 2 – Humidity Hold Mode

T(c): Current chamber temperature in Celsius

H(%): Current chamber humidity

Heat: Current state of heating element

Tme: Total time since drying started (Humidity hold mode starts when Tme is equal to Time at Max Temperature)

MaxHum: The maximum humidity allowed in chamber while in humidity hold mode that the control system will try to hold.

Step 43: Does Power Saving Mode Work?

While the control system allows you to keep the filament

heated at maximum temperature indefinitely, if you know it will be dry in 24 hours, but you won’t be able to retrieve it until later or you want to print filament while it’s still dry in the chamber, the controller switches to humidity hold mode. The system turns on the light as infrequently as possible to keep the humidity in the chamber as low as possible. The extra benefit here is it should use less energy.

Using a Kill-A-Watt meter, the two modes were tested. First, the chamber was heated to 55C with a minimum temperature of 52C in filament drying mode. After 7:08hrs, the meter reported 0.4KWh used. This works out to 0.056KWh/hr.

Next the chamber was put in humidity hold mode and requested to keep the humidity below 7%. After 7:03hrs, the meter reported 0.26KWh used. This works out to 0.0367KWh/hr. This works out to almost a 35% reduction in power usage. This demonstrates that this mode can be very useful if you plan on keeping the filament dry in the bucket for a long time.

Please note that this is just one example. Actual energy savings can change depending on what max and min temperature is set on the controller, what max humidity hold percentage is set, and what the current humidity is outside of the chamber.

Step 44: Conclusion

By placing a temperature and humidity sensor on a roll of

filament, it is possible to create a control system that can hold a desired temperature in a vessel long enough that even the most water saturated filament can be dried out.

A radiation shield was added to the system because radiation being given off by the light was being absorbed by the black filament spools. The spool was becoming much hotter than the measured ambient air temperature. This caused the spools to start to warp. By adding the radiation shield, the spools and filament can only achieve measured ambient air temperature and not rise above it.