


Hardware Connections = Push Button to GPIO 33 pulled down with a 10K Ohm resistor NOTE: = Only RTC IO can be used as a source for external wake source. Tried to control from HA to manage deepsleep in ESP32 board.
MQTT ENTER DEEPSLEEP HOW TO
* Deep Sleep with External Wake Up = This code displays how to use deep sleep with an external trigger as a wake up source and how to store data in RTC memory to use it over reboots This code is under Public Domain License.
MQTT ENTER DEEPSLEEP SOFTWARE
wake_on_ext0() supply the wakeup pin which is IO PIN 36 which we configured as input and wakeup any high means any type of button touch (LOW OR HIGH) the board will wakeup.Īfter configuring the button, it's safe to continue writing the software and when we ready to put the board to sleep we can use epsleep() to enter deep sleeping state, once the button is pressed the board will restart and initialize the program again. We've integrated a special button on the top right side of the Eduponics mini board, it's just a simple button that is connected to IO PIN number 36, technically this button can be used for anything but we've decided to dedicate it for a special use which is waking up from deep sleep.īefore we go into deep sleep we must set a wake up input, failing to do so will cause our board to go into infinite loop where it wakes up and goes back to sleep. In our tutorial we'll focus on waking up by push of a button, this is useful if you want to check sensors data on the Eduponics mini board by pressing it from time to time let's say when you come home every day, this can be extremely beneficial for the battery life if you power the board with an external battery. touch pins - waking up by connecting touch button to the board.External wakeup - we'v dedicated a "wakeup" button on the Eduponics mini board for this purpose.Timer - using ESP32 internal RTC to count and wakeup after x seconds.There are multiple ways that ESP32 can wakeup from a deep sleep, such as: A scope capture of this process looks as follows: Scope capture of the esp32 waking from deep sleep and doing pub-sub with an MQTT server over TLS. This feature is very specific to the ESP32 other boards such as Arduino or Raspberry Pi don't have this deep sleep functionality thus not suitable for outdoor / battery powered applications. With a custom and carefully designed board you can get a minimal consumption of about 5 μA. When operating in deep sleep mode, the board have a current consumption on the μA range. Having the board in deep sleep mode means cutting with the activities that consume more power while operating but leave just enough activity to wake up the processor when something interesting happens. This simple project is to show cheap TEMPERATURE/HUMIDITY/PRESSURE sensor that uses ESP8266, I2C sensor, MQTT push of values, deep-sleep - GitHub - martinvomacka.

If you put the board in deep sleep mode, it will reduce the power consumption and your batteries will last longer. Having the Eduponics Mini ESP32 board running on active mode with batteries it’s not ideal, since the power from batteries will drain very quickly.
