Juice dispenser. We thought that bringing another dApp would be boring, and decided to make something fun with the Raspberry Pi. That turns out as a dispenser for various fluids, designed for parties, conferences, and venues, where the participants can pay directly, using crypto. Isn't that fun?
What it does
Quite self-descriptive, it's just fill your glass with juice... Yes, you have to pay, but you can do it with crypto using AlephZero or Mantle network. To pay you can use your phone and scan the QR code, which will redirect you to our website where you will get a picture on the top drinkers' leaderboard. When the transaction is submitted our dispenser will fill your glass.
How we built it
We combined software, with hardware.
The software part was built using React, and Kotlin in the server part. We also implemented smart contracts in ink! for Aleph Zero blockchain and Solidity for Mantle. The contracts are “vaults” for funds paid for the drinks. The user interacts with one of the supported network wallets, either substrate like SubWallet, or Metamask, then hits the “Order drink” button, and that triggers the transaction. When the user clicks the button, we're doing a screenshot, which is later used on the order book, where all the drink requests are shown. We've also implemented the leaderboard, where we sum up the count of drinks per participant. We also resolve the addresses using azero.id, to show the real identity behind random letters/numbers:)
The hardware part was built using the Raspberry Pi, flow meter, liquid pump, and proximity sensor. On the Raspberry Pi, we run a backend server that is listening to events from the chains [Aleph Zero and Mantle]. When the events occur, the Python script is run, which handles the hardware part of pouring a drink. Using a proximity sensor, we require that the glass has to be in place before we let the liquid go. We pour the liquid until it reaches a certain level.
Challenges we ran into
Cables. Plenty of cables. Closed electronics shops (lack of one-way valve), and actually mostly electronic stuff. We had some problems running Raspberry Pi through Wi-Fi.
On the code side, somehow difficult were to distinguish connected wallets, and combine both solutions in one application.
Accomplishments that we're proud of
We were able to connect hardware with blockchain and interact between them. We prepared CAD model of our case that is ready to print on 3d printer.
What we learned
A lot of hardware stuff. For example how to use external relay to control liquid pump power supply, or how to use sensors data in raspberry pi.
Build on Mantle (Pool bounty)
- Integration of AZERO.ID Azero.ID Is useful for displaying user data on the leaderboard. Using their wallet public address looks worse.
- Hardware/Office/Fun - Create a Fun Project Solving a Real-World Problem
- Hardware/Office Bounty
What's next for TCP?
Conferences and parties. We want to serve as many drinks as we can and create Proof Of Drink and combine it with our leaderboard.
- Aleph Zero: 5GDu9hdL8UyCELNa3vKSZSyFyS5cjUNkvK8Zy9wRRZUJEbHR
- Mantle: 0x9417b2a92979C2aD4d5Ee074bd1217f6b6D6E330
Frontend link: https://tcp-tan.vercel.app/
- EVM: 0x9D80552B2B29353DBd63dda91a86aB01347D840E
- AlephZero: 5CD6Bb2R6vgqCL8nKLBN3q9VGSgTPuqNiR8ryLCUcD7qF8ko