TD;LR

Connect XPD_DCDC to RESET.

ESP-01 and ESP0-01s are both miniature and cheap IOT modules which has a full TCP layer powered by ESP8266 chip with inbuilt Wifi. Without a doubt this chip consumes alot of power. Unless you got plenty of spare batteries to change at least twice a day, with this chip it’s nearlly impossible to make a module which can be powered by batteries.

This is where Deep Sleep mode kicks in!

What is deep sleep

This is a state where you can put the whole chip in sleep and inactive, except for the RTC (Real time clock). This makes the chip consumes around 80 MicroAmps and with 2 AAA batteries you can run the module for 3 years. YES, you heard me right. it’s almost 3 years of battery life.

Though the chip ESP8266 has the ability to support Deep sleep. Unfortubately, our ESP-01 or ESP-01s doesnt unless we do this small hack. To be precise, our module can goto deep sleep, but cannot wake up. It will just sleeps to death until you reset (put the RESET pin LOW) the module.

So how do you get this done ?

ESP8266 has a special pin (PIN16) XPD_DCDC, which pulls down (sets to LOW) when RTC signals the completion of deep sleep after specified time interval. So we need to soilder this pin XPD_DCDC to the RESET pin, so that our module can restart on it’s own. Makes sense right?

Luckily the XPD_DCDC pin resides in a corner where you can soilder it a bit easier than if it had been in middle of the chip.

Soilder the reset pin first and point the other corner of the wire to chip’s last pin. When I did that I used to get the wire’s corner already sticked with a little bit of tin lead and then stick it to the chip while applying the heat. But, it’s up to you to decide which is easier for you.

As you can see this connection is extremly fragile. So get a heat gun and cover it up as a precaution.

sample code to run

#include <Arduino.h>

int num_seconds_to_sleep = 5;

void setup() {
Serial.begin(9600);
Serial.println("in setup()");
pinMode(D0,WAKEUP_PULLUP);
}

void loop() {
Serial.println("in loop()");
// go to sleep, default mode (keep RF active)
ESP.deepSleep(num_seconds_to_sleep * 1000000, RF_DEFAULT);
}