Homekit Enabled Rancillio Espresso Controller
Homekit enabled Rancilio Espresso Controller for Rancilio Silvia v5 Espresso Machine
this project was possible thanks to the freeRTOS and esp-open-sdk Also thanks to folowing other projects:
This module is specifically designed to control turning on-and-off Rancilio Silvia v5 Espresso Machine. Rancilio Silvia has only a momentary switch that while toggled, powers the machine on (when previously off) and off (when previously on). Additionally Rancilio Silvia uses an internal timer that turns the machine off after 30min
Espresso Controller monitors the internal power state of the espresso machine and controls powering the machine up and down when activated
Firmware Build
- Clone the project. Next, initialize and sync all submodules (recursively):
git clone --recursive https://github.com/stellarshenson/espresso-controller.git
cd espresso-controller
git submodule update --init --recursive
- Install esp-open-sdk, build it with
make toolchain esptool libhal STANDALONE=n
, then edit your PATH and add the generated toolchain bin directory. The path will be something like /path/to/esp-open-sdk/xtensa-lx106-elf/bin - Install esptool.py and make it available on your PATH. If you used esp-open-sdk then this is done already. Alternatively you can use the NodeMCU flasher
- Checkout esp-open-rtos and set SDK_PATH environment variable pointing to it.
- Build espresso_switch firmware:
make -C projects/espresso_switch suite
Files generated by the make script should be:
ls firmware
0x00000_rboot.bin 0x10000_blank_0x00_1M.bin 0x10000_blank_config.bin 0x20000_espresso_switch.bin
The prefix indicates where in the flash the firmware should be burned, use it when flashing with esptool.py or the NodeMCU flasher. Additional settings for flashing of the firmware are: SPI Mode = DOUT, Baudrate = 230400, Flash size =
Principle of operation
The device is supposed to control the powering up and down the espresso machine and notify any power changes to the Homekit clients nearby. In the future the device will be able to control the auto-shutdown of the espresso machine (powersaving) and flushing (running water through the group after warm-up). Additionally the firmware will monitor the boiler temperature in the future.
Currently the device extends the following number of output interfaces:
- Toggle interface - controls the toggle switch and works exactly like the momentary switch on the espresso machine front panel
- Power sense interface - senses whether the machine is on or off (and provides notifications to the homekit clients)
- Status LED - indicates the status of the device, fast blink = booting up, slow-blink = AP mode, no blink = connected to the network, SOS blink (3 short, 3 long, 3 short) = problem
- Button - press once to manually trigger power switch (used to test device wiring). hold for 10s to reset device to factory settings
Additionally, when connected through the microUSB port to the computer, the device outputs serial diagnostics messages and extends serial commandline. Type help to get the list of available commands.
The serial inteface was configured with the 74880 baud rate
Functionality
Device boots up in 2 different modes:
- as new device, you need to find its wifi ssid (Espresso-Switch-xxxx) and configure its access to your network via web captive portal
- as connected device. you need to connect to its IP and capture its Homekit code
- as homekit device. it is ready for operation once added to your homekit network
Typical Circuit Layout
You would need the following parts to complete the build
- Wemos D1 Mini - any wemos with 4Mb+ flash works (Mini or Mini Pro)
- Optocoupler + 1k Resistor (D6) - used for powersense. The Rancilio Silvia 12V power indicator circuit it very noisy, we would use the optocoupler to provide galvanic isolation between the controller and the espresso machine
- Relay (3.3V level or Relay 5v + NPN transistor and a couple of passive jellybeans) - this needs to switch the 12v AC momentary switch
- 1 Status LED + 330 Resistor - this is just a status LED. Fast blink = starting up, Slow blink - AP mode, No blink - connected to network
- HI-Link 5V power module (to power the thing up from mains) - it would be preferred to connect the controller to the mains terminals at the Rancilio power brick. I am figuiring out other options, stay tuned. Voltage for the Wemos D1 must be relatively clean.Wemos has onboard a small 3v3 linear power supply controller. Please keep in mind that Wemos D1 uses 3v3 logic levels :-)
I will publish the full BOM as soon as I finish the PCB build and installation
Circuit and PCB
All schematics and PCB files are available in the misc/board directory. The bill of materials is up-to-date in the schematics pdf
PCB design is for one-sided PCB with a copper pour connected to the GND. PCB printout printout available as 600dpi to print and etch according to instructions. Schematics and PCB files were produced with DipTrace
Installation
TBD