Introduction: How to Build an Accessible Coffee Machine Interface

Hello there! Thank you for visiting this page. We want to show you how to build an accessible coffee machine. Some people have trouble to interact with touchscreen based coffeemachines. Therefore, we build an easy to use adapter, with which the coffee machine can be used by wireless buttons. In later versions we are aiming to show you how to create an additional speech control.

How does it work?

All coffee options are presented in an Matlab-based App. By using Button 1 we can toggle through all options. With Button 2 wie can select the option and with button 3 we can reset the menu. With the choice, parameters are given to the actual extension shown in the sart picture and two stepper motors drive to the right position and push the button of the coffee machine.

This tutorial is partially based on other tutorials which we will give credit all along. If you are not sure about the components look at the pictures. I did my best to document every step with pictures.

Supplies

You will need:

  • 1x soldering iron and solder
  • 1x computer with a screen
  • Arduino IDE
  • MATLAB (later versions will have an app with Python, so stay tuned)
  • a 3D-Printer (we used Prusa MINI)
  • 3D-printing filament (we used PLA)

For the coffee machine extention you need:

  • 1x Arduino GIGA R1 WiFi
  • 2x step motors 28BYJ48 with drivers
  • 2x Prusa Linear bearing LM8UU
  • 1x Prusa Timing pulley T16-2GT
  • 1x Prusa Belt X-axis
  • 2x Prusa Smooth rod X-axis / Y-axis (MINI/+)
  • 10x Ruthex RX M3-5,7

Please, check the length of your coffee machine before you buy the Belt and the smooth rod. Depending on the layout these parts have to be longer or shorter (see Step 3).

