Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deep sleep with gpio button wake up - 6mA current? #289

Open
BootsSiR opened this issue Nov 26, 2024 · 3 comments
Open

deep sleep with gpio button wake up - 6mA current? #289

BootsSiR opened this issue Nov 26, 2024 · 3 comments
Labels

Comments

@BootsSiR
Copy link

BootsSiR commented Nov 26, 2024

When I use the following code to put my LilyGo T-Display S3 into deep sleep, my meter is showing 6.4 mA of current draw using the onboard button as a GPIO wake up. I was expecting much less. Am I missing something?

// draws 6.42mA asleep and 147.7mA awake
void sleep() {
    if (!_isSleeping) {
        ESP_LOGI(TAG, "Going to sleep... night night");
        _isSleeping = true;

        // Configure GPIO button as wake-up source
        esp_sleep_enable_ext0_wakeup((gpio_num_t)PIN_BUTTON_2, 0); // 0 for active low (button press)
        
        gpio_set_pull_mode((gpio_num_t)PIN_BUTTON_2, GPIO_PULLUP_ONLY);

        // kill the LCD power and backlight
        gpio_set_direction((gpio_num_t)LCD_PIN_POWER, GPIO_MODE_OUTPUT);
        gpio_set_direction((gpio_num_t)LCD_PIN_BK_LIGHT, GPIO_MODE_OUTPUT);

        gpio_set_level((gpio_num_t)LCD_PIN_POWER, 0);
        gpio_set_level((gpio_num_t)LCD_PIN_BK_LIGHT, 0);

        // Enter deep sleep
        esp_deep_sleep_start();
    }
}
lewisxhe added a commit that referenced this issue Nov 27, 2024
lewisxhe added a commit that referenced this issue Nov 27, 2024
@lewisxhe
Copy link
Contributor

Look at the information I submitted, the screen needs to be set to sleep

@BootsSiR
Copy link
Author

@lewisxhe now drawing 263 µA in deep sleep. Much better! Thank you 👍

Copy link

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Dec 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants