Bitcoin ATM (coins only) with lightning network support, running offline on an esp32. The lightning network is a 2nd layer protocol on top of the bitcoin protocol enabling trustless transactions with instant settlement and cheap fees.
@21isenough and contributors for the 3d models and inspiration
RPi based Lightning ATM repo
LNBits, Ben Arc and Stepan Snigirev for the cryptograpy used to make this ATM working without internet connection
Fossa ATM repository | LNBits Homepage | uBitcoin library
Axel Hamburch for the very detailed guide in german language on assembly of the electronics
Ereignishorizont Blog
All the parts are available on eBay and Aliexpress
- ESP32 NodeMCU Dev Board | Any "normal" esp32 dev board should do the job here | Example
- DC-DC Adjustable Step-up Boost Power Supply LM2587S 5V -> 12V | for the coin acceptor, runs on 12V Example
- Waveshare 1.54 inch e-Paper Display Modul with SPI Interface | Example
- Programmable Coin Acceptor (HX-616) - 6 Coin | Example
- 10mm Metal Push Button Switch 3-6V with Yellow LED, Self-reset Momentary | Example
- USB Type C socket | to plug in the power supply (i used a Raspberry Pi type C power supply) Example
- Little Mosfet modules ("15A 400W MOS FET Trigger") | To block the coin acceptor at certain points Example
- Orange PLA Filament for the 3D Printer | Example
- Jumper Wires | Example
- Heat-Set Threaded Inserts M3 | Example
All in all would calculate around $100 for the neccessary parts
Begin by connecting the Waveshare display to the ESP32 using the following pin assignments:
Display Pins | ESP32 GPIO |
---|---|
Busy | 27 |
RST | 33 |
DC | 25 |
CS | 26 |
CLK | SCK = 18 |
DIN | MOSI = 23 |
GND | GND |
3.3V | 3.3V |
Ensure to adjust the voltage of the step-up converter before connecting the coin acceptor. Detailed programming instructions are available in the following guides:
- For the Coin <-> Pin 17 connection, use a cable as short as possible.
- Short circuit the two pins below the switch on the coin acceptor with the MOSFET on GND IN and GND OUT.
- Connect the MOSFET GND pin to the ESP32 GND and the PWM pin to the pin specified in
include/lightning_atm.h
.
Periphery Pin | ESP32 GPIO |
---|---|
Coin Acceptor 'Coin Pin' | 17 |
Mosfet PWM Pin | 16 |
Mosfet GND Pin | GND |
Connect the LED Button to the ESP32 according to the pin assignments specified in include/lightning_atm.h
:
Periphery Pin | ESP32 GPIO |
---|---|
Button LED Pin (+) | 21 |
Button LED Pin (-) | GND |
Button PIN 1 | 32 |
Button PIN 2 | GND |
For wiring inspiration and guidance, refer to Lightning ATM Documentation.
Below are two possible wiring options. Depending on which ESP32 type and display / driver board you are using.
- Standard ESP32 with separate display / driver board
- Waveshare ESP32 with integrated driver board and separate display
-
Install VSCode and the PlattformIO IDE Extension.
-
Clone this repository and open it as PlattformIO Project.
-
Create an LNbits wallet. Add the LNURLDevice extension and create a new LNURLDevice instance with ATM.
-
Copy the LNURLDevice Settings String and paste it into the code under “include/lighting_atm.h” under “USER ACTION”.
-
Flash the software on the esp32. You may have to disconnect the ESP32 from the step up converter before connecting it to the computer to prevent faults, or power it up with the power supply and use an usb isolator.
If you need help ask me on Nostr @npub1z9n5ktfjrlpyywds9t7ljekr9cm9jjnzs27h702te5fy8p2c4dgs5zvycf
If this software and guide provided value to you feel free to send some sats to [email protected]