For the wireless buttons we used this tutorial (https://wltd.org/posts/how-to-build-a-real-smart-button-for-under-10). You need for three buttons the following parts.

Electrical parts:

  • 3x ESP8266
  • 1x ESP8266 USB programmer
  • 3x Arcade Buttons
  • Breadboard or perforated grid board as curcuit board
  • 6x 2N7000 MOSFETs, N Channel
  • 9x 10k resistors
  • 6x 100k resistors
  • 3x 220 resistors
  • 3x AA battery mounts and additionally six AA batteries
  • Optional: On-Off-Switch

Step 1: Building the Button

For this part you need the electrical parts stated above, the soldering iron, and the computer with the Arduino IDE.


We used the tutorial to build the button: https://wltd.org/posts/how-to-build-a-real-smart-button-for-under-10. We highly recommend following this tutorial for soldering the hardware. For the 3D-printed parts we provide another version in the next step. If you want this button, please pay attention that the cables between button, board and battery pack are long enough.

Additionally, an On-Off-Switch between Plus-connector of the battery pack and the board can be build in, if the Button is not constantly needed.

Repeat till you have 3 buttons. The programming of the buttons is described in Step 5.

Step 2: Build the Casing for the Button

For this step you need the 3D-printer.


You can find here the three parts needed for the button. The button has rounded edges and is 8.6x8.6cmx6.8cm large. If you need to configure the parts to fit on your components feel free to use the step data.

If you prefer using the button housing as provided, you can us the STL data for the PrusaSlicer. Download the PrusaSlicer App and install it. Setup your printer (please see https://help.prusa3d.com/de for detailed information). Most important is the printer type and the 3D-printing material. Drag and Drop the parts into the program. If you have (like us) a Prusa Mini, you have to print the parts in two steps, since they are too big to fit on the heatbed at once. We used PLA with an infill of 20% and supports.

The Button Housing is divided into 3 compounds. The first one is for the board. The little hole is either to stick the ESP8266 through it or to have a visual feedback if the LED on the ESP-board is still blinking while sending. In the middle the button is mounted. Also note here, that if you buy other buttons the holes could have other dimensions. In the last compound the battery pack is placed.

If the parts are printed, insert the button parts. Don't glue anything shut before you tested if it worked.

Optional:

  • The holes at the Battery pack side are made for M5-screws. On the inside there would be enough space to add a holding for the nut. In our case, we glued the nuts and the battery mount to the 3D-printed housing.
  • The edges are already rounded, but with this measures it is possible to round them more, if there is a higher risk for harm.
  • If you build in the On-Off-switch, the step-file for the button housing has to be modified to access the switch.

Step 3: Build the Coffee Machine Extention

For this step you need the 3D-printer, the Arduino, Arduino IDE, the Prusa Parts and the stepper motors.


The coffee machine extention is based, in our case, on some parts of an old Prusa printer. In this setup we need only two motors for handling a total of six buttons. The first motor moves the holding of the second motor to the right location. Then, the second motor presses the button.

You find attached the stl- and step-data for the 3D-printing parts. Please note, that if your coffee machine is of another type than Melitta CITouch the arrangement of the buttons and therefore this setup will vary. How can you fix it? The code stated in the next point is adaptable to new positions. We will describe for the case of another setup the steps you have to take. To modify the arrangement you have to create a new holding:

  • Measure the location of the "clips" (left and right side, where you want to attach the extention.
  • While measuring, make sure that you wont cover any buttons such as on/off.
  • Measure the distance between the buttons and the location of the first button.
  • Order or find rods and belts fitting in length to your new setup.

Let's assemble it. The completed assembly is shown in the first two pictures.

  1. Print the parts.
  2. In the holes for mounting the motors, the platines and the Arduino, you have to put the Ruthex RX parts. You can insert them by melting them into the material with the soldering iron.
  3. Lets take a look on the Prusa Parts.
  4. Take the Axis_End and insert the linear bearing to fix the belt. Tighten it with a screw. Insert the two smooth rod axis (picture 3).
  5. Put on both axis one pulley. Take the middle part, on which the motor and the finger is connected. Insert the belt into the spacings of carriage_R (picture 4). Afterwards clip it on the pulleys and screw carriage_L on it.
  6. Take the Axis_Start, put it on both axis and insert the belt. Afterwards connect the pulley with the stepper motor and push the pulley in the hole (picture 5). Thighten the stepper motor to the part Axis_Start.
  7. Move Axis_Start as far to the outside, so that the belt is under tention.
  8. Fix the other 3D-printed parts as shown in figure 1 and 2. This should be part Fingermount, Finger and Arduinomount.
  9. Depending on your coffee machine you may elongate the cables for the motor on the axis, so that it can reach the other end of the coffee machine.


Check if your coffee machine has buttons, capacitive or pressure sensitive touch screen. The finger has to be adjusted by using adequte materials.

Step 4: Setup MQTT

In this step you only need your PC.


We decided to use MQTT to connect all parts. All parts are connected via WiFi, so that the parts can be moved from each other. The system we present is based on an Windows 11 version. All necessary Software should be compartible with different operation systems. As we used the system please make sure, that you don't open third parties the gates to your PC and your data. By changing some settings security can be enhanced drastically.

  1. Start a mobile hotspot: Go to "Start" (little Windows icon in the corner) and type mobile hotspot. Go to the according settings and enable the hotspot. In this step you find all necessary information for your IP settings needed for the Arduino and the ESP8266.
  2. Download and install Eclipse Mosquitto: https://mosquitto.org/. This will be our MQTT broker. The usage is quite easy to use.
  3. Go to "Services" by typing it in the Windows search.
  4. Look for a service called Mosquitto broker and start it.
  5. We had to change some settings in the mosquitto.conf so that the buttons and the Arduino could connect. Go to the mosquitto-folder. It is most likely under "C:/Programs/mosquitto". Open this file with Notepad++ (so that you can have the Admin rights). Remove # by the line (here: line 529) with "allow_anonymous false" and change false to true. Remove the # in line 232 so that there is only written listener. You can add a line with "listener 1883 YourIPadress.from.the.mobilehotspot". Please change YourIPadress.from.the.mobilehotspot to your actual IP-adress. More informations here: https://mosquitto.org/man/mosquitto-conf-5.html. A restart of the broker as described in 4. is necessary to apply it.
  6. Maybe your PC will block any connection. You have to add the port to the trusted connections (recommended) or disable your firewall (not recommended).

The Hotspot, broker and (for the unsafe way) the firewall settings have to be set each time. Afterwards we will present the buttons, the App and the Arduino Code.

Step 5: Setup the Buttons

You will need for this step the buttons from Step 1 and 2 and the ESP8266 USB programmer.

The code is everytime the same, exept of the topic names and the parameters of the button. Best way to flash them on the ESP8266 is to create three programms in the Arduino IDE (download here: https://www.arduino.cc/en/software, we used Arduino IDE Version 2.3.1). This is how you have to setup the system:

  1. Create one of the programs.
  2. Install the needed libraries: ArduinoMqttClient by Arduino (v. 0.1.8), Stepper by Arduino (v.1.1.3), WiFi101 by Arduino (v.0.16.1), MQTT by Joel Gaehwiler (v. 2.5.2) and PubSubClient by Nick O'Leary (v.2.8)
  3. Install the boards: Arduino Mbed OS Edge Boards by Arduino (v.4.1.1) and esp8266 by ESP8266 Community (v.2.7.0)
  4. Connect the ESP8266 to the ESP8266 USB Programmer (see data sheet)
  5. compile and Upload the code.
  6. Remove the Programmer, Switch to UART to flash the chip and insert it again. Tip: If you take a look in the Serial Monitor with the right baud-rate (115200) you will see the reaction of the chip (serial.println and client.publish). This is perfect for debugging.
  7. Afterwards attach the ESP8266 to your button. If you go into the PowerShell or command promt, navigate into the mosquitto file, you can listen to the topics with this command:
mosquitto_sub -h your_ip -t button_1 

It should show a message like "Button xx was pressed", when the button is pressed. Then the button is correctly conntected over MQTT and has an active connection. Due to the deep sleep function it is quite slow to react. So give it some seconds to react.

Repeat this for the other two buttons.

We faced some challenges that we solved as such:

  • Errors were thrown while compiling the code: The MQTT library needed in our case version 2.7. We downgraded it in the Arduino IDE.

You can find the code for the buttons in my git: https://github.com/AnkeLinus/Assistive_Coffee_machine/tree/main. It is labled Button1.ino, Button2.ino and Button3.ino.

Step 6: Setup the User Interface App

Download the App below and start it in MATLAB. It has to be at least Version 2022a, since it contains important updates for MQTT.

In the following the connection between App and Arduino is shown. In this file the parameters are given to the MQTT topic.

clc;
clear all;
close all;

%Root-Certificate, Port and Brokeradress for MQTT-Client
rootCert = "C:\Users\Administrator\Downloads\thingspeak-com.pem";
brokerAddr = "mqtt://192.168.137.1";
port = 1883;

%Defining MQTT-Client and connecting
mqClient = mqttclient(brokerAddr, Port=port, CARootCertificate=rootCert);
mqClient.Connected;

%Subscribe to Topic
subscribe(mqClient, 'variablen')

%Definition variable for motors
variable_motor_fahren = "2038";

%Sending variable to MQTT
variable_msg = variable_motor_fahren;
mqClient.write('variablen',variable_msg);


In this part you can find the App:

To adjust the menu to your coffee machine you have to change the functions in the app provided below. Measure the spacings between the buttons and adjust the stepsize for the stepper motor.

Also here the code is in the git: https://github.com/AnkeLinus/Assistive_Coffee_machine/tree/main. It is called App1. To solve issues with the foto, you can either load in the provided image or rename one of yours.

Step 7: Conntect the Arduino

Add this code to a new file in your Arduino IDE, compile and push it on the Arduino Giga R1 WiFi. All needed libraries should be already installed in Step 5. Depending on the coffee machine type you have to change the Stepper data to match to your spacings in between buttons.

This code is provided too in the git as file: Ardiono_code (https://github.com/AnkeLinus/Assistive_Coffee_machine/tree/main).

Connect the cables as shown in the image or as follows:

  • Connect the motors to the 5V and GND connector (please be careful not to mix them up).
  • The first motor ist connected to Pin 22 to 25 and the second motor is connected to Pin 28 to 31.
  • You can power the Arduino via plug or over the laptop/PC depending on your setup.


Step 8: Applying It to Other Apps

This structure can be fitted to other Apps as well as long as they operate with MQTT. By writing a new app (for example switching Matlab with Python or Java) you just have to listen to the stated topics button_1, button_2, button_3 and kaffeesorten. Feel free to experiment with the codes and we would be happy about your feedback.