Introduction: Arduino Digital Filament Scale (Display Remaining Filament on a Spool)

Welcome to my first Instructable. I hope you enjoy it.

As a 3D printing enthusiast I've often run into the issue of whether there is enough filament remaining on a spool to print the object I want to create. I'd look at spool and think that there could not possibly be enough on it to do job. Ultimately I'm left with a bunch of spools with filament on them that I just store and use when I think it has enough filament on to print an object. And I don't care who you are. Determining the length of material left on a spool isn't something you can't just eyeball.

To get around this problem I decided to build a scale that I could use to tell me the approximate length of filament remaining on a spool and to do that for the top five used filament types.

I guess I could have just used a kitchen scale, tared it to an empty spool, re-weighed a spool with filament then done the calculations manually, but why? Micro-controllers do calculations quite well so why should I do it? 😏

Scale Overview

The "FILAMENT" button lets you cycle through a list of five different filament types. PLA, ABS, PETG, Nylon and TPU. There is one more filament type named "TARE". This is the master tare and if changed affects all other readings.

When you tare the filament scale for a selected filament type with an empty spool or equivalent weight, the weight value is saved to EEPROM. If the scale is powered down and restarted, the scale will remember the tare weight and apply it to the reading.

Each of the filament types can store their own spool tare weight. There is an indicator that is displayed on the LCD showing that the selected filament type was tared with an empty spool.

To clear a tare weight, all you need to do is tare the scale for the selected filament when it's empty.

The scale will display the weight and the estimated length of filament remaining on the spool.

Filament Weights

After searching the Internet I found some info on filament weights per meter. These are the values I ended up using. And after checking the value for PLA against a 2 meter length of PLA filament, the result was bang on. But as we all know not all filament will weigh exactly the same for a given manufacturer so the results should be considered as a close estimate.

[ PLA: 2.98g/m ] [ ABS: 2.50g/m ] [ PETG: 3.05g/m ] [ Nylon: 3.65g/m ] [ TPU: 2.91g/m ]

Spool Weights

There is documentation included in the sketch that details the estimated weight of an empty spool for a number of different manufactures. This was put together by Denise at stldenise.com.

Supplies

Here is a list of the parts I bought along with a link to where I purchased them.

1 - I2C LCD 1602 Display Module (2 Pack) (Amazon.ca)

1 - Nano V3 Module Atmega328 (5 Pack) (Amazon.ca)

1 - 1kg Digital Load Cell Weight Sensor c/w HX711 Module (2 Pack) (Amazon.ca)

2 - Normally Open / Momentary Push Buttons

7 - 10mm Round Silicone Cabinet Door Pads (1x100 Pack) (Amazon.ca)

2 - 5mm Hex Head Screws (15mm to 20mm Length)

2 - 4mm Hex Head Screws (15mm to 20mm Length)

4 - 3mm Screws (10mm Length)

4 - 3mm Threaded Heat Inserts

Some Crazy Glue (To secure the base to the electronics enclosure)

Step 1: 3D Printed Parts

I designed the parts for this project using a simple CAD program called TinkerCad. It's not Autodesk by any stretch but it's free, helps me get the job done and has worked well for me in many of the 3D projects I've printed.

There are five parts that need to be printed. The scale base, the scale filament spool saddle, the scale load cell spacers, the electronics enclosure base, the electronics enclosure top. There is also a label for the buttons if desired.

The size of the button holes can be modified in TinkerCad to fit the type you wish to use.

NOTE: The 3mm screw holes may need to be drilled out to size to fit the screws. The ones I printed were slightly undersized.

Step 2: The Arduino Sketch

I'll not go into great detail about the sketch other than to say that the sketch utilizes five important external libraries. If you don't have them you can add them to your Arduino IDE using the library manager.

#include <EEPROM.h>             // Enables writing values to EEPROM
#include <DebouncedSwitch.h>    // Library to debounce a push button
#include <HX711_ADC.h>          // Scale Library
#include <Wire.h>               // I2C library
#include <LiquidCrystal_I2C.h>  // The LCD library

The sketch is broken down into nine tabs. Each tab contains functions for a given purpose. I do this so I don't have to scroll down a page full of functions just to find one.

You can download the sketch from my web site, davebuildsthings.ca using This Link. I can not upload ZIP files to Instructables.

Step 3: The Wiring Diagram

The diagram shows all the necessary connections for the scale circuit.

The LCD is connected to the Nano by wiring SCL to A5 and SDA to A4. The HX711 module is connected to the Nano by wiring SCK to D3 and DT to D2.

The TARE button is wired between Ground and D8. The FILAMENT button is wired between Ground and D6.

All devices are powered by 5VDC.

Step 4: Scale Construction

The following steps outline the construction of the scale.

Step 5: Display Case Bottom (Underside)

The Nano is mounted face up on the left side and wired from the back side. The HX711 module is mounted on the right side face up. The melt pins are heated and pressed to secure the boards in place. Alternatively, you could also use a 3D printing pen to place melted PLA on the corners and press to secure the boards.

The HX711 has a 6 pin female header soldered onto the top to allow the connection of the load cell. The load cell wires are soldered onto a 90 degree six pin male header with each connection covered by heat shrink tubing.

The opposite side of the HX711 board uses a four pin JST-XH connector. Alternatively, you can just solder wires directly to the board.

Step 6: Display Case Top (Underside)

The scale top has an opening for the LCD display and is secured in place using four melt pins as shown in the photo. The four corner holes are used to mount the 3mm heat inserts. Once the buttons and addition wiring is completed the top and bottom are screwed together from the bottom using four 3mm screws.

Step 7: Scale Load Cell Assembly

The spool saddle is mounted onto the bar load cell using two 4mm screws with the 4mm spacer between them. The scale base is mounted to the opposite end of the bar load cell using two 5mm screws and the 5mm spacer between them.

Be sure to note the direction arrow on the bar load cell to ensure proper orientation.

Step 8: Gluing the Display to the Scale Base

The display base has a hook like arrangement on the back side. This is glued with the crazy glue and then clipped over the scale base. Set the scale down on the pads and let the glue set.

IMPORTANT! Please be sure to apply the silicone pads to the bottom of both parts before gluing them together. This will ensure the two parts are level with each other.

Step 9: The LCD Display

A picture of the LCD display in operation.

Hopefully after completion, you will have your own working filament scale. And remember that the filament length you read will always be just a close approximation which is still better than a best guess.

There is additional documentation that can be found in the sketch file.