Build guide · zmod_nfc · esp32_rfidnfc2usb_bridge
A USB NFC filament reader for Zmod
Plug an NFC reader into your AD5X or Creator 5, tap a spool, and pick the slot on the printer's screen. With Spoolman, the slot gets the actual spool too.
How it works
zmod_nfc is a plugin for Zmod, the community firmware mod for Flashforge printers. It watches for a USB NFC reader. When you hold a tagged spool to it:
- The plugin reads and decodes the tag: Bambu Lab, Creality, Snapmaker, Qidi, Anycubic, Elegoo, OpenSpool, OpenTag3D, TigerTag, OpenPrintTag and more.
- If you use Spoolman, it looks the spool up (by the spool ID on the tag, or the tag's UID) and can add new spools for you.
- A prompt appears in Mainsail, Fluidd or HelixScreen with one button per IFS slot (or
T0–T3on the Creator 5). Tap a slot, or just insert the filament into an empty one. - The slot gets the material and colour, and Zmod's own colour popup is skipped.
No reader at all? zmod_nfc can also read Spoolman QR labels through the printer's own camera.
Picking a reader
The printer needs a reader on USB. There are three routes:
- A standalone USB PN532 reader. The easiest option: plug it into the printer and you're done. No ESP32 and no wiring.
- An off-the-shelf PC/SC reader like the ACS ACR122U (tested) or ACR1552U. Also plug-and-go.
- A cheap PN532, RC522 or PN5180 module on an ESP32, running my esp32_rfidnfc2usb_bridge firmware. That's what the rest of this guide builds. It's the route to take if you already have modules on hand, or want an RC522 or PN5180.
The bridge makes whatever reader chip you wire up look like a PN532 on a USB serial port. zmod_nfc finds it automatically, with no settings to change. An ESP32-C3 shows up as a standard USB serial device, which the AD5X and Creator 5 kernels already support, so no driver is needed.
Parts for the bridge
For OpenPrintTag (ISO 15693) tags you'll eventually want a PN5180, but zmod_nfc doesn't use the bridge's ISO 15693 commands yet. Today, the Wi-Fi reader with a PN5180 or an ACR1552U is the way to read OpenPrintTag.
Build the bridge
Wire a PN532 to an ESP32-C3 over I2C (PN532 switch 1 ON, switch 2 OFF):
PN532 ESP32-C3
VCC ──────── 3V3
GND ──────── GND
SDA ──────── GPIO 6
SCL ──────── GPIO 7
Then flash it with PlatformIO:
pio run -e esp32-c3 -t upload # or esp32-s3, esp32-s2, esp32-c6, esp32dev
The bridge's default chip: auto finds whichever reader is wired, because the I2C, UART and SPI pins don't overlap. Pins for the S2, S3, C6 and classic ESP32, plus RC522 and PN5180 wiring, are in the bridge README.
Power: the RC522 is 3.3 V only, so never feed it 5 V. The PN5180 needs both 5 V (for its RF stage) and 3.3 V (for logic).
Install zmod_nfc
- Add the section from
zmod_nfc.moonraker.conf.exampletomod_data/user.moonraker.confand restart Moonraker. Moonraker's update manager now keeps the plugin up to date. - Run this from the printer's console:
ENABLE_PLUGIN name=zmod_nfc
Zmod downloads the plugin, installs it and restarts Klipper. The defaults work as they are. Plug in the reader or the bridge and tap a tag.
Status
Tested end to end on an AD5X and a Creator 5 with an ACR122U, with a PN532 on the Creator 5, and with a PN532 on an ESP32-C3 bridge on the AD5X. On a PC, the bridge read an NTAG216 and zmod_nfc decoded its OpenSpool record. The RC522 and PN5180 through the bridge, and the ACR1552U, haven't been run on hardware yet. Reports are very welcome on GitHub.