-->
Page 1 of 1

bare ESP8266 deep sleep failing

PostPosted: Tue Dec 22, 2020 12:35 am
by mh-g
I cannot get a bare ESP8266EX into deep sleep. It always consumes about 8-9 mA (not uA). The setup is minimal, only GND, VCC are connected externally and REST and GPIO16 are shortened. RX and TX are connected to a USB-serial converter (CP210x), which also supplies 3V3.

The current is measured using a multimeter at 200mA setting between VCC and 3V3 from the USB-converter.

The following code is used in Arduino:
Code: Select all#define DEEP_SLEEP_TIME 5 // seconds

// === main ==========================================================================
void setup() {
  // serial port
  Serial.begin(115200);
  while(!Serial);    // time to get serial running
 
  Serial.println("Powered on");
  delay (2000); // around 70mA at this point
  Serial.println("Going into deep sleep mode!");

  delay(100);
  Serial.end();
 
  ESP.deepSleep(DEEP_SLEEP_TIME * 1e6);
  delay(100);
}

void loop() {
}


In previous tests, I also had WiFi enabled and considered commands like:
WiFi.config(staticIP, gateway, subnet);
WiFi.persistent( false );
WiFi.mode( WIFI_STA );
WiFi.disconnect(true);
WiFi.mode( WIFI_OFF );
wifi_set_sleep_type(MODEM_SLEEP_T); // LIGHT_SLEEP_T
WiFi.forceSleepBegin();
ESP.deepSleep(DEEP_SLEEP_TIME * 1e6); // also WAKE_RF_DISABLED as 2nd parameter

What is wrong here?

Re: bare ESP8266 deep sleep failing

PostPosted: Tue Dec 22, 2020 5:36 pm
by btidey
It's not a good idea to use the 3v3 from the cp2102 to power the esp8266. There are pulses of current demand going up to 400mA which far exceed the capability of the cp2102 to supply.

Use a separate 3v3 regulator from the 5V supply to provide 3v3.

For testing I would use a longer sleep interval than 5 seconds. The code can be taking several seconds to reach the deep sleep code so a 5 second sleep period will still mean the average consumption is quite high and makes it more difficult to assess on the meter.

Re: bare ESP8266 deep sleep failing

PostPosted: Fri Jan 01, 2021 1:59 am
by mh-g
Thanks for the advice! I replaced the CP2102 serial converter with an FTDI FT232RL serial converter, supply the power from an external 2A power supply. Furthermore the timing has been changed to 5s on and 15s deep sleep. All works fine now.