Reducing Deep Sleep wake-up time in ESP8266

Here is a little data on how boot mode can make a difference in ESP8266 deep sleep wakeup current consumption and matter a lot in ultra low power applications built around non-rechargeable batteries.

No boot

esp8266 wakeup time deep sleep with no boot

Setup time: 140 ms

This seems to produce the best results when used with deep sleep. The deep sleep wake up power consumption behavior is shown here.
Note: RF cal is disabled (option = 2)

Boot v.1.6

esp8266 wakeup time deep sleep with boot 1.6

Setup time: 155 ms

Not too much saved here, compared to the no boot version, but the deep sleep wakeup time is slightly longer, this could mean a lot in ultra low power application, especially when deep sleep is performed frequently.

Boot v.1.7

esp8266 wakeup time deep sleep with boot 1.7

Setup time: 155 ms

Boot v.1.7 performs the same as v.1.6, the deep sleep wakeup time is not too different. It is fairly easy to conclude that it is not worth changing the boot version to achieve lower power consumption.

The test program

Test code for ESP8266 deep sleep wakeup measurement
#include "osapi.h"
#include "user_interface.h"

// This function executes before WiFi is set up
void user_rf_pre_init (void)
{
  system_deep_sleep_set_option (2);   // No RF cal on wake-up
  // 1: Vdd and TX power, 18 ms
  // 2: Vdd only, 2 ms
  // 3: Full cal, 200ms
  system_phy_set_powerup_option (2);
  system_phy_set_rfoption (2);

  wifi_set_opmode (NULL);
}

// MAIN CODE
void user_init(void)
{
      system_deep_sleep_instant (1000000);    // Sleep for 10s
}

******************************************************************************
*******************************************************************************/
uint32 ICACHE_FLASH_ATTR
user_rf_cal_sector_set(void)
{
    enum flash_size_map size_map = system_get_flash_size_map();
    uint32 rf_cal_sec = 0;

    switch (size_map) {
        case FLASH_SIZE_4M_MAP_256_256:
            rf_cal_sec = 128 - 5;
            break;

        case FLASH_SIZE_8M_MAP_512_512:
            rf_cal_sec = 256 - 5;
            break;

        case FLASH_SIZE_16M_MAP_512_512:
        case FLASH_SIZE_16M_MAP_1024_1024:
            rf_cal_sec = 512 - 5;
            break;

        case FLASH_SIZE_32M_MAP_512_512:
        case FLASH_SIZE_32M_MAP_1024_1024:
            rf_cal_sec = 1024 - 5;
            break;

        default:
            rf_cal_sec = 0;
            break;
    }

    return rf_cal_sec;
}

Conclusion

Ultra low power products such as those operating on non-rechargeable batteries are not really expected to self-update their firmware over time. For such one-time applications, it is helpful to use no boot and resort to using a small flash memory with non-upgradable firmware as a trade off for slightly longer battery life.

Designing a low power ESP8266 application?

We can help you achieve the lowest power consumption and meet battery life specifications of your choice by not just coding techniques but also by designing hardware that operates on low quiescent current. Low power design is more of an art than engineering!

Contact us if you need any design assistance with any embedded design!

Leave a Reply