This project is to add a load cell to the filament spool holder of a Creality Ender 3 Pro 3D-printer to measure and display weight of spool. Using the tare function of the scale on an empty spool, the user can determine the amount of filament (in grams) remaining on a spool.
This project uses an Arduino or ATtiny85 microcontroller with the HX711 load cell module for weight measurement and a TM1637 4-digit LED display.
ATiny85 Microcontroller
TM1636 4 Digit 7-Segement LED Display
Load Cell
HX711 Load Cell Amplifier (ADC)
100uF Electrolytic Capacitor
5V Power Supply
The filament scale mounts on top of the Ender 3 top rail where the filament spool is located. You will need to print the load cell mount and the LED display box. This is available on Thingiverse or Tinkercad.
See example build pictures below.
This sketch requires that you calibrate the load cell. This involves the following steps:
- Run the sketch with DEBUG true (using a Arduino Uno or other microcontroller with serial)
- Record the "HX711 reading" values with NO load on the scale - this is your "
CAL_OFFSET
" - Use a trusted scale to weigh an object like a can of soda, and record this value as your "
KNOWN-VALUE
" (Note: use the unit of measure you want for the scale, like grams or kg). - Place the object on the load cell and record the "HX711 reading" - this is "
CAL_VALUE
" - Edit the #defines in the code for your
CAL_OFFSET
,KNOWN-VALUE
andCAL_VALUE
- The compiler will compute
CAL_RATIO
= (CAL_VALUE
-CAL_OFFSET
) /KNOWN-VALUE
The TARE button uses PB0. If you use the Tiny AVR Programmer from Sparkfun it drives an LED on PB0 and once the sketch is uploaded, the TTiny will read PB0 as LOW and assume you wish to TARE the scale. You will need to remove the the chip from the programmer after uploading to get it to work correctly in the circuit.
This code uses the TM1637TinyDisplay and HX711 Arduino libraries that can be installed via the Arduino IDE.
On start the circuit will read the last TARE value from EEPROM and display the the current weight. Press and hold the TARE button and the current weight value will be recorded in EEPROM and subtracted from the current reading to "Zero" out the scale. The display will flash "Tare" to indicate it has been zeroed.
To accurately measure the amount of filament left in a spool, place an empty spool on the spool holder before pressing the TARE button.
- Library for HX711 https://github.com/bogde/HX711
- HX711 Load Cell Amplifier, Weighing Scale Design https://circuits4you.com/2016/11/25/hx711-arduino-load-cell/