PID temperature control and monitoring for a Rancilio Silvia or comparable espresso machine.
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.
- 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
Here is the original circuit diagram from the manual: Rewire it like this (default gpio pin numbers shown):
※I changed the pin from original espresso-controller. This version is custmized espresso-controller. | DO | | GPIO2 | 3 | →→→→→ GPIO9 | | CS | | GPIO3 | 5 | →→→→→ GPIO5 | | CLK| | GPIO4 | 7 | →→→→→ GPIO11 | |SSR+| | GPIO21| 40| | |SSR-| | GND | | |
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.
-
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-2 https://github.com/takuma2/espresso-controller/releases/download/v0.1.0/espresso-2 pi@raspberrypi:~ $ chmod +x espresso-2 pi@raspberrypi:~ $ ./espresso-2 --help Control and monitor an espresso machine Usage: espresso [flags] Flags: --boiler-therm-clk-pin int The GPIO pin connected to the boiler thermometer's max31855 clock (default 4) --boiler-therm-cs-pin int The GPIO pin connected to the boiler thermometer's max31855 chip select, aka chip enable (default 3) --boiler-therm-miso-pin int The GPIO pin connected to the boiler thermometer's max31855 data output (default 2) -h, --help help for espresso -p, --port string Port on which the espresso server should listen (default "8080") -r, --relay-pin int The GPIO connected to the relay (default 21) -v, --verbose verbose output 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-2 & pi@raspberrypi:~ $ exit
Finally, visit http://<ip_addr_from_step_2>:8080
using a web browser. Control and monitor the system from the dashboard there.
See the development README.
Logo icon made by catkuro from flaticon.com and converted to ASCII art using asciiart.club.