Deep Sleep issue

jagpreetw
Posts: 2
Joined: Thu Jan 31, 2019 1:41 pm

Deep Sleep issue

Postby jagpreetw » Fri Feb 01, 2019 3:41 pm

Hi

Can someone check my code for deep sleep. I am unable to get it below 9mA. Please help

#define uS_TO_S_FACTOR 1000000 /* Conversion factor for micro seconds to seconds */
#define TIME_TO_SLEEP 3 /* Time ESP32 will go to sleep (in seconds) */

RTC_DATA_ATTR int bootCount = 0;

int GREEN_LED_PIN = 25;
int YELLOW_LED_PIN = 26;

void setup(){

pinMode(GREEN_LED_PIN,OUTPUT);
pinMode(YELLOW_LED_PIN,OUTPUT);
delay(500);

if(bootCount == 0) //Run this only the first time
{
digitalWrite(YELLOW_LED_PIN,HIGH);
bootCount = bootCount+1;
}else
{
digitalWrite(GREEN_LED_PIN,HIGH);
}

delay(3000);

digitalWrite(GREEN_LED_PIN,LOW);
digitalWrite(YELLOW_LED_PIN,LOW);

esp_sleep_enable_timer_wakeup(TIME_TO_SLEEP * uS_TO_S_FACTOR);
esp_deep_sleep_start();
}

void loop(){

}

jubueche
Posts: 32
Joined: Sat Jan 19, 2019 4:03 pm

Re: Deep Sleep issue

Postby jubueche » Sun Feb 03, 2019 4:04 pm

What board do you have? Here: https://github.com/espressif/esp-idf/bl ... ple_main.c it states that you need to isolate the pin GPIO12 from the circuit in order to minimize current consumption. This applies to eg Wrover kit.
Quite often the current is high on dev boards (eg Adadfruit Huzzah) since there are other components on there consuming constant current like eg the UART bridge.

Who is online

Users browsing this forum: Bing [Bot] and 100 guests