ESP8266 Support WIKI

User Tools

Site Tools


esp8266_power_usage

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
esp8266_power_usage [2015/06/16 08:58]
tytower [Deep Sleep Mode]
esp8266_power_usage [2016/07/05 18:38] (current)
tumik Fixed formatting
Line 29: Line 29:
 There is a modification to be made – both in hardware and software – to get current consumption low. On the firmware end, the Espressif SDK has made a ''​system_deep_sleep([uint32_t time_in_us])''​ function available, which puts the ESP8266 to sleep for a specified number of microseconds. When it wakes up, it begins running the user program from the very beginning. If you’re using the ESP8266 Arduino IDE, they’ve wrapped that function and another into a very nice ''​ESP.deepSleep([microseconds],​ [mode])''​ function. Here’s a quick example Arduino sketch for the ESP8266 that blinks the on-board LED 10 times, sleeps for 60 seconds, then repeats. There is a modification to be made – both in hardware and software – to get current consumption low. On the firmware end, the Espressif SDK has made a ''​system_deep_sleep([uint32_t time_in_us])''​ function available, which puts the ESP8266 to sleep for a specified number of microseconds. When it wakes up, it begins running the user program from the very beginning. If you’re using the ESP8266 Arduino IDE, they’ve wrapped that function and another into a very nice ''​ESP.deepSleep([microseconds],​ [mode])''​ function. Here’s a quick example Arduino sketch for the ESP8266 that blinks the on-board LED 10 times, sleeps for 60 seconds, then repeats.
 <​code>​ <​code>​
 +
 #include <​Ticker.h> ​    // Ticker can periodically call a function #include <​Ticker.h> ​    // Ticker can periodically call a function
 Ticker blinker; ​        // Ticker object called blinker. Ticker blinker; ​        // Ticker object called blinker.
Line 56: Line 57:
 </​code>​ </​code>​
  
-There are couple modifications to be made: one required, one suggested. ​To wake itself up, the ESP8266 uses the XPD pin to trigger its reset line on the rising edge , so those two pins need to be connected together. Wiring up XPD to DTR works. ( Note there is a small capacitor between them on Sparkfuns Thing board on the DTR line)+To wake itself up, the ESP8266 uses the XPD pin to trigger its reset line so those two pins need to be connected together. ​XPD_DCDC connects to EXT_RSTB with 0R\\  
 +Wiring up XPD to DTR works. ( Note there is a small capacitor between them on Sparkfuns Thing board on the DTR line)
  
 ===== More data from expressif =====  ===== More data from expressif ===== 
  
-can be found at \\ [[http://​bbs.espressif.com/​download/​file.php?​id=253&​sid=398301f84155a628a3a39725226e7379|http://​bbs.espressif.com/​download/​file.php?​id=253&​sid=398301f84155a628a3a39725226e7379]]+can be found at \\ [[http://​bbs.espressif.com/​download/​file.php?​id=253&​sid=398301f84155a628a3a39725226e7379|http://​bbs.espressif.com/​download/​file.php?​id=253&​sid=398301f84155a628a3a39725226e7379]]//  
 +[[http://​bbs.espressif.com/​viewtopic.php?​f=21&​t=645|http://​bbs.espressif.com/​viewtopic.php?​f=21&​t=645]]//​
  
 An extract from which deals with deep sleep \\ An extract from which deals with deep sleep \\
  
-==== **__6.system_deep_sleep__** ​==== +====  6.system_deep_sleep  ​==== 
  
 **__Function:​__** \\    Configures chip for deep-sleep mode. When the device is in deep-sleep, it automatically wakes up periodically;​ the period is configurable. Upon waking up, the device boots up from user_init.\\ **__Function:​__** \\    Configures chip for deep-sleep mode. When the device is in deep-sleep, it automatically wakes up periodically;​ the period is configurable. Upon waking up, the device boots up from user_init.\\
Line 73: Line 76:
 system_deep_sleep(0):​ there is no wake up timer; in order to wakeup, connect a GPIO to pin RST, the chip will wake up by a falling-edge on pin RST\\ system_deep_sleep(0):​ there is no wake up timer; in order to wakeup, connect a GPIO to pin RST, the chip will wake up by a falling-edge on pin RST\\
  
-=== **__7.system_deep_sleep_set_option__** ​===\\+====  7.system_deep_sleep_set_option ​ ====  
  
 **__Function:​__** \\     Call this API before system_deep_sleep to set what the chip will do when deep-sleep wake up.\\ **__Function:​__** \\     Call this API before system_deep_sleep to set what the chip will do when deep-sleep wake up.\\
Line 83: Line 86:
 deep_sleep_set_option(4):​ Disable RF after deep-sleep wake up, just like modem sleep; this has the least current consumption;​ the device is not able to transmit or receive data after wake up.\\ deep_sleep_set_option(4):​ Disable RF after deep-sleep wake up, just like modem sleep; this has the least current consumption;​ the device is not able to transmit or receive data after wake up.\\
 **__Note:​__** ​ \\     Init data refers esp_init_data_default.bin.\\ **__Note:​__** ​ \\     Init data refers esp_init_data_default.bin.\\
-Return: true : succeed ​ false : fail\\+**__Return:__**\\ 
 + true : succeed........ ​ false : fail   //  
 +    
 +  ​
  
esp8266_power_usage.1434445119.txt.gz · Last modified: 2015/06/16 08:58 by tytower