Building a Real-Time Nano Cryptocurrency Transaction Monitor with ESP8266 and WS2812B LEDs

Ever wanted to create a physical notification system for your cryptocurrency transactions? In this project, we’ll build a real-time Nano (XNO) transaction monitor using an ESP8266 microcontroller and addressable RGB LEDs that creates beautiful animations whenever a transaction is received.

What We’re Building

This project creates a standalone device that:

  • Connects to your WiFi network automatically
  • Monitors a specific Nano wallet address for incoming transactions
  • Displays connection status through individual LED indicators
  • Triggers stunning light animations when transactions are detected
  • Includes watchdog functionality for reliable 24/7 operation

Hardware Requirements

Essential Components

  • ESP8266 Development Board (NodeMCU or similar)
  • WS2812B LED Strip (4 LEDs minimum)
  • Jumper wires
  • Breadboard (optional, for prototyping)
  • Power supply (USB cable or external 5V supply)

Wiring Diagram

ESP8266 (NodeMCU)     WS2812B Strip
-----------------     --------------
D3 (GPIO0)       →    Data In (DI)
3.3V/5V          →    VCC (+5V)
GND              →    GND

Note: For longer LED strips or more LEDs, consider using an external 5V power supply to ensure adequate current.

Software Architecture

Core Libraries Used

  • ESP8266WiFi: WiFi connectivity
  • WebSocketsClient: Real-time communication with Nano network
  • ArduinoJson: JSON parsing for transaction data
  • WiFiManager: Easy WiFi configuration via captive portal
  • Adafruit_NeoPixel: WS2812B LED control
  • Ticker: Watchdog timer implementation

Key Features Implementation

1. WiFi Configuration with Captive Portal

void setupWiFi() {
setLed(LED_PORTAL, COLOR_ACTIVE);

WiFiManager wm;
WiFiManagerParameter nano_param("nano", "Nano Address", nanoAddress.c_str(), 65);
wm.addParameter(&nano_param);

if (!wm.autoConnect("NanoMonitor")) {
Serial.println("WiFi connection failed");
setLed(LED_PORTAL, COLOR_ERROR);
delay(3000);
ESP.restart();
}
}

The device creates its own WiFi network called “NanoMonitor” when first powered on, allowing you to configure your home WiFi credentials and enter your Nano wallet address through a web interface.

2. Real-Time Transaction Monitoring

The system connects to the Nano network via WebSocket to bitrequest.app:8010, subscribing to transaction confirmations for your specific wallet address:

void subscribeToTransactions() {
DynamicJsonDocument doc(512);
doc["action"] = "subscribe";
doc["topic"] = "confirmation";

JsonObject options = doc.createNestedObject("options");
options["all_local_accounts"] = true;
options["accounts"][0] = nanoAddress;

String message;
serializeJson(doc, message);
webSocket.sendTXT(message);
}

3. LED Status Indicators

Four LEDs provide clear status information:

  • LED 0: Configuration portal status
  • LED 1: WiFi connection status
  • LED 2: WebSocket connection status
  • LED 3: Subscription confirmation

4. Transaction Animation System

When a transaction is detected, the system triggers a multi-phase animation:

  1. Flash Phase: Rapid white flashes to grab attention
  2. Rotation Phase: Colorful rotating pattern across all LEDs
  3. Pulse Phase: Smooth breathing effect with gradient colors
void animateTransaction() {
// Flash sequence
for(int flash = 0; flash < 3; flash++) {
setAllLeds(strip.Color(255, 255, 255));
delay(50);
turnOffAllLeds();
delay(100);
}

// Rotating colors
for(int cycle = 0; cycle < 8; cycle++) {
for(int pos = 0; pos < LED_COUNT; pos++) {
turnOffAllLeds();
strip.setPixelColor(pos, COLOR_TRANSACTION[cycle % 4]);
// Add adjacent LED dimming for smooth effect
int prevPos = (pos - 1 + LED_COUNT) % LED_COUNT;
strip.setPixelColor(prevPos, dimColor(COLOR_TRANSACTION[cycle % 4], 2));
strip.show();
delay(60);
}
}

// Pulsing finale
// ... (breathing effect implementation)
}

Reliability Features

Watchdog Timer

The system includes a comprehensive watchdog implementation to ensure 24/7 reliability:

