Skip to content
This is how we implemented our Lightning powered beer tap
Java Python Shell Groovy
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
dashboard
gpio_handler Only set up pin that we are really going to use Aug 13, 2019
graphics Rename ln-self-order-pos to Zeus, fix some spelling errors Mar 29, 2019
schematic
websocket_bridge
.gitignore Updates gitignore Oct 28, 2018
LICENSE
README.md Rename ln-self-order-pos to Zeus, fix some spelling errors Mar 29, 2019
application.sh
configuration.sh

README.md

Lightning powered beer tap

This project consists of multiple parts. To make things easier the application.sh provides a frontend to control everything. The different parts of the project are documented below.

Architecture

The following diagram provides a general overview on how all the components work together

Architecture

  1. Basic Setup is done by running the application.sh shell script. (start Chromium in Kiosk mode, displays the Zeus self-service web application in the browser, starts the WebSocket Bridge
  2. User scans and pays invoice
  3. Zeus gets notified that payment was successful
  4. Zeus sends a stomp event to the websocket
  5. WebSocket bridge runs the GPIO Handler with parameters about the product eg. small|large beer
  6. GPIO Handler switches the relay for a certain amount of time (small beer 5 seconds, large beer 7 seconds) Important: enjoy your beer, lightning pioneer!

The Zeus Application as well as lnd and bitcoind are not part of this project. Details about those can be found under https://github.com/puzzle/zeus

Impressions

the final Lightning powered beer tap looks like this:

Architecture

Architecture

Architecture

Beer Tap in Action Video

Check out this video if you want to see the tap in action.

Parts list

To build your own lightning powered beer tap you'll need the follwing parts. We got most of our parts from distributors located in switzerland, but you can get them anywhere you want.

Part name Part number Price / CHF Distributor
Raspberry Pi 3 B+ 10760 39 pi-shop.ch
32GB MicroSD Card 6613018 29.9 digitec.ch
Original Rpi 7" Touchscreen 10266 79.9 pi-shop.ch
PiggiPi 7’’ Display Mount 10399 48.9 pi-shop.ch
Raspberry Pi Relay Board 10398 24.9 pi-shop.ch
24V AC Source (24W/50Hz) 169-84-752 22.7 distrelec.ch
Beer tap with solenoid valve 08.00125 247.3 schankanlagenhandel.eu
Bent faucet for beer tap 08.00128 22.51 schankanlagenhandel.eu

Installation

This is straightforward. If you bought an empty micro-sd card, just download the latest Raspbian image.

  • Fire up dd to load the image to your card.
  • Use sudo raspi-config to extend your partitions, start openssh and enable the gpios.
  • Follow the guide on how to secure you raspberry pi
  • Once you've deployed your ssh key and secured your access, clone this repo.
  • Install the necessary software to your pi by executing the following commands:
sudo apt-get update
sudo apt-get install -y  openjdk-8-jre openjdk-8-jdk unclutter vim
  • Add your user to the group gpio
  • You're all set and ready to go
  • Clone the repository on your Raspberry Pi

application.sh start script

This script is used to start, stop or rebuild the application. Simple as that. The websocket bridge will be automatically built if you run start without a previous build.

You might need to change the URL of your running ln-self-order-pos in the application.sh and dashboard dashboard/dashboard.sh files

$ ./application.sh start # starts the dashboard and websocket bridge
$ ./application.sh stop  # stops everything
$ ./application.sh build # rebuilds the java websocket bridge

WebSocket Bridge

README

GPIO handler

To execute this python module the user has to be part of the group gpio.

Dependencies

  • RPi-GPIO (pre-installed on all raspberry pi distributions)
  • argparse

how to run

$ python gpio_handler.py --product=[large,small] [--test, --memo="asdf"]
$ python gpio_handler.py --help
You can’t perform that action at this time.