Power Savings / Sleep Help Needed

I'm really new to arduino and really could use some help. I recently designed a whole project and then found out that I could not power it long term via batteries. I believe my only choice is to use deep sleep (or some sort of power saving measures).

If things were perfect I would be able to wake up the system with either one of two buttons or the keypad. This guide [ In-Depth: ESP32 Deep Sleep & Wakeup Sources | Timer, Touch & External ] under "ESP32 Wake-up Source : External Wake-up" says I have to use esp_sleep_enable_ext1_wakeup because I want to use more than 1 button.

esp_sleep_enable_ext1_wakeup only allows the following two modes.

Wake up if one of the selected pins is HIGH (ESP_EXT1_WAKEUP_ANY_HIGH)
Wake up if all selected pins are LOW (ESP_EXT1_WAKEUP_ALL_LOW)

However both my buttons AND my keypad are pulled high to start and I have no idea how to stop that...I assume I can't.

Under the header "ext1 External Wake-up Source" it says "In order to use the internal pullup or pulldown resistors, we need to request the RTC peripherals to be kept on during sleep, and configure the pullup/pulldown resistors using the rtc_gpio_pullup_en() and rtc_gpio_pulldown_en() functions before entering sleep."

I don't really know what that all means but I figured I would include it in case it helps.

I would really appreciate any guidance you could provide. Thank you!

You should post your most actual complete sketch. This is very important to become a clear picture of what you want to do.

And then you should ask a specific question related to your code.

The website lastminutes engineers says
In order to use the internal pullup or pulldown resistors, we need to request the RTC peripherals to be kept on during sleep, and configure the pullup/pulldown resistors using the rtc_gpio_pullup_en() and rtc_gpio_pulldown_en() functions before entering sleep.

So this means

  //Go to sleep now
  Serial.println("Going to sleep now");
  // HERE is "before  entering sleep
  rtc_gpio_pullup_en(your_IO_Pin1);
  rtc_gpio_pullup_en(your_IO_Pin2);
  // etc.
  esp_deep_sleep_start();
  Serial.println("This will never be printed");

You should never design a final project without having analysed details and before having tested the code if everything works as expected.

It seems that using the external wakeup 1 which can do a wakeup from multiple IO-pins
and one of them must become high
or
all must be low

it seems it is not possible to have multiple buttons for wake up if you have them configured with pullup-resistors.
anyway: I would test if it IS possible in every case

best regards Stefan

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.