void initWatchdog() {
watchdogTicker.attach(1.0, watchdogISR);
updateActivity();
Serial.println("Watchdog initialized (timeout: 5 minutes)");
}
  • 5-minute timeout: Automatically restarts if no activity detected
  • Heartbeat system: Regular ping messages to maintain connection
  • Activity tracking: Monitors WebSocket messages and connection events

Connection Recovery

  • Automatic reconnection to WiFi if connection drops
  • WebSocket reconnection with exponential backoff
  • Visual error indicators for troubleshooting

Step-by-Step Build Instructions

1. Hardware Assembly

  1. Connect the WS2812B data line to pin D3 on your ESP8266
  2. Connect power (3.3V or 5V) and ground
  3. Ensure solid connections to prevent data corruption

2. Software Setup

  1. Install required libraries through Arduino IDE Library Manager:
    • ESP8266WiFi (usually pre-installed)
    • WebSocketsClient by Markus Sattler
    • ArduinoJson by Benoit Blanchon
    • WiFiManager by tzapu
    • Adafruit NeoPixel
  2. Configure Arduino IDE for ESP8266:
    • Add ESP8266 board package: http://arduino.esp8266.com/stable/package_esp8266com_index.json
    • Select your ESP8266 board (e.g., NodeMCU 1.0)

3. Installation and Configuration

  1. Upload the code to your ESP8266
  2. Power on the device
  3. Connect to the “NanoMonitor” WiFi network
  4. Open your browser and navigate to the configuration page
  5. Enter your WiFi credentials and Nano wallet address
  6. Save configuration and wait for connection

4. Testing

  1. Watch the status LEDs progress through connection phases
  2. After successful connection, all status LEDs turn off after 3 seconds
  3. Send a test transaction to your monitored address
  4. Observe the transaction animation

Customization Options

LED Configuration

Modify the LED count and pin assignment:

#define LED_PIN D3
#define LED_COUNT 4 // Change this for more/fewer LEDs

Animation Colors

Customize transaction colors in the COLOR_TRANSACTION array:

uint32_t COLOR_TRANSACTION[] = {
  strip.Color(0, 255, 100),    // Aqua green
  strip.Color(100, 200, 255),  // Light blue
  strip.Color(200, 100, 255),  // Purple
  strip.Color(255, 150, 0)     // Orange
};

Timing Adjustments

  • Watchdog timeout: Modify WATCHDOG_TIMEOUT (default: 5 minutes)
  • Heartbeat interval: Adjust HEARTBEAT_INTERVAL (default: 1 minute)
  • Animation speed: Change delay values in animateTransaction()

Troubleshooting

Common Issues

  1. LEDs not lighting up: Check power supply and data line connections
  2. WiFi connection fails: Ensure correct credentials and signal strength
  3. No transaction detection: Verify Nano address format and network connectivity
  4. Random restarts: May indicate power supply issues or memory problems

Debug Information

Enable Serial Monitor (115200 baud) to view:

  • Connection status messages
  • Transaction detection logs
  • Watchdog warnings
  • Error conditions

Advanced Features to Consider

Possible Enhancements

  • Multiple wallet monitoring: Track several addresses simultaneously
  • Transaction amount thresholds: Different animations for different amounts
  • Historical data display: Show daily transaction counts
  • Web interface: Real-time status dashboard
  • Sound alerts: Add buzzer for audio notifications
  • Battery operation: Solar panel and battery for portable operation

Integration Possibilities

  • Home automation: Trigger smart home actions on transactions
  • Data logging: Store transaction history to SD card
  • MQTT publishing: Integrate with home automation systems
  • Mobile notifications: Push notifications via services like Pushover

Security Considerations

  • The device only monitors public blockchain data
  • No private keys or sensitive information are stored
  • WiFi credentials are stored in ESP8266’s secure flash memory
  • Consider using a dedicated IoT network for additional security

Conclusion

This Nano transaction monitor demonstrates the exciting possibilities when combining cryptocurrency technology with IoT devices. The project showcases real-time blockchain monitoring, responsive LED animations, and robust connection management—all in a compact, easy-to-build package.

The visual feedback creates an engaging way to stay connected with your cryptocurrency activity, while the reliable architecture ensures consistent operation. Whether you’re a crypto enthusiast, maker, or just curious about blockchain technology, this project offers a hands-on way to interact with the Nano network.

Resources


Happy building! Feel free to customize and expand upon this project to suit your specific needs and creative vision.