Lightning Smoke Machine

EzmoEzmo
Dec 8, 2025
Dec 8, 2025

Introduction

Transforms a classic smoke machine into a device payable in Bitcoin via Lightning Network. Each payment automatically triggers a jet of smoke!
  • Level: Intermediate
  • Estimated time: 2-3 hours
  • Use cases: Bitcoin events, artistic performances, Lightning demos, automated stage effects

Prerequisites

Knowledge

  • Basic electronics (wiring, relays)
  • Welding (or use of Dupont connectors)
  • Network configuration (WiFi, WebSocket)

Accounts required

  • BTCPay Server: Functional instance (self-hosted or hosted)
  • Blink Wallet : Account + access API

Access

  • Admin access to BTCPay Server
  • WiFi connection for ESP32

Materials required

Hardware - Electronic components

  • 1 Microcontroller - ESP32-WROOM-32
The ESP32-WROOM-32 is a compact, low-cost WiFi/Bluetooth microcontroller for connecting electronic devices to the Internet and controlling them remotely
  • 1 Relay module - 5V with optocoupler
A relay is like a switch that the ESP32 can operate to turn the smoke machine on or off
  • ~10 Dupont cables - Male/Male and Male/Female
  • 1 Power supply for ESP32 - 5V USB or Li-Po battery
  • 1 micro-USB cable - connection between ESP32 and power supply
  • 1 220V fog machine with 12V battery remote control
  • 1 bottle of liquid compatible with your smoke machine

Hardware - Tools

  • Soldering iron + tin (if soldering)
  • Screwdriver
  • Multimeter (recommended)

Software

System architecture


⚠️ SAFETY WARNING - READ BEFORE CONTINUING ⚠️
This project involves a fog machine connected to a 220V mains supply. Improper operation can result in fatal electrocution or fire.
Non-negotiable rules:
  1. ALWAYS disconnect the smoke machine from the mains before opening the remote control or tampering with the wiring
  2. Remove the battery from the remote control before handling (risk of short-circuit and damage to components)
  3. Check that all your connections are isolated before reconnecting anything
  4. Never reconnect the 220V until the remote control box has been closed and secured
If you're not comfortable with this kind of handling, take someone with you who is.

PART 1: Hardware assembly

Step 1: Preparing the remote control

Objective: Connect the relay to the ON/OFF button on the remote control
  1. Open remote control
    • Identify ON/OFF button
    • Unscrew the case to open the remote control
  2. Locate connections
  • Locate the + and - terminals of the
  • Test continuity with a multimeter (optional)
  1. Button wiring (solder or connectors)
    • Solder a black cable to the - terminal of the button
    • Solder a red cable to the common + terminal

Step 2: Connecting to the relay module

**Reminder: Relay terminology
TerminalDescriptionFunction
NO (Normally Open)Circuit open by defaultCloses when the relay is activated
NC (Normally Closed)Circuit closed by defaultOpens when the relay is activated
COM (Common)Central terminalSwitches between NO and NC
Wiring from remote control to relay module:
  • Black wire from ON/OFF button NO (Normally Open)
  • Red wire (common) COM (Common)
Logic:
When the ESP32 activates the relay, it connects COM and NO, which is exactly the same as pressing the remote control button.
When the ESP32 cuts the relay, COM and NO separate, which is equivalent to releasing the button.

Step 3: Connecting the ESP32 to the relay module

Wiring diagram:
ESP32Relay Module
V5 (5V)VCC
GNDGND
GPIO 21IN (Input)
Verification:
  • VCC and GND well connected (polarity)
  • GPIO 21 used for control signal
  • No visible short circuit
Checkpoint Hardware
Before switching to the software, check :
  • Correctly wired remote control
  • Relay module connected to ESP32
  • No bare wires touching other components
  • 220V always disconnected

PART 2: Software configuration

We'll use Blink as an example, but BTCPay Server also offers Strike, Breez and Boltz if you prefer another option.

Step 1: Plugins, Installation BitcoinSwitch + *Blink

1 - Go to your BTCPay Server instance with an admin account
2 - Create your first blind
3 - On the left-hand side of BTCPay Server, scroll to the bottom and go to "Manage Plugins "
4 - We're going to install the BitcoinSwitch plugins as well as Blink
5 - Scroll down the list of plugins and click on "Install " : BitcoinSwitch and Blink (or the available wallet of your choice)
6 - Once the installation is complete, restart BTCPay Server and wait 1 minute for the instance to restart
7 - When you return to "Manage plugins ", check that both plugins have been installed

Step 2: Backend : BTCPay Server + Blink configuration

1 - Create a wallet Blink
2 - Generate a API key Blink
  • Once connected, go to the API Keys tab
  • Click on " + " in the top right-hand corner to access your API Key configuration
  • Give your API Key a name and leave the default settings. Then, in the third step, make a note of your API Key - you'll only see it once: blink_mZ5KxxxxxxxxxxxxxNbmX
  • Once created, it should appear in your active API Key list.
3 - Connect Blink to BTCPay Server
  • Open your BTCPay Server
  • Navigate to : Wallet Lightning
  • Click on Use a custom node
  • Paste the following connection string:
type=blink;server=https://api.blink.sv/graphql;api-key=blink_mZ5KxxxxxxxxNbmX;wallet-id=0a3fc465-082xxxxxxxxxx-2545595d856f
⚠️ Important :
  • Do not modify the first part: type=blink;server=https://api.blink.sv/graphql;
  • Replace only :
    • api-key= by your API Blink key
    • wallet-id= by your wallet Blink ID
  • Then click on Test connection, then Save
  • Check that the connection is established (green status)
