Bitcorn Hole is a physical hardware game where players earn bitcoin every time they score a point! Bean bags are tossed into the cornhole set and detected using microcontrollers with time-of-flight sensors or load cells(a scale). Each point scored triggers an instant payment of sats to the player’s Lightning Address! ⚡
See how the game works in action here and here.
To build your own Bitcorn Hole setup, you’ll need the following:
Set with a ToF sensor:
- Cornhole set — comes with two boards
- 2x Wifi-enabled microcontrollers — I used the Arduino Uno R4, but you could refactor the code to work with ESP32
- 2x Time-of-flight (ToF) sensors
- Jumper wires and USB-C cables
- Battery packs or AC adapters
- DIY enclosures — These are placed under each cornhole board to house the sensors and detect bean bags
- A computer with a screen and speakers to run the game
Massive thanks to Dani Go for her soldering help!
Set with scales, or load cell sensor:
- Cornhole set — comes with two boards
- 2x Wifi-enabled microcontrollers — I used the ESP32 38PINS Board with an expansion board.
- 2x Load cells sensors, kit with HX711 module and disk suport, 10kg. Or 2x Kitchen Scales (sensor 5-10kg, you could use the plastic structure) with 2x HX711 Modules
- Jumper wires (buy some female-female and female-male) and USB-C cables
- Battery packs or AC adapters
- DIY enclosures — These are placed under each cornhole board to house the sensors and detect bean bags
- A computer with a screen and speakers to run the game
Optional, but a great addition - LED Bars to display the points in front of the set:
- 10 LEDs per set - Individually Addressable LED strip - WS2812b 5v 30/m - 3 wires - 5v, Data and GND
- LED bar Aluminum Channels - 50 or 30cm V Style
- Old usb cables to connect the LED bar to the microcontroller.
There are three main code files in this repository:
-
Frontend Webpage: This displays the game interface and real-time scoring updates.
Frontend Code - Coming Soon | View Screenshot -
Microcontroller Code: This code runs on each microcontroller, hosting a web server and interfacing with the sensors to detect when a bean bag is present.
View ToF Microcontroller Code - Arduino IDE To build a set with scales to detect more than one bag, without have to collect them each time one scores. You must install VSCode and at VSCode extensions (Ctrl+Shift+X), you must install PlatformIO IDE. Clone this repo, and configure the lines below in platformio.ini file to match your configurations: build_flags = -DESP32_DEV=1 ; To use a ESP32 board -DLOADCELLS=1 ; Uses a weigth scale -DBAGWEIGHT=200 ; bag weight in grams -DTOLERANCE=25 ; weight tolerance in grams -DLED_SCORE_BAR=19 ; GPIO pin for LED score bar Comment this line with a ; if you do not have a LED Bar -DLED_SIZE=10 ; number of LEDs in the score bar -DTEAM_COLOR=1 ; 1 = Red 0 = Blue - You must change this and compile to install the different player version in the microcontrollers -
API to Pay Sats: This handles the instant payments to players' Lightning Addresses. You can substitute your own API endpoint, and either run your own LND node or use a custodial API like ZBD.
API Code - Coming Soon
- For detailed gameplay instructions, view the instruction sheet.
- For help with getting a Lightning Address, check out this quick guide.
Did you bring Bitcorn Hole to your conference, community, or event? Brag about it here!
This is experimental software. Use at your own risk. 🌽
