A project to engage with the bitcoin Lightning Network over RFID/NFC, using an ESP32, RFID-RC522, OLED, Keypad
Parts list
2 possible sources, from: Aliexpress.com (cheaper, but slower) & Amazon.co.uk (faster, more expensive):
-
ESP32 Wireless WiFi Bluetooth Development Board AliExpress / Amazon
-
0.96 inch OLED White Display Module 128X64 SPI 7pin Driver Chip SSD1306 for Arduino Diy Kit AliExpress / Amazon
-
MFRC522 RFID Module for Arduino SPI Writer / Reader AliExpress / Amazon
-
16 key membrane AliExpress / Amazon
Procedure
-
Assemble as per above wiring diagram.
-
Connect ESP32 to PC with USB micro cable.
-
Install RFID library:
Dumpinfo example
-
Check your Arduino IDE is working with your ESP32.
-
Change pin values on lines 39 & 40 from 9 and 10 to 22 and 5
-
Uploade code
-
Open Serial Monitor
-
Tap NFC card upon the reader
Set up Opennode accounts
-
Create an opennode.com account
-
First we generate an API Key for the Customer account:
-
Copy the API Key to your clipboard, then paste into a text editor & remove the hypens
-
Repeat for Merchant account
writedata
-
Copy main.ino code from Ziggy/writedata
-
Paste into new Arduino file & save as NFCwrite
-
Upload to ESP32
-
Open Serial Monitor
-
Place NFC card upon NFC writer
-
Paste into Serial Monitor, followed by a hash symbol # & press enter:
-
The Serial Monitor should now display that the Customer API Key has successfully been written to the NFC Card:
PoS
-
Copy main.ino code from Ziggy/writedata
-
Paste into new Arduino file (& save as NFCPOS)
-
Copy Merchants key into:
string apikey = "MERCHANTS-OPENNODE-INVOICE-API-KEY"
-
Copy apicalls.h code from Ziggy/PoS
-
Paste into text editor and save as apicalls.h in the same directory as NFCPOS
-
Upload the code
-
When completed, the OLED should display "connecting", followed shortly by "connected" and then "Sats:"
-
You can now use the the keypad to enter an amount of sats and press the hash key #
-
The OLED should then display "..." followed by "Tap card" and finally "Paid!"
-
You can now go back to opennode.com to check the transactions (remembering to refresh the page)
If you like this project and might even use or extend it, why not send some tip love! https://paywall.link/to/f4e4e