ESP32 external pin wakeup with internal pullup resistor

mtwellmann
Posts: 1
Joined: Thu Nov 15, 2018 2:04 pm

ESP32 external pin wakeup with internal pullup resistor

Postby mtwellmann » Thu Nov 15, 2018 2:12 pm

I also posted this on StackExchange (https://arduino.stackexchange.com/quest ... p-resistor)

I am very new to working with Arduino and any kind of circuits.

I am trying to set up an ESP32 board to wake up with an external trigger by using the command `esp_sleep_enable_ext0_wakeup`
  1.     void setup(){
  2.         int MY_PIN = 13;
  3.         pinMode(MY_PIN, INPUT_PULLUP);
  4.  
  5.         int reading = digitalRead(MY_PIN);
  6.         if(reading == 1) {
  7.             esp_sleep_enable_ext0_wakeup(GPIO_NUM_13,0);
  8.         }
  9.         else {
  10.             esp_sleep_enable_ext0_wakeup(GPIO_NUM_13,1);
  11.         }
  12.  
  13.         // I want the board to wake up every time the state of the switch changes.
  14.  
  15.         esp_deep_sleep_start();
  16.     }
I run into troubles with this. The wakeup doesn't happen when I expect it to. I assume it has to do with using an external pull-up resistor. I didn't connect one.

Is there a way to use the internal pull-up resistor for this purpose?

I would appreciate anyone who could explain how this works in general.

The documentation[1] says:
@note This function does not modify pin configuration. The pin is configured in esp_sleep_start, immediately before entering sleep mode.
Maybe I need to configure it correctly with `esp_sleep_pd_config`. Could that be the reason for the pullup resistor not working?

https://github.com/espressif/arduino-es ... sp_sleep.h

Who is online

Users browsing this forum: No registered users and 60 guests