Coder Social home page Coder Social logo

f321x / offline-lightningatm-esp32 Goto Github PK

View Code? Open in Web Editor NEW
8.0 3.0 3.0 26.1 MB

Offline, esp32 based Bitcoin ATM (coins only) with lightning network support.

License: MIT License

C 55.40% C++ 40.27% Python 2.41% Dockerfile 1.92%
3d-printing arduino atm bitcoin coin-acceptor eink esp32 lightning satoshi

offline-lightningatm-esp32's Introduction

offline-LightningATM-esp32

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.

Special thanks to

@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

Used parts

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

Assembly Instructions for Lightning ATM

1. Connecting the Waveshare 1.54 inch Display to the ESP32

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

2. Programming the Coin Acceptor

Ensure to adjust the voltage of the step-up converter before connecting the coin acceptor. Detailed programming instructions are available in the following guides:

3. Connecting the Coin Acceptor to the ESP32

  • 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

4. Connecting the LED Button

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.

5. Circuit Diagram

Below are two possible wiring options. Depending on which ESP32 type and display / driver board you are using.

  1. Standard ESP32 with separate display / driver board

Wiring - Circuit Diagram Normal ESP32

  1. Waveshare ESP32 with integrated driver board and separate display

Wiring - Circuit Diagram Waveshare ESP32

Setup software

  1. Install VSCode and the PlattformIO IDE Extension.

  2. Clone this repository and open it as PlattformIO Project.

  3. Create an LNbits wallet. Add the LNURLDevice extension and create a new LNURLDevice instance with ATM.

    wallet_settings_02_thumb

  4. Copy the LNURLDevice Settings String and paste it into the code under “include/lighting_atm.h” under “USER ACTION”.

    wallet_settings_02_thumb

  5. 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]

Images

Standard ESP32 PXL_20231126_144603980 PXL_20231126_162906807 MP_1

Waveshare ESP32 Construction - Waveshare ESP32 Construction - Waveshare ESP32 Construction - Waveshare ESP32 Construction - Waveshare ESP32 Construction - Waveshare ESP32

offline-lightningatm-esp32's People

Contributors

axelhamburch avatar f321x avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.