Introduction: Smart Coffee Machine - Part of SmartHome Ecosystem
Hacked Coffee Machine, made it part of SmartHome Ecosystem
I possess a good old Delonghi Coffee Machine (DCM) (not a promotion and want it to be “smart”. So, I hacked it by installing ESP8266 module with interface to its brain/microcontroller using Tasmota firmware. DCM is based on PIC microcontroller (uC); so, to make it run by ESP8266 with Tasmota onboard I built an interface to PIC uC in a way that does not to interfere its normal operations. Sure, all existing DCM functionality to be preserved. The easiest way is to emulate buttons. I use opto-couplers to be sure ESP module does not disrupt DCM electronics and uC operations.
Supplies
ESP8266 Module
Step 1: Hardware
Soldered a “smart” module based on ESP-12F ESP8266 module (see pictures). You may also use a standard sonoff module hacking it according to my schematic. I use GPIO16, 14, and 12; they are usually vacant in sonoff modules and you would need just solder wires to corresponding ESP8266 pins. However, my goal was to avoid using relays. So, I relay on optocoupler-based interface.
Step 2: Interface to Coffee Machine Control Board
To manage DCM, ESP module interfaces to two main buttons: “Power On/Off” and “Make a Cup of Coffee”. I soldered pair of wires to each buttons’ contacts right on the control board (see pictures, 2xGray wires to each button). The board is covered by a hot glue to protect it from moisture, so I melt it by soldering iron set at temp of ~120*C, then soldered wires and glued contacts and wires back.
I also soldered a wire to GND (Green wire on pictures), to one of large polygons on the control board. Found/checked it by multi-meter.
Step 3: Schematic of the ESP8266 Module
Opto-couples (see schematic) are connected in parallel to buttons with a 1k current limiting resistor. A button is usually pulled up to a positive bus by pull-up resistor. To connect opto-coupler in a right way, you have to find a “positive end” of the button; that can be done by multi-meter by measuring voltage on each wire and GND. A collector of opto-pair to be connected to positive wire through 1k resistor. Emitter – to the second wire (which is usually connected to GND).
Red wire at pictures is connected to +5V bus (for other purpose, not used for ESP module, not subject of this post).
To power ESP8266 I use a dedicated 5V 1A power supply. An existing DCM power supply would not be enough to run ESP module that can consume up to 800mA in pics. So, it is much better/stable/safer to set up a dedicated 5V power supply. You may use an old 1A phone charger, connected to mains wires right inside DCM.
EasyEDA link to schematic: https://easyeda.com/Sergiy/smart-coffeemachine-module
Step 4: Firmware/Configuration
Tasmota with the following configuration:
1. Set up two “relays”, input for DCM “Ready-to-brew-coffee” signal and configure ESP8266 build-in LED as following:
- GPIO2 LED1i
- GPIO16 Relay 1 - to emulate a “Power ON/Off” button
- GPIO14 Relay 2 - to emulate a “Make a Cup of Coffee” button
- GPIO13 Switch3 - input for a Cup Presence signal from infrared cup presence module
- GPIO12 Switch4 - Ready signal from DCM (not used by Tasmota yet)
2. To emulate a short press of a button I use BLINK feature of Tasmota; configured Blink by following commands in Tasmota Console:
- Blinktime 3 - means a blink duration of 0.3 sec – to mimic a short push on a button
- Blinkcount 1 - just a single push on a button is required
- Sleep 250 - to save energy
3. To “press” buttons I use the following commands (as shortcuts in my smart phone):
- http://<ESP8266_IP_address>cm?cmnd=Power1%20blink // for “Power ON/Off” button
- http://192.168.1.120/cm?cmnd=Event%20Brew // check up if cup it in place and execute "Power2 Blink"
4.Added a Cup Presence module (salvaged a "paper presence" module from an old copier). So, coffee will not be brewed if the cup is not in the spot:
Assigning VAR1 value either 1 or 0, depends on the cup presence:
- Rule3 ON Switch3#state=1 DO VAR1 1 ENDON ON Switch3#state=0 DO VAR1 0 ENDON // set VAR1 value // execute a brew command, depends on the VAR1 value:
- Rule2 ON Event#brew DO IF (VAR1==1) Power2 Blink ENDIF ENDON //if CUP is in place -> Brew coffee
Works like a charm!
The way I did it could be used with other old but still reliable machines and apparatus, limited by your imagination only!
EasyEDA link to schematic: https://easyeda.com/Sergiy/smart-coffeemachine-mo...