4 - Create a Point of Sale (PoS)
  • In BTCPay Server, go to the Plugins tab and click on Point of sale
  • Give your PoS a name and click on Create
  • PoS configuration :
    • Choose a point of sale style = Print display
    • Currency = SATS
    • Click on SAVE
  • Product configuration :
    • Delete all default products
    • Then click on add item
  • Configure the product:
    • Title : smoke-machine
    • Price : 10 sats
    • Bitcoin GPIO switch : 21
    • Bitcoin switch duration (in milliseconds) : 5000
    • Click on Close and then Save to save the new product

Step 3: Firmware: Flashing the ESP32

**1 - Go to flash site
2 - Flash the BitcoinSwitch firmware
  • Connect the ESP32 to your computer with your USB/Micro-USB cable
  • Then click on Connect to Device
  • A window opens, select the USB port on your ESP32, then click on Connect
  • Once your ESP32 is connected, we'll flash the BitcoinSwitch firmware. In the T-Display section, click on Upload Firmware for the latest version available (currently: bitcoinSwitch T-Display v1.0.1)
  • Wait for the upload, the process is complete when the logs show "Leaving... "
  • Unplug the ESP32
**3 - Check BitcoinSwitch firmware installation
  • Reload page: https://bitcoinswitch.lnbits.com/
  • Reconnect the ESP32 to your computer with your USB/Micro-USB cable
  • Then click on *Connect to device
  • Select the USB port on your ESP32, then click on Connect as described above
  • Once connected, press the RESET button on the ESP32
  • Check in the logs that the last lines show :
Welcome to BitcoinSwitch! (v1.0.1) Config file does not exist. Entering config mode. until we receive /config-done.
(This is normal, it means that there is no config yet, but that the firmware has been installed)
4 - Generate WebSocket LNURL URL
Expected final format :
https://XXXXv/apps/46XXXXXXXXXXXXXXXXXXXXwFB/pos
Generation steps :
  • Open yourBTCPay Server instance, then go to the PoS we created later.
  • Then click on "View" to open your PoS in the browser
  • Copy the URL of the page, for example :
Let's unpack this URL:
https://XXXXv/apps/46XXXXXXXXXXXXXXXXXXXXwFB/pos
  • XXXXv → the domain of your BTCPay Server instance
  • 46XXXXXXXXXXXXXXXXXXXXwFB → your PoS unique identifier
  • /pos → indicates a Point of Sale
Transform it:
  • Replace https:// with wss://
  • Add /bitcoinswitch at the end
Result:
wss://XXXXv/apps/46XXXXXXXXXXXXXXXXXXXXwFB/pos/bitcoinswitch
Keep this URL for future configuration, as it will enable your ESP32 to communicate in real time with BTCPay Server. The WebSocket protocol (wss://) establishes a permanent connection between the two: as soon as a Lightning payment is confirmed on your PoS, BTCPay instantly sends the information to the ESP32, which can then trigger your smoke machine.
**5 - Configuring WiFi and WebSocket
Inform :
  • WiFi SSID: the name of your WiFi network
  • WiFi Password: your WiFi password
  • In the LNbits Device URL section, paste the WebSocket URL created in the previous step
  • Click on Upload config
  • Wait for the upload to complete; the logs should display the parameters you've just entered (SSID, password and WebSocket URL)
  • Wait while ESP32 establishes the WebSocket connection. You should see :
WiFi connection established! [WebSocket] Connected to url: ...
  • You can now disconnect the ESP32

Checkpoint Software

Before the final test, check :
  • Blink connected to BTCPay
  • PoS created with at least 1 item
  • ESP32 flashed with BitcoinSwitch
  • WiFi configured on ESP32
  • WebSocket URL correct
  • Error-free ESP32 logs

Testing and debugging

Complete final test

  1. Plug in the smoke machine (220V) and switch it on
  2. Power the ESP32 (battery or USB)
  3. Open your BTCPay PoS in your browser
  4. Scan "smoke-machine" item
  5. Pay with a wallet Lightning (Blink or other wallet)
  6. Observe:
  • Relay clicks (audible sound and relay LED lights up)
  • The smoke machine is activated
  • Smoke generated!

Fairness problems and solutions

ProblemProbable CauseSolution
ESP32 does not connectMissing USB driverInstall CH340 drivers
Relay does not clickWrong GPIO wiringCheck GPIO 21 → IN
Smoke machine does not respondRemote control improperly wiredCheck NO/NC/COM
WebSocket timeoutIncorrect URLCheck wss:// and /bitcoinswitch
WiFi does not connectSSID/Password incorrectRe-flash WiFi config
Payment received but nothing happensESP32 not connected to WebSocketCheck RESET logs

Resources

Useful links

Community & Support

Source code


Stack sats, make smoke, have fun, stay humble!
Did this work well for you?
0
0

Author

This tutorial has been written by Ezmo

You can say thanks by tipping the professor.

EzmoEzmo
1Tutorials

Trained as an interior designer and architect, I wanted to link my space projects to my passion for technology and Bitcoin. By hacking objects and connecting them to second layer solutions, I discovered a simple and fun way to popularize Bitcoin through interactive experiences. Today, I'm sharing this approach to help everyone understand, experiment and build their own interactive projects.

lightninghardwareproof-of-work

Credits

This tutorial has not been proofread yet

0/3Proofreading status

The original content has been translated by AI, but human review is necessary to ensure its accuracy.

Progress: 0/32 830 sats1 415 sats708 sats
*Rewards may vary based on the $ exchange rate

Every content on the platform is the result of a collaborative effort: each lesson, translation, and revision is made possible by the work of contributors. For this reason, we are always looking for proofreaders who can review our content in many languages. If you want to participate in the proofreading process, please reach out in our Telegram group and read our tutorial. We remind you that this content is open-source - licensed under CC BY-SA - so it can be freely shared and used, as long as the original source is credited.