Jura Mug Warmer - welcome to the smart world

12 years ago I added a totally unneeded feature to my coffee experience, a mug warmer.

Totally unneeded, well...

Well, yes, but...

How could I live without a pre-warmed mug in the morning? How could my partner meanwhile live without it? We can't imagine.

Our weekday morning starts like in most families, with an alarm. But not like in most families our dishwasher finished exactly half an hour before our first alarm, that the dishes are perfectly dry and still a bit warm for breakfast. The heating made already sure that thermal frustration does not exist, but only when a certain "real feel" temperature is reached at certain locations. The lights on our usual way in the morning are on, not too bright, not to soft either. A couple of minutes later our computer starts and the kettle let's us know on a WiFi speaker that the water is prepared for each tea temperature we want. Numbers like 95° C count here, individualized and adapted to our alarms, expectations and needs - personalized every day individually.

And then there is the Jura Mug Warmer. It knows ON, OFF and scheduled ON and OFF time, regardless of workday, holiday or snooze, burning 60 Watts. In total even more than the 2500 W washing machine, and we wash like champions. So what is wrong here?

On average 2 days a week the simple schedule regimen from 0730 ON till 1530 OFF fits somehow and the other 5 days it does not. Either we go to office, guests come for a visit or we sleep till noon, for whatever reason it just does not fit but happily empties the wallet without a real need, measured with 2 Zigbee eWeLink power plugs over a couple of weeks.

So let's power it when needed, it is already connected to a smart power plug. But the push button on the mug warmer does not permit it even when just pressed (to a constant state like a switch), Jura defined some minimum time the button needs to be pressed and some maximum time somewhere between 200 ms and IMHO 1500 ms to toggle the current state. It also does not power on when just connected, it still needs the button press. Suboptimal smart design for a simple remote power outlet.

Time for an upgrade I said 2 months ago and started a frustrating downtime of cold mugs by removing the Jura logo on the back, removing the - let's not call it screw - and opened the mug warmer's hood. Two more screws and some broken plastic parts later - 12 years daily from 20 °C to 66 °C and back did not make the plastic more flexible - the beast was dismantled.
Version 1.2 was written on the heart of it, a PCB of simple but properly  "obfuscated" circuit on the top back box of it. VCC and GND pins are written on it after carefully bending the display away to see more. 3V3 on VCC, respectively I measured 3V43 but still good to run an ESP. And when there is an ESP, I can also check for temperature, voltage and current used.

In the beginning I have thought I'd just grab the existing 3V3 in a parasitic way to power the ESP, use 2 transistors - a NPN to switch a PNP to circumvent the voltage drop caused by the NPN - and a photoresistor (LDR) to read the state next to my loved DS18b20 temperature sensors. But it turns out that the mug warmer and its power is exactly designed and any parasitic way will not work - the voltage drop was over 1V5 when the ESP was connected.

Let's do it right: a separate power supply feeding the ESP and the relay. The relay bypasses the button of the mug warmer to power it on. The rest is connected to the 3V3 from the ESP.

You are handling mains. Disconnect from power supply before you open, follow the local regulations.

You need:
  • a Jura Mug Warmer (others may do it as well, but the Jura has enough space to mount everything properly)
  • an ESP-32 (we have 3 analog sensor, it works with an ESP8266 when you multiplex them, but that's another story)
  • a ZMPT101b module to measure voltage
  • a ZTA503c current transformer
  • a LDR/photoresistor
  • a 1uF ceramic capacitor
  • Resistors:
    • 1x 200 Ω
    • 2x 100 Ω
    • 2x 4.7k Ω
  • a 5V 700mA power supply unit
  • a TI DS18b20 or any other digital temperature sensor, e.g. Sensirion or a Bosch BME180
  • a PCB of choice to fit the ESP
  • some wires
  • some heat-shrink tubing with different diameter
  • a soldering iron
  • a hot glue gun
  • some hours up to some days => patience is king

The 0.1 µF capacitor should be as close as possible to the pins on the ESP to properly reduce any unneeded spikes and compensate with the quite noisy ADC of the ESP. See ADC information from Espressif Systems. The Dallas is connected in a normal way, not parasitic. The schema below shows 2 DS18b20 as I initially wanted to measure each tray separately but the values of both sensors are very close to each other and 2 temperature sensors are even for a value nerd like me a little bit overkill :-)


 
And this is how it looks like when everything is in the back of the mug warmer. Bottom right you can see the PSU connecting to the ESP and the relay (between the 2 screw holders under the Jura Control part). Above the ESP is the voltage measurement module and directly on the PCB where you plug the ESP is the current transformer. Two lines go to the Jura Control part, one is the LDR and the other one is the bypass from the relay.
 

And last but not least, the ESPHome yaml code. At the time of writing the ZMPT101B is not yet supported by ESPHome, maybe you want to support it with a thumbs up:

dallas:
- pin: GPIO21 #GPIO35 is output only
  update_interval: 60s

sensor:
- platform: adc
  internal: true
  name: "Photoresistor Voltage"
  id: photoresistor_voltage_sensor
  pin: GPIO34
  attenuation: 11db
  update_interval: 2s

# - platform: adc
  # internal: true
  # name: "ZMPT101B voltage"
  # id: zmpt101b_voltage
  # pin: GPIO32
  # unit_of_measurement: "V"
  # update_interval: 2s
  # attenuation: 11db
#  filters:
#    - offset: 1.68                       # compenstate the offset (value measured at 0V)
#    - lambda: return x * x;
#    - sliding_window_moving_average:
#        window_size: 1250                   # average over 30 seconds
#        send_every: 208                     # report every 05 seconds
#        send_first_at: 208
#    - lambda: return sqrt(x);
#    - multiply: 380                         # calculate mains voltage (calibration)     

- platform: adc
  internal: true
  pin: GPIO33
  name: "CT voltage"
  id: ct_voltage
  unit_of_measurement: "V"
  update_interval: 2s
  attenuation: 11db

- platform: ct_clamp
  sensor: ct_voltage
  name: "Current"
  update_interval: 2
  unit_of_measurement: "A"
  accuracy_decimals: 1
  filters:
    - calibrate_linear:
        - 0.005 -> 0
        - 0.08 -> 0.19
        - 0.12 -> 0.276
        - 0.156 -> 0.357
    - lambda: |-
        if (x <= 0.1) {
          return 0;
          }
        else {
          return x;
          }

- platform: dallas
  address: 0x7xxxxxxxxxxxxxx8
  name: "Temperature"
  id: temperature
  accuracy_decimals: 0

binary_sensor:
- platform: analog_threshold
  internal: true
  name: "Power LED"
  id: power_led
  sensor_id: photoresistor_voltage_sensor
  threshold: 2.65
  filters:
    - invert:
    - delayed_on: 50ms
    - delayed_off: 50ms
  on_press:
    - switch.template.publish:
        id: template_switch
        state: ON
  on_release:
    - switch.template.publish:
        id: template_switch
        state: OFF

switch:
- platform: gpio
  internal: true
  pin: GPIO15
  id: relais
  name: "Relais" # This relay simulates the button press on the mug warmer power button
  inverted: true
  on_turn_on:
    then:
      - delay: 250ms
      - switch.turn_off: relais

- platform: template
  name: "Mug Warmer"
  id: template_switch
  optimistic: true
  turn_on_action:
    - switch.turn_on: relais
  turn_off_action:
    - switch.turn_off: relais


Product image is property of JURA Vertrieb (Schweiz) AG

Comments

Popular Posts