

To put the ESP8266 in deep sleep, you use ESP.deepsleep(uS) and pass as argument the sleep time in microseconds.
#Deepsleep studio serial
In this example, we print a message in the Serial Monitor: Serial.println("I'm awake, but I'm going into deep sleep mode until RESET pin is connected to a LOW signal") Īfter that, the ESP8266 goes to sleep for 30 seconds. Serial.println("I'm awake, but I'm going into deep sleep mode until RESET pin is connected to a LOW signal") Deep sleep mode until RESET pin is connected to a LOW signal (for example pushbutton or magnetic reed switch) Serial.println("I'm awake, but I'm going into deep sleep mode for 30 seconds") Deep sleep mode for 30 seconds, the ESP8266 wakes up by itself when GPIO 16 (D0 in NodeMCU board) is connected to the RESET pin
#Deepsleep studio code
Here’s the code that you need to upload to your ESP: /*
#Deepsleep studio how to
Having the ESP8266 add-on for Arduino IDE installed ( how to Install the ESP8266 Board in Arduino IDE), go to Tools and select “ NodeMCU (ESP-12E Module)”. That means that GPIO 16, when connected to the RST pin, can wake up the ESP8266 after a set period of time. If you set a deep sleep timer with the ESP8266, once the timer ends, GPIO 16 sends a LOW signal. However, when the RST pin receives a LOW signal, it restarts the microcontroller. The RST pin of the ESP8266 is always HIGH while the ESP8266 is running. Recommended reading: ESP8266 Pinout Reference Guide Simply follow the next schematic diagram: To use timer wake up with ESP8266, you need to connect the RST pin to GPIO 16 which is labeled as D0, in a NodeMCU board.

Everything is always off, except the Real Time Clock (RTC), which is how the ESP8266 keeps track of time.

In this article, we’ll cover deep sleep mode. They all have different purposes and they should be used in different applications. If you’re using a development board, they have passive components that use more current. Note: the power consumption on the table refers to the ESP8266 as a standalone chip. The table below shows the differences between each mode (information from the ESP8266 datasheet). There are three different types of sleep mode: modem sleep, light sleep, and deep sleep. Having the ESP8266 in deep sleep mode means cutting with the activities that consume more power while operating (like Wi-Fi) but leave just enough activity to wake up the processor when something interesting happens. If you put your ESP8266 in deep sleep mode, it reduces power consumption and your batteries will last longer.
