This is a modification of the office spool holder, to hold a load cell, which measures the weight of your filament.
Load cell used: https://www.amazon.com/gp/product/B076P8G8B6/ref=oh_aui_search_asin_title?ie=UTF8&psc=1
Hackaday instructions for setup: https://hackaday.com/2018/08/10/3d-printers-get-a-fuel-gauge-adding-a-filament-scale-to-octoprint/