I am writing a simple code on Heltec ESP32 v2 board and want to make it deep sleep till an external signal got from PIR.
For this GPIO_NUM_27 pin as input.
But the problem is although the pir is not connected to the pin 27 it wakes up in 2-2.5 seconds I also changed it to low but no affect.
I have tried the same with 33 there is no problem or 19.
The code is like
void setup(){
//WIFI Kit series V1 not support Vext control
Heltec.begin(false /DisplayEnable Enable/, true /LoRa Disable/, true /Serial Enable/, true /PABOOST Enable/, BAND /long BAND/);
//Increment boot number and print it every reboot
++bootCount;
Serial.println("Boot number: " + String(bootCount));
delay(2);
//Print the wakeup reason for ESP32
print_wakeup_reason();
Serial.println(“Setup ESP32 to sleep for every " + String(TIME_TO_SLEEP) +
" Seconds”);
delay(100);
LoRa.end();
LoRa.sleep();
delay(100);
pinMode(5,INPUT);
pinMode(14,INPUT);
pinMode(15,INPUT);
pinMode(16,INPUT);
pinMode(17,INPUT);
pinMode(18,INPUT);
pinMode(19,INPUT);
pinMode(26,INPUT);
pinMode(27,INPUT);
delay(100);
Serial.println(“Going to sleep now”);
delay(2);
esp_sleep_enable_ext0_wakeup(GPIO_NUM_27,1);
delay(1000);
esp_deep_sleep_start();
Serial.println(“This will never be printed”);
}