Robonomics Coffee


"Robonomics coffee" - is a smart coffee machine integrated in Robonomics Network. This project aims to show Robonomics potential in the IoT sphere by a real-world example.

How to make coffee?

In order to have a cup of delicious coffee, a customer should send some funds (1 Statemine's token ACT, id=3077) to the address of a coffee machine in Statemine parachain. After that the pouring process is started and action log is published in the Robonomics Parachain portal via Datalog function.

NOTE!You may use any token on Statemine, more on that here

How it works?

There is a single-board computer attached to the body of the coffee machine. This computer is the center of the entire system, where all the processes are happening. The single-board (Raspberry Pi 4) is connected to the control panel of the coffee machine via jumper breadboard wires and GPIO interface. RPI is also the one interacting with Robonomics and Statemine parachains. Sample flowchart of the workflow is presented below.



Used hardware

  • Coffee machine
    The very important criteria for a coffee machine was the ability to solder some wires to the control panel since GPIO was selected as a communication interface being the easiest one to implement. Several options were considered (Saeco PicoBaristo HD 8925, De'Longhi ESAM3200.S). As may be seen, no touchscreen and no bells and whistles, just buttons and espresso. Finally, De’Longhi Magnifica ECAM 22.110 was chosen as it is cheap and has an easy-removed front panel.
  • Single-board Raspberry Pi 4B (2 GB) with Ubuntu server installed via RPi Imager.
  • 5V adapter and USB A to USB type C cable (this and this are examples)
  • A set of F-M, M-M, F-F jumper wires, a breadboard (again, this is just an example).
  • Transistor and a resistor(optionally). More on that later.


  • A set of screwdrivers.
  • Soldering iron with some solder and resin.
  • Multimeter.

Hardware installation

1. Disassembly the coffee machine.

There is a sample tutorial on YouTube. Your goal is to remove the front panel (it won't be used anymore, so this is a thing to improve to hide all the wires) and detach the control PCB.

Detached PCB

2. Solder two wires to the button you need.

Solder them to the isolated contacts (in our case - two bottom contacts). You can use any wires, but keep im mind that in the end there should be an M-wire to put it into the breadboard.

Soldered Wires

3. Assemble the entire coffee machine back leaving the front panel removed.

Coffee machine Overview

4. Circuit

Overall circuit is presented below, this is a very simple transistor switch, we used R1=1kΩ, a npn transistor Q1 (hfe=40, Uce>5V, Ic>0.015A, sample here, but almost any general transistor suites, since this is a switch) and a small 3.3V diode D in base circuit found in the storage of our lab:) One can use a MOSFET transistor as well.


Circuit Assembled

5. Connect coffee machine and RPI

Connect wires marked as RPI GND and RPI GPIO Pin to pins GND and 21 respectively. RPI GPIO scheme is presented below. Wires marked as Button+ and Button- should be connected to the left button contact and right button contact respectively.


Software installation

Time to turn the Raspberry Pi into blockchain-powered coffee maker!

Option 1: Using Robonomics Parachain in Kusama Network

  • Prepare the RPI for Substrate libs (source):
curl --proto '=https' --tlsv1.2 -sSf | sh
rustup default nightly
  • Install gpiozero library (source) and reboot:
sudo apt update
sudo apt install python3-gpiozero
sudo pip3 install gpiozero
sudo reboot
  • Clone the repository
git clone
  • Install project requirements
pip3 install -r requirements.txt

Option 2: Using Everscale Network.

  • Install gpiozero library (source) and reboot:
sudo apt update
sudo apt install python3-gpiozero
sudo pip3 install gpiozero
sudo reboot
  • Clone the repository
git clone
cd robonomics-coffee-maker
  • Install Node.js requirements
npm install @eversdk/core
npm install python-shell
mv eversdk.node ~/.tonlabs/binaries/1
git clone
cd ever-sdk-js/packages/lib-node
npm install -g

The reason why we can't just npm install @eversdk/lib-node is because this library is not compiled for the ARM architecture.

Account management

Option 1: Using Robonomics Parachain in Kusama Network

On your PC install Polkadot Extension and register a coffee machine account there. Save mnemonic seed phrase as it is going to be used later.

Coffee machine Account

Logging actions in Robonomics is optional, you will need XRT on Robonomics Parachain portal for coffee machine account (it is the same across networks) for this. If not, there will simply be an error message "Balance too low."

Option 2: Using Everscale Network.

Create an account in the Everscale with, for example mobile app. Save seed and activate a coffee-machine address there. Insert this address in main.js

Run Robonomics coffee

Option 1: Using Robonomics Parachain in Kusama Network

Run this in corresponding network repo folder:

python3 <previously saved seed in quotes>

You should see the program waiting for ACT incomes:

Waiting for ACT

You can send tokens from another account created the same way via assets:transferextrinsic on Statemine.

As soon as there is an income (positive change in assets:accountstorage function for address derived from seed and for token id 3077) the RPI triggers GPIO pin 18 and coffee machine starts making coffee and records a datalog!

Making coffee

Recorded Datalog

Option 2: Using Everscale Network.

Run poller by

node main.js

Then send 0.5 EVR to the address specified in the main.js file. Everscale use case does not imply Datalog recording.

Things to point out

  • This is a POC of a blockchain-driven IoT device, it has things to improve, wires to hide and functionality to implement.
  • Token ID, the one, coffee machine is waiting to receive, is set here, so you can use your own token, existing one or newly created. To create one, go to Statemine Kusama parachain page, Network -> Assets -> Create. Set an ID there, complete the procedure and paste ID in the code.

Creating Any Token for Paying

  • Right now the only thing that matters for income tracker is the positive difference between current and previous asset balance. This may be filtered code.
  • One may use QR-code for mobile apps for convenient transfers.


previous ← Run Gaka-Chu - a Robot-Artist next Try It Out →