I don’t use my 3D printers as often as I’d like, but I’m always stocked up on filament in different types and colours. I rarely go through a full spool of the filament at once, so the shelf life of the average spool in my house is counted in months rather than weeks. Storing spools correctly will extend their shelf life and reduce the print issues associated with damp filament. As the UK isn’t known for the best storage humidity, I thought I would do something about it and employ all the home automation experience I gathered so far.
Storing filament smarter
While the idea of keeping your spools inside the food containers with desiccant bags isn’t new or novel, I decided to take it to another level and integrate the Spool Manager plugin from Octoprint and environmental sensors to keep tabs on the condition of the filament. SwitchBot took a liking to this idea and sent me a couple of Smart Meters and Smart Meter plus to take advantage of, I will also show you how to do this with other temperature sensors.
If you don’t want to DIY this yourself, you can also take a look at the selection of filament storage boxes/dryers designed specifically for that purpose. These are expensive but often come with a built-in heater and environmental data. Unfortunately, these don’t share the storage data via the internet, so you’ll have to keep an eye on these in the more traditional way.
- Creality DryBox $40.99 (Creality store)
- Sunlu S2 DryBox $64.49 (AliExpress)
Shopping list
As I don’t want to spend a lot of money on the spool storage (I’d rather spend that on filament or upgrades to make my printer completely silent), I decided to go with the “make your own” approach. To make your own smart filament storage, you will need a couple of items:
The choice of storage boxes is very important. The size and good seal are the 2 most important factors. The boxes I picked are perfect, as they fit 1KG spools comfortably, leaving enough space for desiccant bags and possibly for a mechanism to dispense the filament without taking it out from the box (an idea for another project).
Desiccant bags are re-usable. They absorb the moisture over time and need to be re-conditioned from time to time to keep the ability to do so. To recondition the bags, simply put these into the oven for a couple of hours at 50-70℃ until silica gel releases all the accumulated moisture.
The number of boxes will depend on how often you swap your spools around. At the moment I have 2 3D printers, usually 2-3 spools open in different colours. I also get leftovers from work – of a very expensive Nylon with Carbon Fibre – a filament that is very sensitive to moisture. For my configuration, I decided to go with 4 individual boxes and one long term storage container.
Of course, sealed spools just need space on the shelf, but I’d like to keep track of these as well, to plan my shopping list accordingly.
SwitchBot Meter approach (easy)
If you don’t need an elaborate (see below) storage system for your spools, but if you’d like to keep a smart eye on your filament, you can make a simple smart storage box thanks to SwitchBot. The whole process takes less than a minute.
SwitchBot Meter and SwitchBot Meter Plus are great for the task at hand thanks to big displays, temperature & humidity data on display (in ℃ and ℉) and cloud warnings to let you know when the environment inside the filament storage is outside of the desired range. Add a SwitchBot Meter for each box (feel free to use 3M tape to keep SwitchBot Meters in place) and name them accordingly in the app.
SwitchBot Meter samples the air every 4 sec and updates the cloud every 2 min. With SwitchBot Meter Plus, you also have an option to display comfort levels for your spools. It will show happy/wet/hot icons on the panel. Ideal storing conditions should be 10-15℃ and <30%.
Place the spool and desiccant bags (1-2 200g bags should be enough) inside the container, close it and leave it for a day for the environment to settle. Use the app to check the humidity levels. It should be below 40% by then. Use the SwitchBot Meter option to set a notification when the humidity levels are higher than 40%. A push notification will appear when the alert humidity is reached and stays on for more than 2 min. It’s your cue to open the box, and re-condition the desiccant again so it could absorb moisture.
Hubless vs Cloud
You won’t even need a hub, as SwitchBot Meters use Bluetooth to talk to your phone (when in proximity) and upload saved data to the cloud. It happens in the background, so you don’t have to worry about it yourself.
If you get SwitchBot Hub as well, it will enable cloud access (and notifications). With the hub, SwitchBot Meters can upload the data to the cloud, and you can access the current information from anywhere. Not a bad upgrade.!
- SwitchBot Meter $14.99 (discounts on bundles)
- SwitchBot Meter Plus $14.99 (discounts on bundles)
- SwitchBot Hub $39.00
Oh, and if you fancy a bit of home automation while you are at it, check out other products from SwitchBot. Their SwitchBot Bot can be used to turn on/off the printer too! But I will leave that to you to figure out.
Advanced Filament Management (advanced)
If you already have a RaspberryPi running Octoprint (check out my Octoprint hardware guide for the Raspberry Pi Zero series), you can take advantage of NodeRED and Spool Manager to share the information about the spools and display the environmental info for each box via a handy dashboard. You can use Spool Manager to add your spools to the inventory and monitor for filament usage as usual and the smart filament storage will update and display all that data along with the information about the boxes, humidity and spools stored inside.
It’s a perfect dashboard for planning long prints ahead and making sure that your next 3D printing task won’t run out of filament.
Your Octoprint instance will need the following plugins installed:
Database access
At the moment only some of the data from Spool Manager is exposed via MQTT. I have asked the developer to consider sharing extra fields, but until this is implemented or the file database can be stored natively in a shared location, we have to work with a small workaround.
Reading spoolmanager1.db
Despite my best attempts, I couldn’t reliably read from the original file. I could download existing entries in the database, but new spools added by Spool Manager were invisible to NodeRED until reconnected. Fortunately, making a copy of the .db file solved the issue, and all I had to do is to make sure that the original file is duplicated again when a new spool is added or removed. I was very happy to discover this workaround as the issue of not updating spools stopped the process in its tracks.
If your NodeRED runs on Raspberry Pi with Octoprint
To get the information about spools in the Spool Manager (extra info like brand name, filament properties etc), you will need to read this from the database file. This file is located in: /home/pi/.octoprint/data/SpoolManager
By default, the NodeRED flow will make a copy of the spoolmanager.db
file (/home/pi/spoolmanager1.db
) and use that instead.
If your NodeRED runs on a different machine
I have a dedicated machine that runs my home automation, therefore I will have to access the .db file through the local network. While not ideal, it’s not a complex process. I will use the samba server to expose the .db file location as a shared folder. This way, I can simply read from the database when I need to.
Install samba and create a share
Samba shares will expose the folder with the database to any machine on the network and it’s a quick and simple workaround to read from this file. As we are not writing anything to the file ourselves, it’s also non-breaking, and you won’t lose the data entered by the Spool Manager.
Now that we have the share, let’s set up the permanent access to the folder on our target Raspberry Pi that runs NodeRED (or whatever hardware you are using to do that). For Raspberry Pi, you need a samba-client.
NodeRED requirements
I used several nodes that are not installed by default, so you must visit palette manager to add these to the rooster:
- node-red-contrib-ui-svg
- node-red-dashboard
- node-red-node-sqlite
- node-red-node-ui-table
Once added, you should see all nodes in the imported flow (see bottom of the article for the link). You will also need an MQTT broker installed, the one I used was mosquitto (sudo apt-get install mosquitto
).
Getting temperature & humidity
I’m going to use SwitchBot Mater and SwitchBot Meter Plus as they come with big displays to check the environmental data on the spot, and SwitchBot API to extract data from the cloud into NodeRED. To do this, I will need a SwitchBot Hub (otherwise you are limited to uploads each time SwitchBot Meter is in the phone’s range).
If you are using SwitchBot Meters, you will need the deviceID
for each meter/box so you can extract the information from SwitchBot Cloud. These can be obtained by making a REST call (included in the flow), the script will list all SwitchBot Meters and MeterPlus devices in the flow context.
It’s not the only way. If you have ZigBee coordinators like the one from Sonoff or Electrolama, you can use other sensors and send data to NodeRed over ZigBee2MQTT. I will include that in my project as well. If you want to know what are the best ZigBee temperature sensors – a couple of weeks ago I compared 11 sensors, so you have an idea of what to pick.
SwitchBot API
I have detailed instructions on how to work with SwitchBot API, so this is just a short recap. I need the API key and account details to make a REST call and obtain the information from the cloud. Check out the Settings node in the flow to add your API key generated by the app (press app version 10 times).
ZigBee2MQTT
If you are using other sensors, I already covered the use of ZigBee devices in NodeRed in this post. Thanks to ZigBee2MQTT I can obtain the humidity and the temperature each time the sensor is reporting back. The typical payload will look like this:
{
"temperature": 21.54,
"humidity": 49.17,
"voltage": 2.975,
"time": 1546734980991,
"device": "Temp1"
}
And it’s supported by my flow in this form. If your temperature and humidity are reported differently, you will need to make the necessary adjustments. Just make sure you know which device is assigned to which box. This information is used to update the box data.
UI
To organise your smart filament storage, you will need to define the number of boxes, names, and colours for each box. The ones I picked have colourful locks to easily identify them. If you run out of individual colours, you can use a sharpie to put the corresponding names on the box. These parameters can be accessed via the Settings node in the flow.
For each box, you will also need a ui-svg
node and switch node entry with a boxID
. The boxID
is a fixed number (0 indexed) assigned to each box in an orderly fashion, and this is how all boxes are identified.
Spool Manager & Octoprint
Smart Filament Storage uses Spool Manager to display filament information. Each roll added via Spool Manager will also appear in my flow. Each spool is tracked as well, so the usage, filament age and list of rolls are accessible from the NodeRED dashboard.
Just note that empty spools are excluded from the table (I see no reason for inclusion), but they are still available in the database until removed. So if your spool still has filament on it, but Spool Manager estimated that it should be empty by now, you can edit the spool to see it again in the table.
When you load a filament in Spool Manager onto your printer, my smart filament storage will also indicate this by changing the icon inside the box. Once unloaded, the filament will return to the box until removed in the UI. You can reset the desiccant counter for each box by double-clicking on each icon.
Planned features
As I’m chased by the deadlines, there is a number of features I left out for now. I will find some spare time to add these to make the system better:
- High humidity Android alerts for each box
- Clickable Price to buy more spools
- Better font alignment
- support for multiple printers
- highlight/remove rolls in boxes from the table
- ability to show weight/length
Final thoughts
Consider this project a v0.9. While it works pretty well, there are things I want to improve in the future (like fixing text alignment, support for multiple printers and mobile notifications). So keep the eyes peeled for updates, and report any issues and feedback in this Reddit post. I will take the most interesting requests into consideration.
📈💵 – See the transparency note for details.
Project Download
Download project files here. Bear in mind that Patreon supporters have early access to project files and videos.