AMS Weight-Based Filament Tracking Using MQTT and RFID

Hello everyone,

I’m new to this forum and would like to introduce one of my projects.
It is a scale that measures the total weight of the AMS. In combination with the printer’s MQTT data, it determines both the weight of a newly inserted spool and the material consumption after a print job has finished.

The material consumption is then converted into meters and written to a SQL database.

At the moment, this setup works only with original spools, as they are equipped with RFID tags. By attaching RFID tags to third-party spools, these can also be detected and processed, although this requires a small workaround.

Has anyone here already worked on or implemented something similar?

Best regards
Jörg

4 Likes

There is SpoolEase and Filaman. They both can 1) Read general RFID tags,(SpoolEase I believe reads Bambu Labs RFID tags) 2) Measures the spool weight external of AMS, (AMS can be set to deduct from the starting weight as it uses filament) 3) Communicate with the AMS entering the filament info and weight directly into AMS.

Filaman needs spoolman running as a server. I am building scales for each with a RFID reader built in. I will publish the files when I am done, there will be righthand and lefthand of each scale. Left hand versions are below.

SpoolEase displays the spool weight on a separate console.

To give you a bit more detail on my solution:

The system relies on the synchronization between the Bambu Lab MQTT stream and my custom scale. When the AMS finishes its ‘initial scan’ and pushes the UID/material data via MQTT, my script automatically triggers the scale measurement.

Since I’ve mapped both UIDs of the spool to one database entry beforehand, the identification is 100% reliable. Once the weight has stabilized, the ESP32 handles the conversion into meters and updates the SQL database. The Nextion display then pulls the latest stats, so I always have a real-time visual overview right next to my printer.

It really takes the guesswork out of wondering if there’s enough filament left for a long print!"

My tools: mosqitto broker, MariaDB for SQL Database, Nodered for communication between database, scale and AMS and c++ for programming scale and esp with Nextion-display.

Here is the flow in Nodered for the complete process:

and here a view in my database:

1 Like

Amazing work, great job. I wish I could try out your setup. My two AMS units are in a BaBo Duo pullout stacker ( [BaBo duo] AMS drawer stacker - Free 3D Print Model - MakerWorld ) so I don’t think I can adapter your setup.:+1:

Nice work. I’ve implemented something similar by just reading and storing MQTT print.ams.ams.’number’.tray.’number’.remain along with spool id.

Did you compare the values of your solution with the built in functionality and can tell how much more precise your data is?

1 Like

Hi,

yes I can compare it, because I also store the Bambulab value in my database. For example I have a spool which was used for a small job is regocnized by Bambulab with 100% that means 330m PLA.

The other value is based on the result of the scale is 322m, waht is the truths.

With the scale I also measure the used material of an order. At the end of a job I detuct it from the value in my database, so that I have the actual remaining meters in my database.

It is amaizing how many information you can get from the MQTT.

Regards Jörg

So how does your system recognize during a multi-color print how much material has been used from which of the potentially four spools?
Also would that work with multiple AMS?

Besides - interesting project!
Btw, you could have a rpi evaluating the scale, run Node-Red (single line install and config), MariaDB and the MQTT broker (can be even installed with single-click from NR) on it and therefore reduce the components and complexity used in this project.

"The MQTT payload from the Bambu Lab AMS provides the currently active slot. By monitoring this slot, I can detect whenever a spool change occurs. At that exact moment, the system records the weight difference to calculate the precise material consumption from that specific spool.

The system is designed to handle up to four AMS units per printer, as the payload includes data for all four units (up to 16 slots).

On the infrastructure side, I am using a Proxmox server hosting several dedicated containers (LXC) for an SQL database, an MQTT broker, Node-RED, and other services to ensure a modular and scalable setup.

Regars Joerg

1 Like

Where can I download the files?

Hi,

At the moment, I don’t have anything posted online. Are you interested in the hardware or the software?

1 Like

I was wondering how hard it would be to adapt to the my pull out AMS stacker, so hardware at this point.

Here you can get a feeling about the different components.

Looks like you must have 2 sensor’s per AMS?

yes, one on the left and the other on the right side, they are simply connected together. In the c++ sketch it is the same as you use one.