Filament spool weight measurements: plugin and hardware design
-
I finally pulled all pieces together into a single project and wrote a README to have a nicely integrated filament weight sensor:
https://github.com/Kriechi/duet-plugin-filament-load-cell
It contains a DCS plugin to expose an HTTP endpoint, which returns a simple weight measurement in the style of
approx. 762g filament left
and displays that via a DWC plugin in the top menu bar in the browser - which makes it easy to prevent out-of-filament pauses or failed prints.The sensor itself is based on a 1kg load cell, mounted with a small bracket to my printer frame. The load cell gets read by an HX711 chip, which gets read by an Arduino Nano, which gets read over I2C by my Raspberry Pi / Duet SBC, which gets read by the DCS & DWC plugins.
The Arduino Nano / ATmega168 firmware code is included and can be compiled & flashed via PlatformIO.
While this was pretty much a "done" project for my printer, because its working for years already, I only recently merged and refactored everything into new Duet plugins. The DWC plugin is a very simple Javascript with an XHR/XMLHttpRequest/AJAX call to the new DCS HTTP endpoint and inject the returned measurement value into a new HTML element. No complicated Vue.js trickery involved - the JS code originated from a Tampermonkey script, so it is dead simple and only a few lines!
Check out the README for more details!
Enjoy!
-
-
@resam Is possible to add color and then if possible to do for 4 tool's spools
-
@matej1006 it is possible - if you can change the code and build it
But you would have to do that yourself - all the code is open source and available on GitHub. -
@resam i hope that i can figurit out how it's go.
i am not so goo d at programing