| This is a preview build! Instructions may be unclear or missing. You should have sufficient electronics experience to solder or crimp your own connectors and program a micro-controller. |
This is a spool holder for the Prusa CORE one with an integrated load cell to measure filament spool weight. It takes up no extra space* compared to the stock filament spool. It's connected to a micro-controller flashed with ESPHome.
I also added a PN532 NFC reader to tag my spools but this is completely optional. I have not yet added instructions or files for that but included my config.
* The electronics take up space
NOTE: Don't expect great precision. While calibration can help, there is going to be drift in the measurements especially as the chamber temperature heats and cools. The intent of this project is to be a general measuring system – not a precision scale.



In my photos I used a Wemos D1 Mini but this is the ESP8266 and not recommended by ESPHome. If you are buying a new microcontroller for this project, I would recommend an ESP32. The config below is one for the ESP32-C6-DevKitC-1.
Open ESPHome Builder and use the following config, modifying the pins for those matching your microcontroller:
substitutions:
spoolman_url: "http://192.168.1.110:7912" # replace this with your Spoolman server and port
esphome:
name: prusa-core-one-filament-scale
friendly_name: Prusa CORE One Filament Scale
esp32:
board: esp32-c6-devkitc-1
flash_size: 8MB
variant: esp32c6
framework:
type: esp-idf
logger:
api:
encryption:
key: "<there's_a_random_key_here>"
ota:
- platform: esphome
password: "<there's_a_random_password_here>"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
ap:
ssid: "prusa-core-one-filament-scale"
password: "random_characters_here"
captive_portal:
http_request:
sensor:
- platform: hx711
id: gross_filament_weight
name: "HX711 Value"
dout_pin: GPIO0
clk_pin: GPIO1
gain: 128
update_interval: 10s # Change this to a longer value once you've calibrated the HX711. 30s is good
filters:
- calibrate_linear:
- 23000 -> 0
- 61550 -> 100
- 155000 -> 200
- 235000 -> 500
- 439000 -> 973 # These are example values. You will need to calibrate these
unit_of_measurement: g
number:
- platform: template
name: "Spoolman Spool ID"
id: spoolman_spool_id
icon: "mdi:printer-3d"
min_value: 0
max_value: 999999999
step: 1
restore_value: True
optimistic: True
button:
- platform: template
id: send_to_spoolman
name: "Send weight to Spoolman"
on_press:
then:
- if:
condition:
- switch.is_on: toggle_spoolman_update
then:
- http_request.send:
url: !lambda |-
char buf[256];
sprintf(buf, "%0.f", id(spoolman_spool_id).state);
return ((std::string) "${spoolman_url}/api/v1/spool/" + buf + "/measure").c_str();
method: PUT
headers:
Content-Type: application/json
json:
weight: !lambda "return std::to_string(id(gross_filament_weight).state);"
switch:
- platform: template
name: "Send to Spoolman?"
id: toggle_spoolman_update
icon: "mdi:server"
restore_mode: RESTORE_DEFAULT_ON
optimistic: True
#### Optional LED on the devkit board ####
light:
- platform: esp32_rmt_led_strip
rgb_order: GRB
pin: GPIO8
num_leds: 1
chipset: ws2812
name: "Board light indicator"
id: board_led
#### Everything below here is completely optional ####
#### Remove everything below if you are not using ####
#### an NFC reader ####
i2c:
sda: GPIO4
scl: GPIO5
scan: true
id: bus_a
#### Tags have a single NDEF text record. It is ####
#### formatted as: ####
#### spool_id:<id> ####
#### Example: ####
#### spool_id:37 ####
pn532_i2c:
- update_interval: 1s
- on_tag:
then:
- light.turn_on:
id: board_led
brightness: 100%
red: 0%
green: 100%
blue: 0%
flash_length: 5s
- lambda: |
if (!tag.has_ndef_message()) {
return;
}
auto message = tag.get_ndef_message();
auto records = message->get_records();
for (auto &record : records) {
std::string payload = record->get_payload();
size_t pos = payload.find("spool_id:");
int spool_id = atoi(payload.substr(pos + 9).c_str());
id(spoolman_spool_id).publish_state(spool_id);
ESP_LOGI("custom", "Scanned spool ID: %d", spool_id);
}
return;
- button.press: send_to_spoolman
Connect the load cell to the HX711 ADC board following this wiring scheme:
Red → E+
Black → E-
White → A-
Green → A+
Wire the HX711 to 3.3V power (VCC), ground(GND), clock (SCL/SCK) and data (DOUT/DT).
If you're adding a PN532 NFC reader, then you'll need to share the 3.3V power with the HX711. This will require some soldering or crimping multiple connectors. I tried the HX711 with 5V with no issues but it's likely going to cause premature failure.
The printer should not be printing while doing this or else it could throw off the values. It should also be around room temperature.
- calibrate_linear:
- 23000 -> 0
- 61550 -> 101
- 155000 -> 220
- 235000 -> 550
- 439000 -> 973Here's a little chart you can use to write things down:
| Filament Weight | HX7111 Value |
This should be enough to get you started.
This is a CC0 model. Remixes welcome!
Write a comment or post a make!
The author marked this model as their own original creation.