3D Printing & CNCTechnician

Filament Spool Scale: Know How Much Is Left

A load cell under your spool holder reports the grams of filament left in Home Assistant before you start a long print.

LevelTechnician
Time1.5 h
Est. cost~$42
Steps5

Running out of filament halfway through a 10-hour print is painful. A 5 kg load cell and an HX711 amplifier weigh the spool continuously, and ESPHome subtracts the empty spool's weight so you see the real filament left.

Mission steps

  1. Print the holder

    Print a spool holder that rests entirely on the load cell, with the bar mounted at one end and the load on the other.

  2. Wire the HX711

    Load cell red/black/white/green to E+, E−, A−, A+ on the HX711; DT to GPIO4, SCK to GPIO5, power from 3V3.

  3. Flash ESPHome

    Use the hx711 platform and read the raw values with nothing on the holder and with a known weight.

  4. Calibrate

    Put those two raw numbers into calibrate_linear, then subtract the weight of an empty spool of your brand.

  5. Add a warning

    In Home Assistant, compare the grams left with the slicer's estimate before starting a print.

Code

sensor:
  - platform: hx711
    name: "Filament Left"
    dout_pin: GPIO4
    clk_pin: GPIO5
    gain: 128
    update_interval: 10s
    unit_of_measurement: g
    accuracy_decimals: 0
    filters:
      - calibrate_linear:
          - 120000 -> 0        # raw value with an empty holder
          - 520000 -> 1000     # raw value with a 1 kg reference weight
      - lambda: return x - 230;   # weight of your empty spool in grams

Tip: test every script on the bench before installing it in a moving machine.

Questions

The weight slowly drifts.

Load cells creep with temperature and time. Keep the cell out of the enclosure heat and re-zero it when you change spools.