Deep sleep wake-up triggered by low to high logic level of GPIO
Posted: Tue Jun 27, 2017 8:20 pm
Hi all
I am currently integrating the ESP32 in a solar powered lamp. Basically, the ESP32 is powered by the onboard lipo battery and it actually works fine. With a Mosfet I am controlling the ESP32 so it is only active when the solar lamp is switched on ie. it is dark enough. That way, the ESP32 is not using the battery as it would if being in the deep sleep mode and the solar charging is not influenced by any current draw.
But when ESP32 is activated and boots up it checks first to see the cause for wake-up and find that it is not wake-up triggered and immidiatedly goes into deep sleep to preserve power. I set deep sleep the usual way like this...
This is approach is ok except the PIN_TO_TRIGGER_FROM maintains it high level for a period of around 40 seconds ie. it is not pulsating as would be the prefered case. This means that when ESP32 has finished its job and send back to deep sleep it will once more be triggered by a wake-up because the PIN_TO_TRIGGER_FROM is still high. It will continue like this until the PIN_TO_TRIGGER_FROM goes low. This causes the battery to be depleted sooner in an nonoptimized way in that ESP32 while it operates uses around 110 mA. So would I do is to have the ESP32 finish off what it is set to do and then wait for a predefined period of around 40 secs (to match the time it takes PIN_TO_TRIGGER_FROM to go low) by means of vTaskDelay to keep ESP32 as idle as possible.
I would like to use the power draw much more efficient than this so my question to you is - is it possible to enable the wake up triggering from a pin by means of a logic level transition from low to high only (identical to GPIO_PIN_INTR_POSEDGE basically) so that a continued high level will not trigger a wake-up over and over again?
Thanks...
I am currently integrating the ESP32 in a solar powered lamp. Basically, the ESP32 is powered by the onboard lipo battery and it actually works fine. With a Mosfet I am controlling the ESP32 so it is only active when the solar lamp is switched on ie. it is dark enough. That way, the ESP32 is not using the battery as it would if being in the deep sleep mode and the solar charging is not influenced by any current draw.
But when ESP32 is activated and boots up it checks first to see the cause for wake-up and find that it is not wake-up triggered and immidiatedly goes into deep sleep to preserve power. I set deep sleep the usual way like this...
Code: Select all
esp_deep_sleep_enable_ext0_wakeup(PIN_TO_TRIGGER_FROM, STATE_THE_PIN_SHOULD_HAVE_FOR_IT_TO_TRIGGER_WHICH_IS_HIGH)
I would like to use the power draw much more efficient than this so my question to you is - is it possible to enable the wake up triggering from a pin by means of a logic level transition from low to high only (identical to GPIO_PIN_INTR_POSEDGE basically) so that a continued high level will not trigger a wake-up over and over again?
Thanks...