Making clothes dryer smarter!

Hi,
As subject states, I’m trying to make my clothes dryer a bit smarter, want to get a notification when it’s finished.
The dryer indicates that it’s finished by flashing a LED, before that happens it’s constantly on.
Intend to measure the voltage going on/off to the LED by using the adc platform.
So far I’m just testing with a battery (1.5v), the setup is as follows:

  • positive lead from battery to pin 32, negative to ground.
  • pulldown resistor between pin 32 and ground (5.1 kOhm)
  • Esp32 code, captive portal:
sensor:
  - platform: adc
    pin: 32
    name: "LED voltage"
    update_interval: 500ms
    raw: true
    
  - platform: pulse_meter
    pin: 32
    name: "Pulse meter"
    internal_filter: 100ms
    internal_filter_mode: EDGE
    timeout: 10000ms

Connecting the battery positive lead to the adc pin on and off gives output like below:

[14:48:56][D][sensor:094]: 'LED voltage': Sending state 0.00000 V with 2 decimals of accuracy
[14:48:57][D][sensor:094]: 'LED voltage': Sending state 0.00000 V with 2 decimals of accuracy
[14:48:57][D][sensor:094]: 'Pulse meter': Sending state 61.43424 pulses/min with 2 decimals of accuracy
[14:48:57][D][sensor:094]: 'LED voltage': Sending state 4095.00000 V with 2 decimals of accuracy
[14:48:57][D][sensor:094]: 'Pulse meter': Sending state 599.89801 pulses/min with 2 decimals of accuracy
[14:48:58][D][sensor:094]: 'LED voltage': Sending state 0.00000 V with 2 decimals of accuracy
[14:48:58][D][sensor:094]: 'LED voltage': Sending state 0.00000 V with 2 decimals of accuracy
[14:48:59][D][sensor:094]: 'LED voltage': Sending state 0.00000 V with 2 decimals of accuracy
[14:48:59][D][sensor:094]: 'LED voltage': Sending state 0.00000 V with 2 decimals of accuracy
[14:48:59][D][sensor:094]: 'Pulse meter': Sending state 29.75721 pulses/min with 2 decimals of accuracy
[14:48:59][D][sensor:094]: 'Pulse meter': Sending state 599.90399 pulses/min with 2 decimals of accuracy

So, to get to my actual question, I don’t really know yaml and I usually just copy and paste to get it working, what do I need to do to get the Pulse meter counter to work properly?

Why do I get the high ‘Pulse meter’ numbers even though I just opened/closed to circuit a few times?
(working properly would be counting the flashing of the LED which is about 60 on/off per minute when the dryer is finished).

I put a smart outlet in line with the power for my gas dryer. I am not sure if you have an electric dryer or what you would use in that case. Then, it is only a matter of monitoring the current draw and when it goes below 2-Watts, I could be alerted (not interested) or if it is that way for 15-minutes, the outlet turns off and saves me the vampire current.

You could allow the outlet to constantly be on if you wanted and just monitor current usage.

Thanks!
But, want to learn something in the process, there are a number of ways for reaching the target but using an ESP32 this way seems like more fun.

I used a temp/humidity sensor in the exhaust vent and get a notification when the air is below 32% humidity for at least 2 minutes. Seems to be the sweet spot for me. I’d imagine if it’s a blinking led, your update interval for the sensor will have to be really fast to catch the blink…

Im interested to hear what you figure out… Good luck!

Thanks.
The blinking is about 0.5s on - 0.5 off, so that shouldn’t be a problem, the ESP32 can measure much higher frequencies than that.
Responses in this forum seem a bit slow, don’t think I will get an answer here.
Might need to look somewhere else.

Hey :slight_smile:
I like your approach with “reading” the LED impulses…

maybe, I can help you out here, since I did a similar test-Setup bzt with a button push, because I wanted something similar to mearure the impulses from a Water Meter.

try the Pulse_Counter, instead of the Pulse_Meter

I don’t think, that it matters, that my code was previously for an ESP8266… with the correct platform, it should also work on an ESP32

esp8266:
  board: d1_mini #esp01_1m
  restore_from_flash: true
  early_pin_init: false

sensor:
  - platform: pulse_counter
    pin:
      number: GPIO13   # D7
      mode: INPUT_PULLUP
    update_interval : 1s
    name: "Test Water Meter"
    internal_filter: 100ms
    id: water_pulse_meter_cold
    device_class: water
    state_class: total_increasing
    unit_of_measurement: 'l/min'
    total:
      unit_of_measurement: 'l'
      name: 'Test Water Meter Kaltwasser'
      id: water_meter_liters_total
      filters:
        - multiply: 1  #(1 pulse per liter)  

binary_sensor:
  - platform: gpio
    name: pulse_counter_eg_input
    id: meter_eg_reading
    internal: true
    pin:
      number: GPIO13 # D7
    on_press:
      then:
        - light.turn_on: meter_eg_reading_light
    on_release:
      then:
        - light.turn_off: meter_eg_reading_light

light:
  - platform: binary
    id: meter_eg_reading_light
    internal: true
    name: "MeterReading-LED"
    output: light_eg_output

output:
  - id: light_eg_output
    platform: gpio
    pin:
      number: GPIO0
      inverted: true

So in my case, the PulseCounter is counting each time when close the button…

I had similar issues with the pulses counting up to “invalid” or not plausible readings - and I think, it was related with the time the contact was closed.

But TBH - I don’t have the device setup, and this config is a backup copy… I would need to setup a new ESP to test the behave and to see, if it can be changed to fullfill your requirements.

You can try the ESPHome Discord if you’d like a more interactive and faster support experience.

Thanks, I’ll look closer at your suggestions about the Pulse Counter (actually started with that but had no success there so tried the Pulse meter but I’ll revisit it)
Come to think of it, do I need the adc platform?
Could I just use a GPIO set for input? Making sure input voltage is below 3.3? (what is minimum voltage that can be detected?)

That’s what I would do.

My dryer has no electronics, so I attached a small buck transformer to the buzzer signal. So when the timer sends voltage (120v) to fire the buzzer, it then powers the transformer which produces a ~5vdv secondary output to an optocoupler (you don’t need to use an opto).

binary_sensor:
  - platform: gpio
    name: "Dryer Buzzer Alarm"
    pin:
      number: 33
      mode: INPUT_PULLUP
      inverted: true
    filters:
      - delayed_on: 5s

@ServiceXp @CChris , used pulse_counter instead as you suggested and GPIO was much more appropiate than adc.
What I got right now which works almost OK:

binary_sensor:
  - platform: gpio
    pin:
      number: 32
      mode:
        input: true
        pullup: true
      inverted: true
    name: "pulse"
    
sensor:
  - platform: pulse_counter
    pin: 32
    count_mode:
      falling_edge: increment
      rising_edge: disable
    name: "Pulse Counter"
    #use_pcnt: false
    update_interval: 10s
    #internal_filter: 100ms

When using the now commented (usepcnt false and internal filter) I get continous ON/OFF with any input from my side, anyone who can tell me why?

Also I’m a bit puzzled by the number “Pulse Counter” reports, if I do one “ON” with the external battery I might get 6 pulses / min reported which is correct but I can also get 18 or 36 pulses/min reported.

Might be more consistent when it’s used in the intended setup, will test a bit more before I do that though.