ESP32 Deep Sleep constantly wakes up

Good day

I have an ESP32 with a motion, binary touch, and temperature and humidity sensor connected to it. My aim is to put my ESP32 into deep sleep mode and only wake up when the binary touch button (it does ON or OFF) is pressed.

My problem is that my ESP32 doesn’t go to sleep and when it does it wakes up every few seconds.

I suspect this could be the same as this post:

Because of that post I tried the following config on my touch button:

binary_sensor:
  - platform: gpio
    pin: 
      number: GPIO14
      mode: INPUT_PULLUP

I noticed that when I hold in my touch button, so that it stays ON always, my ESP32 will go into deep sleep until I let go of the button; so some progress was made.

Because it goes into deep sleep when the button is ON, also added this config but no luck.

wakeup_pin_mode: INVERT_WAKEUP

I suspect that I need to connect a pullup resistor to my breadboard, but I do not know how to exactly. My ESP32 is on a breadboard with jumpers going from its 3v and ground to the breadboard power rail.
My button power and ground is connected to this power rail. My button data PIN is connected to GPIO14.
I am not sure exactly where to put the pullup resistor or if it is actually the problem?

Here is my current full config:

esphome:
  name: play-esp32
  platform: ESP32
  board: esp32dev

# Enable logging
logger:

# Enable Home Assistant API
#api:

# I am using MQTT, not the API
mqtt:
  broker: 192.168.90.146
  username: xxx
  password: xxx


ota:
  password: "xxx"

wifi:
  ssid: "xxx"
  password: "xxx"
  manual_ip:
    static_ip: 192.168.10.74
    gateway: 192.168.10.1
    subnet: 255.255.255.0
  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Play-Esp32 Fallback Hotspot"
    password: "xxx"

captive_portal:


sensor:
  - platform: dht
    pin: GPIO15
    temperature:
      name: "Living Room Temperature"
    humidity:
      name: "Living Room Humidity"
    model: dht11
    update_interval: 10min


binary_sensor:
  - platform: gpio
    pin: GPIO14
    name: "Binary Touch Sensor"
  - platform: gpio
    pin: GPIO26
    name: "PIR Sensor"
    device_class: motion
    
    
deep_sleep:
    run_duration: 30s #will stay awake for 30 seconds after waking up
    sleep_duration: 5min #will wake up automatically after this much time
    wakeup_pin: GPIO14 #PIN 14 will wake it up
    wakeup_pin_mode: KEEP_AWAKE
    id: deep_sleep_1
   

I do have some logs as well so please let me know if logs will help.

Thank you

1 Like

I don’t think the ESPHome touch wakeup will work after looking at the code.
If you are still working on it, join me at the Github issue discussion: