To test this setup, wire a pushbutton to your ESP8266 board as shown in the following schematic diagram. You just need to put the ESP8266 in deep sleep mode for an indefinite period of time, and then set the RST pin to LOW to wake it up. You can also wake up the ESP8266 with an external wake up, like the press of a button or a reed switch. Recommended reading: ESP8266 Pinout Reference #2 ESP8266 Deep Sleep with External Wake Up However, the pins are so tiny that it is really hard to solder a wire like that to GPIO 16 on the ESP-01… So, for this wake up mode you should use the NodeMCU board or a bare ESP12-E chip. That tiny pin is GPIO 16 and it needs to be connected to RST pin. If you want to make a similar setup with an ESP-01 board, you need to solder a wire as shown below. This example simply prints a message in the Serial Monitor, but in a real world application, you’ll perform a useful task like making a request, publish sensor readings, etc. The ESP8266 should wake up every 30 seconds and print a message in the Serial Monitor as shown below. In this case, 30e6 corresponds to 30000000 microseconds which is equal to 30 seconds.Īfter uploading the code, press the RST button to start running the code, and then connect RST to GPIO 16. To put the ESP8266 in deep sleep, you use ESP.deepsleep(uS) and pass as argument the sleep time in microseconds. Here’s the code that you need to upload to your ESP: 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 If you take a look at the NodeMCU pinout, you can see that GPIO 16 is a special pin and it has a WAKE feature. Simply follow the next schematic diagram:Ĭonnect the RST pin to GPIO 16 only after uploading the code. 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.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |