IDK NFC badge

The IDK NFC badge is a customizable electronic badge built around an ESP32-C3 microcontroller and an ST25DV NFC chip. It allows you to easily share your online presence through NFC, with the added flair of LED animations when your tag is scanned.

IDK NFC Badge PCB Design

Features

  • Multi-URL Support: Cycle through 4 different programmable URLs
  • Visual Feedback: 2 RGB LEDs with rainbow animations when your tag is scanned
  • Interactive Buttons: Physical buttons to cycle URLs and control lighting
  • ESP32-C3 Based: Low-power microcontroller with built-in Wi-Fi (though not used in this design)
  • Rechargeable: Powered by a small LiPo battery (not shown in schematics)

Hardware Design

IDK NFC Badge Schematic

The schematic shows the core components:

  • ESP32-C3 microcontroller at the heart of the design
  • ST25DV NFC chip for contactless communication
  • SK6812-SIDE-4020 addressable RGB LEDs for visual feedback
  • Regular red LEDs for NFC field indication
  • Two tactile buttons for interaction

IDK NFC Badge PCB Design

The PCB layout is compact and designed to be worn as a badge, with:

  • An NFC antenna loop on the front
  • Strategically placed LEDs for maximum visibility
  • Conveniently positioned buttons

How It Works

The badge operates as a dynamic NFC tag that can store and cycle through multiple URLs. When someone scans your badge with their phone, they’re directed to one of your predetermined websites.

URL Cycling

The current implementation supports 4 hardcoded URLs:

const char* url_list[] = {
  "idk.bz",
  "lonelyhackers.club",
  "p0ns.org",
  "www.youtube.com/watch?v=XfELJU1mRMg"
};

Each URL is prefixed with “https://” automatically when written to the NFC chip.

Interaction Methods

There are three ways to cycle through the URLs:

  1. Button Press: Pressing the main button cycles to the next URL
  2. NFC Scan: When someone scans your badge, it automatically cycles to the next URL for the next scan
  3. Power Cycle: The last selected URL is saved in non-volatile memory and restored on power-up

LED Animations

The badge features rainbow animations on its dual RGB LEDs that serve several purposes:

  1. Tag Scanned Indication: A brief (2.5 second) rainbow animation plays when someone scans your badge
  2. Permanent Light Mode: A second button toggles whether the LEDs stay on continuously with the rainbow effect
  3. Visual Appeal: Let’s be honest, blinky lights make any badge cooler!

The LED animation uses FastLED’s pride effect, creating a smooth rainbow pattern across both LEDs.

Under The Hood

The code uses several Arduino libraries:

  • Wire.h for I2C communication with the NFC chip
  • ST25DVSensor.h for interfacing with the ST25DV NFC tag
  • Preferences.h for storing settings in non-volatile memory
  • FastLED.h for controlling the SK6812-SIDE-4020 LEDs

NFC Communication

The badge uses the ST25DV NFC chip, which is configured to trigger an interrupt (via the GPO pin) whenever the tag is read. This allows the ESP32 to detect scans without consuming power polling the NFC chip.

// Interrupt callback for GPO pin (triggered when tag is read)
void IRAM_ATTR GPOEvent_cb() {
  tagRead = true;
}

State Management

The code implements simple state machines for both buttons to properly detect press and release actions. It also includes debounce protection for NFC tag reads to prevent multiple triggers from a single scan.

Non-blocking Operations

The LED animations are implemented in a non-blocking way, allowing the badge to remain responsive to button presses and NFC scans while the animations are running.

Build Your Own

All the source code and design files for this project are available on GitLab at https://gitlab.com/idkidkidk/idk-nfc-esp32-c3. Feel free to fork the project and make your own modifications!

You might have received a non fully assembled badge, which is perfectly fine! The board is designed to be modular and can function in different configurations:

  • NFC Detector Mode: With just the LEDs populated, the board can function as an NFC field detector. When an NFC field is present, the regular red LED will light up, indicating the presence of an NFC reader nearby.

  • NFC Tag Mode: With only the ST25DV chip populated, the board works as a passive NFC tag, allowing your URLs to be read by NFC-enabled devices, even without the ESP32-C3 or other components.

  • Full Functionality: For the complete experience with URL cycling and LED animations, you’ll need all components assembled.

While complete build instructions aren’t included here, the provided schematic and board files give you the foundation to create your own version. The main components you’ll need are:

  • ESP32-C3-SuperMini board (can be found on AliExpress or similar sites)
  • ST25DV NFC chip (and associated passive components)
  • SK6812-SIDE-4020 addressable RGB LEDs
  • Regular red LED for NFC field indication
  • Tactile buttons
  • Small LiPo battery, PH2.0 connector and charging circuit (if you want to make it rechargeable)

With these parts and the provided source code, you can create your own customizable NFC badge with flashy LED animations!

Customization Ideas

  • Add more URLs to the rotation
  • Implement different LED patterns for different URLs
  • Add a web interface to change URLs via Wi-Fi
  • Integrate with other badge hardware at events

The IDK NFC badge represents the intersection of functional technology and playful design - perfect for tech conferences, hackathons, or just showing off your maker skills in everyday life.