Instructions for how to equip a Raspberry Pi to control a JURA coffee maker.
The Raspberry Pi (1) acts as the brain of the system.
It connects via UART to the coffee maker (2) and interacts with it.
Also, the Raspberry Pi (1) is connected to a touchscreen display (2) allowing the user to interact with the coffee maker (2) in a simple way.
Besides that, the Raspberry Pi (1) supports optional authentication of uses, using their RFID/NFC cards.
To make this possible, the Raspberry Pi (1) is also connected to an RFID/NFC reader (4) via USB.
This reader sends the card IDs it reads as keyboard input to the Raspberry Pi (1).
In this section we have a look at the hardware required for this. I used the following hardware for this project:
- Raspberry Pi 3 Model B
- SanDisk Extreme PRO R100/W90 microSDHC 32GB Kit, UHS-I U3, A1, Class 10 (SDSQXCG-032G-GN6MA) - you need a fast one in case you want to debug on you Pi :)
- Raspberry Pi Touch Display
- NFC-Reader - you can use anyone that sends the read card ID as follows "0123456789\n" as keyboard input
- 4-channel I2C-safe Bi-directional Logic Level Converter - BSS138 - to covert the 5V signals from the coffee maker to 3.3V signals for the Pi
- Jumper cables for connecting everything up.
In the 3D-printer directory you can find more information about how to print a case for the Raspberry Pi, its display and attache it to the coffee maker.
In this section we have a look at the software required for this.
You need an up to date copy of Raspberry Pi OS or any other Linux distro running on your Rapsberry Pi.
For the UI we use the gtk-ui. Head over there and have a look at the dependencies there.
Here we have a look at what needs to be done when setting up a up to date copy of Raspberry Pi OS to work with this project.
⚠This is not requied any more for recent releases of Raspberry Pi OS.⚠
Since the out of the box available C++ compilers for the Raspberry Pi a bit to old and therefore unable to compile C++20 code, we are installing our own, up to date compiler. We decided to use Clang instead of gcc, since it's easier to set up on a Raspberry Pi.
sudo apt remove -y gcc clang # Remove all old compilers
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-12.0.0/clang+llvm-12.0.0-armv7a-linux-gnueabihf.tar.xz
tar -xvf clang+llvm-12.0.0-armv7a-linux-gnueabihf.tar.xz
rm clang+llvm-12.0.0-armv7a-linux-gnueabihf.tar.xz
mv clang+llvm-12.0.0-armv7a-linux-gnueabihf clang_12.0.0
sudo mv clang_12.0.0 /usr/local
echo 'export PATH=/usr/local/clang_12.0.0/bin:$PATH' >> ~/.bashrc
echo 'export LD_LIBRARY_PATH=/usr/local/clang_12.0.0/lib:$LD_LIBRARY_PATH' >> ~/.bashrc
. ~/.bashrc
Once the installation was successful, you can test it with:
clang++ --version
To the enable UART (serial communication) on the Raspberry Pi, perform the following steps:
sudo raspi-config
- Select
Interface Options
- Select
Serial Port
- Select
No
to prevent the Pi from using the serial port for the login shell. - Select
Yes
to enable the serial port hardware. - Select
OK
- Select
Finish
- Select
No
in case it asks you if you want to reboot now.
Now we add our self to the dialout
group, so we do not need sudo to access the serial port.
sudo usermod -a -G dialout pi
And finally reboot.
sudo reboot -h now
There are a few shared requirements needed by all projects.
sudo apt install -y git cmake make ninja-build python3 python3-pip
pip3 install --user conan==1.59.0 # conan 2.x.x is not supported right now
The following image shows how to connect the Raspberry Pi with an JURA E6 coffee maker. Since the Raspberry Pi can only handle 3.3V UART signals, we need a "Logic Level Shifter" in between the coffee maker and the Raspberry Pi.