ESP32 cannot wake from deepsleep

Hello,

I’m getting a strange issue with my autonomous water level for my well based on ESP32 and esphome.

I’m able to set the deepsleep mode on it, and it will work for few hours (like 12 hours in my last test), however it randomly cannot wake from deepsleep. In this case I have to remove the battery and and it again and it will go back for work for some hours etc…

In this case the ESP32 will blink a lot on the led positoned between G0 and G2.

This is a draw of the installation :

And there is the yaml code I use

esphome:
  name: water-level-2
  friendly_name: water-level-2

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "*********"

ota:
  password: "*******"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Water-Level-2 Fallback Hotspot"
    password: ""******"

captive_portal:


deep_sleep:
  run_duration: 10min
  sleep_duration: 30min


binary_sensor:
  - platform: status
    name: "Water-Level Status"


sensor:
  - platform: ultrasonic
    trigger_pin: 25
    echo_pin: 26
    name: "puit hauteur"
    id: measured_distance
    accuracy_decimals: 4
    update_interval: 30s

  - platform: uptime
    name: "Water-Level Uptime"  
    update_interval: 60s

  - platform: wifi_signal
    name: "Water-Level WiFi Signal"
    update_interval: 120s

  - platform: adc
    pin: GPIO35
    id : "ADCV"
    name: "Water-Level Battery V"
    update_interval: 60s
    attenuation: 11db
    filters:
      - multiply: 1.292
  
  - platform: template
    name: "Water-Level Battery %"
    unit_of_measurement: '%'
    update_interval: 60s
    lambda: |-
      return ((id(ADCV).state -3.30) /0.82 * 100.00);

switch:
  - platform: restart
    name: "Water-Level Restart"
    

The ADC part do not appear in my draw because I have removed it to see if the issue is coming from here, but I still got the issue without the voltage divider.

I have tried to keep all the circuit inside my house (ie without solar panel input) and I also got the same issue (and battery was ~3,80V).

I have also tried to use the DC booster to 5V to power only the sensor HC SR04 and use a voltage regulator at 3.3V to power the ESP32, but also got the same issue.

I don’t have any issue without the deepsleep, but of course I’m getting a battery empty at some point

I have replaced the ESP32 with a new one, and the same for TP4056 but got the same error also.

I am on the last version of HA and ESP Home firmware.

I don’t really know what is happening, I wish you can help me on this :slight_smile:

Thanks!

1 Like

How about with nothing attached and powered by usb?

I have tried by removing the HC-SR04 (so only the USB cable coming from the DC booster).
But still got the issue after few sleep/wake with this link blinking constantly :

If I plug a power supply from the TP4056, there is no issue with the deepsleep on the ESP (but of course the objective is to use the battery)

Thanks for your help

I don’t know.

Try/add another ground?

https://esp32.com/viewtopic.php?t=5440#p39550

I have tried with another ground but with no luck.

I have tried with another model of DC booster and it seems to works now for more than 24h, I will wait a bit more to be sure but I think my previous DC booster was damaged or not doing the job properly.

1 Like