ESP8266 draws 9.6mA when in DeepSleep mode. Can't figure out why

Hello! I've made a program that triggers a webhook virtual button to notify me when my dog has to go potty. Dog is trained to ring a bell but the bell is far away for me to hear. I've rigged a vibration sensor that completes a circuit on motion from the sensor and turns on the RST pin and begins running my program. My program runs and then goes to DeepSleep mode.

The problem is that I've read that DeppSleep mode is supposed to use around 0.02mA and my program is pulling 9.6mA when in DeepSleep mode (around 80mA when running the program). What have I messed up that is not allowing me to enter DeepSleep mode correctly?

Here is my code

//Untested version.

#include <ESP8266WiFi.h>            // Library for WiFi
#include <ESP8266Webhook.h>         // Library for Webhook
#include <WiFiUdp.h>

#define SSID "Wi-Fi SSID"        // Your WiFi SSID
#define PASSWORD "Password"    // Your WiFi Password
#define KEY "Weebhooks-Key"     // Webhooks Key (from IFTTT)
#define EVENT "vibration_sensor"         // Webhooks Event Name

Webhook webhook(KEY, EVENT);    // Create an object.

void setup() {
  pinMode(LED_BUILTIN, OUTPUT);     // Initialize the LED_BUILTIN pin as an output
  Serial.begin(9600);               // Set serial to 115200 just because it's what I am used to
  Serial.setTimeout(1000);          // Timeout set to 2 seconds to give board time to boot then send message
  while(!Serial) { }                // Wait for serial to initialize.
  Serial.println("I have started up. WiFi next...");
  Serial.setTimeout(2000);          // Timeout set to 2 seconds to give board time to boot then send message
  digitalWrite(LED_BUILTIN, LOW); // Turn off the LED — NEW!!
  //webhook.trigger();
    // Connect to Wi-Fi
  WiFi.begin(SSID, PASSWORD);
  while (WiFi.status() != WL_CONNECTED) {    // Sends dots when it is not connected.=
    delay(500);
    Serial.print(".");
  }
  Serial.println("");
  Serial.println("WiFi connected!");          // Send message once connected
  webhook.trigger();
  delay(1000);

  // Disconnect WiFi before sleep
  WiFi.disconnect(); //NEW!!
  delay(100);

  
  ESP.deepSleep(0);
  delay(1000);
}

void loop() {}

Here is a schematic

Here is another schematic

Here is the real unit

What stabilizer are you using? It may be his consumption. Do you have any LED's that light up on the board itself? If you have such an LED, it also draws current. I haven't done a battery project with consumption minimization but I see other people starting with hardware changes by removing the regulator and any other consumers like LEDs and interface chips (USB to UART for example).

Neither of your drawings are schematics. Please Google to find examples of real schematics and you will see that they use certain symbols for components, each component is labelled with its part number and value, if it has one, and every pin is named and labelled.

Please post a real schematic. Hand drawn is fine so long as it is neat and readable. Also post links to the specs of the components.

You say you are using an esp8266 but that's like saying you drive to the office in a 2.5L 6-cylinder internal combustion engine. The car you drive to work may have an internal combustion engine in it, but different cars are very different to each other. We need to know what esp8266 board you have.

From your diagram, it looks like it may be a NodeMCU development board. These often have, but not always, an ams1117 regulator on board. These regulators have a quiescent current of 5~10mA. That means they waste 5~10mA even when no current is being drawn from them.

Your diagram also shows a "regulator", with no label, and for some reason only 2 of it's 3 pins are used, we don't know which pin is which. This circuit makes little sense, please explain it.

1 Like

The 0.02mA might be about right for the ESP8266 module itself.

But you have a board with an ESP8266 and other components such as the voltge regulator and the CP2102 USB to serial chip.

Just because you put the ESP8266 itself into a deep sleep it does not follow that all the other devices go into a deep sleep as well.

2 Likes

you are using a nodemcu which draws more power than a barebone ESP8266.

Get a barebone ESP8266 12E.

2 Likes

@srnet & @noiasca

You're right. My boards is not optimized for low power mode. I went into a small rabit hole and found that in this tutorial this person was finding the same issue and found that there are special-low-power boards.

That led me to finding this special board which features "Support Low Power Consumption" and specifies that "DC Current in the Low-Power-Consumption: 46uA"

Do you think swapping out this board should do (most) of the trick??

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.