Espresso Controller
PID temperature control and monitoring for a Rancilio Silvia or comparable espresso machine.
Table of Contents
Tech Stack
The application is a single Go binary implementing:
- gRPC API as defined in espresso.proto,
- dashboard web app using React and Material-UI, and
/metrics
web endpoint for Prometheus scraping
serving on a single port (default 8080) of a Raspberry Pi.
Installation
Requirements
- Espresso machine, e.g., Rancilio Silvia
- Raspberry Pi 4. Will not work well on Raspberry Pi Zero W. The Pi Zero W, having a single processor, will experience performance issues because it will not handle the necessary concurrency well (needs to measure temperature, toggle heating elements, and serve the UI static files / requests).
- Solid state relay
- Type K thermocouple
- MAX31855 thermocouple amplifier
- Male blade connectors
- Electrical wire
Wiring
Here is the original circuit diagram from the manual: Rewire it like this (default gpio pin numbers shown):
Note on Thermocouple Placement
The thermocouple should be attached securely to the outer wall of the boiler. On the Rancilio Silvia, a convenient way to accomplish this is to loosen the screw holding down the factory thermostat to the boiler. Then, the thermocouple can be slipped into the gap between the boiler and thermostat.
Raspi Setup
-
Follow the Raspberry Pi Getting Started Guide. Be sure to connect it to a wifi network.
-
Ensure wifi power saving mode is off.
pi@raspberrypi:~ $ sudo iw wlan0 set power_save off pi@raspberrypi:~ $ iw wlan0 get power_save Power save: off
-
Take note of the Raspberry Pi's private ip address.
pi@raspberrypi:~ $ hostname -I 192.168.1.124
-
Download the application and start it.
pi@raspberrypi:~ $ curl -L -o espresso https://github.com/gregorychen3/espresso-controller/releases/download/v0.2.3/espresso pi@raspberrypi:~ $ chmod +x espresso pi@raspberrypi:~ $ ./espresso -v ╓▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ █▀─╓▄ ┌▄▄┌ ▄▄ ╙█ █ ╫█╠█ ╔▓▓ ▄█▀╟█╙█▄ ╔▓▓ █▌╟█ ██▓▄ █ ╙╙ █ ╘▀ █▄ ╙╙ █─▐█ █ ╔█▀█ ╓▄▄ █▌ ▄█ ╓▄▄ ▓██▌ █▄██ █ ▀▀▀ ╙▀▀▀▀╙ ╙▀▀└ █╨ ╙▀██▓▓▓▓▓▓██▓▓▓▓▓▓▓▓██▓██▓▓▓██▀╙ ╔▓▓▓▓██▓▓▓▓▓▓█▌ ▐▌ ▐█▓▓▓██▓▓▓▄ ╫█▄▄▄▄▄▄▄▄▄▄▄██▄▄▄▄▄▄▄▄██ ▐█ ▄██▄ ╫▌ █▌▄█ ▐█ █▌▐█ ╫▌ └└─ ▐█ █▄▐█ ╫▌ ╒▓▓▓▓▓▓▓▓▓▓▓▓▓▄ ▐█ ╙╙╙└ ╫▌ ▐█▄▄▄▄▄▄▄▄██ █▌ ▐█ ╫▌ ╘█ █▀▀▀▀ ▐█ █▌ ╠█▓▄┌ ▄▄█▌ ▐█ █▀╙╙╙╙╙╙╙╙╙╙╙╙╙╙╙╙╙╙╙╙╙╙╙╙╙╙╙╙╙█ █ █─ ╙▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ For more information, go to https://github.com/gregorychen3/espresso-controller 2020-05-24T16:45:27.372-0400 INFO espresso/server.go:115 Initializing gRPC server {"port": 8080} 2020-05-24T16:45:27.372-0400 INFO espresso/server.go:123 Initializing gRPC web server {"port": 8080}
Or, start as a background process and leave it running.
pi@raspberrypi:~ $ ./espresso & pi@raspberrypi:~ $ exit
Control and monitor
Finally, visit http://<ip_addr_from_step_2>:8080
using a web browser. Control and monitor the system from the dashboard there.
Finished
Contributing
See the development README.
Credits
Logo icon made by catkuro from flaticon.com and converted to ASCII art using asciiart.club.