Adam Gajewski 2025-07-03

How we brought the coffee counter to life, i.e. "pet project"

How we brought the coffee counter to life, i.e.

How we brought the coffee counter to life, or the story of one "pet project"

Coffee. An unofficial but absolutely crucial pillar of any tech company. It is a sacred ritual, the fuel for creativity, and the sung hero of thousands of lines of code. In our company, we treat it with due respect. That's why we decided to treat our coffee machine as a critical element of infrastructure and connect it to the monitoring system - specifically, to our website.

Here's a technical, but also slightly humorous, case study about how curiosity, engineering ingenuity and a few smart tools allowed us to implement a project that solves one of the most important business problems: the lack of real-time coffee consumption data.

Problem: Inaccurate data and static KPI

Our website has long had a widget with key indicators: completed projects, years of experience, team size. There was also a “Coffee Drank” indicator. Unfortunately, it suffered from a fundamental flaw - it was a "hard" HTML entry, updated sporadically and based on highly inaccurate estimates. As a data-driven company, we could no longer tolerate this situation.

Coffee counter straight from our website

The goal was clear: we needed an automated, reliable data source that would provide up-to-date information on the status of our most important strategic reserve.

Discovery: Express has an undocumented (for us) API

The audit of our main coffee asset brought a breakthrough. It turned out that the coffee machine is factory-prepared for expansion with a Bluetooth communication module. It was used to connect to a standard mobile application that… showed statistics. BINGO!

The existence of an application meant the existence of a communication protocol. But instead of performing a costly and time-consuming reverse engineering process, we harnessed the power of global collaboration. Quick research on GitHub revealed a repository where another coffee and technology enthusiast had already figured out the BLE (Bluetooth Low Energy) protocol and shared it with the world. We had the technical documentation ready.

The bluetooth module that opened the gate to the coffee counter on the website

Solution architecture: From hardware to the cloud

Once we had a protocol, we needed a physical bridge that would connect the world of the express with the world of the Internet. This is where our “field agent” came into play.

Bridge between worlds: Espressif ESP32 microcontroller

It has become the heart of the operation on the hardware side Espressif ESP32 – an extremely popular and versatile microcontroller in the world of IoT (Internet of Things). It was the perfect choice for us for two reasons:

  • It has a built-in module Bluetooth Low Energy (BLE), necessary for communication with the coffee machine.
  • It has a built-in module WiFi, allowing you to send data to any server on the Internet.

The ESP32 microcontroller through which we connected to the n8n

We uploaded dedicated code to ESP32 whose task was to perform a simple but crucial loop: every few minutes it connected to the coffee machine, asked it about the current number of coffees made, and then sent this value via an HTTP POST query straight to the cloud - and more specifically, to the platform n8n.

Once our hardware agent started delivering data regularly, n8n did the rest of the magic.

Workflow #1: Data Acquisition and Archiving in n8n

This process is responsible for receiving data from ESP32 and building our historical database.

  1. It all starts in node Webhook, which listens for POST requests sent by our microcontroller.
  2. Once the data (number of coffees) arrives, node Date&Time adds the current timestamp to them.
  3. Then node Set (Edit Fields) organizes data - separates date and time into separate fields and formats the coffee counter value. Clean data is essential!
  4. Finally, node Google Sheets (Append row) adds the prepared record as a new line in our spreadsheet, thus creating an archive.

Workflow #1:
ESP32 -> Webhook -> Google Sheets

Workflow #2: Public API for Data Visualization in n8n

The second process is a simple and efficient API that “serves” data to our website whenever someone visits it.

  1. Other Webhook acts as a public endpoint to which queries from our website are sent.
  2. It starts node Google Sheets (Get row(s)), which retrieves the entire history from the sheet.
  3. And this is where the key thing happens: node Limit filters all rows, leaving only the last, freshest entry.
  4. Finally, node Respond to Webhook sends that single, current record back to the page, where JavaScript places it in the widget.

Workflow #2:
Webhook -> Google Sheets -> Response

Conclusions and Key Lessons from the Project

This seemingly trivial project provided us with some very serious lessons that are universal to much larger and more complex technology implementations.

  • Small projects, big impact. Pet project initiatives are a fantastic testing ground. They allow you to test new technologies in a safe environment, build team commitment and often lead to unexpected, valuable solutions.
  • Open-source is power. Without a publicly accessible repository with an established protocol, this project would be much more difficult and expensive. Using the work of the community is not a shortcut, but a smart and efficient use of resources.
  • Automation is a way of thinking. Tools like n8n allow you to rapidly create prototypes and build data flow logic. Instead of writing the entire API backend from scratch, we could focus on the unique elements of the project – communication with the device and integration.

This project, born from a simple question over a cup of coffee, is the best proof that innovations do not always have to involve multi-million budgets. Sometimes all you need is curiosity, the right tools and the awareness that coffee is really, really important.

☕ Are you curious how much coffee currently fuels our projects?
Check our real-time counter on the website About us!

Innovation starts with a conversation

Need help with your business? Don't delay! Contact us today!

Free consultation