
#Esp32 enter deepsleep code
This is the code I used to reset all the pins: gpio_reset_pin(GPIO_NUM_0)

While the ULP is enabled the current consumption shoots up to ~230 ♚ and then decreases to 7 ♚ again when the ULP is in HALT-state (until its again woken up be the configured RTC period). ~7 ♚ current consumption (long term average). And finally also rtc_gpio_isolate(GPIO_NUM_2) does achieve the same result - but not when calling rtc_gpio_isolate() for all the other GPIO pins too.

BUT, Instead calling gpio_reset_pin() on all RTC GPIO PINS did resolve it! According to the docs this will "Reset an gpio to default state (select gpio function, enable pullup and disable input and output)."įurther research showed that I needed only to call gpio_reset_pin() for gpio_reset_pin(GPIO_NUM_2) (note not 12, but 2!) to achieve the same result. I believe due to floating input connections of pins in input mode or something like this. Since this did not work, I was calling this function for -ALL- RTC GPIOs, which seems to cause different issues for other pins. Espressif's docs or another Espressif example, also some non-Espressif code that I can't find right now). NOT WORKING: Calling rtc_gpio_isolate() for GPIO12 and GPIO15 is the suggested in the internet (e.g. rtc_gpio_isolate(GPIO_NUM_0 - …) - reduced current from ~84 ♚ to ~77 ♚ however the current then has a periodic sine pattern (seems to be 50 Hz interference from the power grid).rtc_gpio_force_hold_dis_all() - no effect on current drawn.adc_power_off() - no effect on current drawn (seems to be disabled by default).Without the ESP32 (but still the voltage regulator connected) the oscilloscope shows near 0A (<200nA, so this should be close enough) and when the ESP is connected and in deep sleep it measured ~77 ♚ or ~84 ♚ on average - depending on the some settings in software. So it directly converts the units correctly and displays the current that flows through the resistor. Hence, I set the oscilloscope to 1:0.01 probes and the channels unit to A(mpere).

#Esp32 enter deepsleep series

The ULP program is 5 instructions long (no loops) and finally calls 'HALT'. The program basically starts a ULP program, that has wakeup-period of 1 second set and then goes to deep sleep. I use an external 3.3V-linear regulator and I'm measuring the current that flows out of this regulator. I'm using a very minimalistic carrier board ( schematic) together with a WROOM32 ESP32-module, which has only 2 pull-up resistors for the 2 needed switches (RESET / GPIO0). However, the best I can achieve is about ~77 ♚ of current consumption. I tried to reduce the current consumption of a ESP32 in deep sleep with the ULP enabled.
