Skip to Content
Technical Articles
Author's profile photo Wouter Lemaire

Smart Coffee Machine – SAP Leonardo IoT Service

Have you ever heard about Flexso!? Flexso is an SAP Consultancy company located in Belgium and is also an SAP Partner. At Flexso we always follow the latest new technologies from SAP to help our customers with innovation. Therefore, we invest a lot of time doing research.  Next to that, we have an internal hackathon at Flexso where we can investigate and do whatever we like with SAP technology based on the needs of our clients. This year Dries, Augusto and I, used this moment to make a Smart Coffee Machine! In the next blogs Dries Van Vaerenbergh and I will tell you how we did this.

Predict maintenance requests and charge by the cup

Why would we invest our time in making a smart Coffee Machine? We talked with one of our customers that rents coffee machines to other companies and they are looking for a solution like this to:

  • Predict when the filter breaks
    • Most of the coffee machines that have a water supply are using a water filter. In case you put the sensor between the filter and the coffee machine, you will know when the filter is not working good anymore based on the time it takes for the water flowing to the machine and the pressure of the water.
  • Pay by use
    • By measuring the waterflow, we can measure the amounts of coffee that people consume and the different types of coffee from distance. Based on the amount of water, it will be a different type of coffee.


How to make every Coffee Machine Smart?

Okay, maybe not all coffee machines, but all industrial coffee machines. To do this, we only used a waterflowsensor like this:

This sensor enables us to measure the water flowing from the water supply to the coffee machine. By measuring the waterflow, pressure, amount and time we know everything for monitoring the coffee machine. Every time that someone takes a coffee, the machine will take water and water will flow through the sensor.

Flexso’s Smart Coffee Machine

Recently SAP Belgium did some renovations to the building and it now has an SAP Experience Center. In this place, SAP shows demos of SAP technologies to customers. Flexso was able to place the Smart Coffee Machine demo in this SAP Experience Center.

Here you have the Smart Coffee Machine that’s connected to our sensor together with Dries

Finally, we’ve added an iPad next to the Coffee Machine to show an overview of:

  • The last taken coffees
  • Top 3 coffees in last 24 hours
  • An overview of the last 3 days

This overview will update as soon as someone takes a new coffee. For the overview app on the iPad, we’ve used SAPUI5. SAPUI5 is a HTML5/JavaScript framework that makes it easy to create responsive web apps that fit on mobile, tablet and desktop. The framework comes with a lot out-of-the-box controls that you can put together and build beautiful apps. It’s the same technology that’s used for Fiori apps, although this app doesn’t look like a Fiori app. It’s a great example of the possibilities of UI5.


I have already revealed the sensor that we’ve used but there is more. We used a Raspberry PI to send the sensor data to SAP Leonardo IoT service. This service is not the same as the one in the SAP Cloud Platform NEO but the one on SCP CloudFoundry which you need to pay. It exists out of two parts:

  • IoT Service Cockpit
    • This is the place where you can maintain your devices and sensors
  • IoT Thing Modeler
    • In the thing modeler, you can create a virtual twin based on your device configuration. It’s a mapping between a virtual thing and your real device.
    • Here you can combine IoT data with other properties and set authorizations on things. This enables you to allow end-user to only view their own things.

This two-layer architecture gives a lot of flexibility. One-layer focusses on device onboarding and security, while the other layer is more focused on the business side of the story without caring about the device itself. With business side, I mean doing analytics on top of the IoT data like creating aggregations and measures.

On top of Leonardo IoT service, we’ve created a UI5 app that visualizes the Coffee Machine data. The SAP Web IDE has plugins for creating UI5 apps on top of the IoT service. This will enable you to create IoT apps in no time!

Next to that, we have integrated the data from IoT to an SAP backend by using SAP Cloud Integration. Because it’s all SAP technology, integrating IoT into SAP backend is not that hard ?

Last but not least, we created a SAP Cloud Analytics Dashboard on top of it. This was done by our BW team and won’t be explained here. We just want to mention it that it’s possible.

We also used Edge processing in our setup to define the coffee type, based on the amount of water, before sending it to the cloud.

Dries and I will explain all the technical details in the following blog posts:

  1. How we started building a Smart Coffee Machine
  2. From Sensor to the Cloud including the installation of the IoT Edge Gateway
  3. SAP IoT Service Cockpit config and Edge Processing
  4. SAP IoT Thing Modeler with a custom IoT UI5 app on top
  5. Integration with SAP backend

Here you have a video on how it works!


Hope you enjoyed reading about our Smart Coffee Machine story ?

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Nabheet Madan
      Nabheet Madan

      Super stuff, this is the power of technology:) Looking forward to next set of blogs



      Author's profile photo Matthew Billingham
      Matthew Billingham

      I want to tell the coffee machine from my desk what coffee I want. Then go to the machine, scan my badge, or enter a code, and have my coffee produced to my specifics.

      Author's profile photo Richard Harper
      Richard Harper

      Is that while (or not while) two nuclear missiles are busy chasing you down and thinking about turning into a whale and a bowl of petunias ????

      Author's profile photo Matthew Billingham
      Matthew Billingham

      Sorry, I should correct that.

      "I want to tell the coffee machine from my desk what coffee I want. Then go to the machine, scan my badge, or enter a code, and have it produce a liquid almost, but not quite, unlike tea."

      Author's profile photo Richard Harper
      Richard Harper


      I wonder how many heads are being scratched at that ?

      Author's profile photo Matthew Billingham
      Matthew Billingham

      Should I mention the bruise on my upper arm? Or would it ruin the tension?

      Author's profile photo Richard Harper
      Richard Harper

      No,  I wouldn't,  just look out for the penquin.....

      Author's profile photo Shelly Megan
      Shelly Megan

      Nice post thanks for sharing such an impressive blog with us.