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...
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.
You are handling mains. Disconnect from power supply before you open, follow the local regulations.
- 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 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
Post a Comment