Can't activate deep sleep mode, all the time current consumption is 12mA
Hello,
I have bought this ESP8266 :
with the following piout :
this is the current link : http://www.aliexpress.com/item/2PCS-V3-4M-bytes-32Mbits-FLASH-NodeMcu-Lua-WIFI-Networking-development-board-Based-ESP8266-with-firmware/32368521069.html
So the problem is that I can't set it to deep sleep, the minimum consumption that I can obtain is 12mA on 3.8V. I made a link from DO(GPIO16) to RST and after deep sleep it restarts itself , but I can't get it to uA consumption, how it described in documentation.
Have you got any ideea, why I have this problem?
Thanks is advance.
this board has an USB to uart chip, this chip also consumes energy. where exactly do you measure the power consumption?
CH430:

I think that is the problem, I should think of a method to take that out and measure again. Thank you lot!
Ok, so after trying to unsolder VCC from CH430G, I get this :
the problem is that... after disconnecting the UART I get a consumption of 10mA and if I connect it again I get 10.1 mA...
The problem before was that I was supplying voltage to 3V pin and ground, now I'm supplying from VIN pin and GND
This is my code :
/*
- This sketch sends data via HTTP GET requests to data.sparkfun.com service. *
- You need to get streamId and privateKey at data.sparkfun.com and paste them
- below. Or just customize this script to talk to other HTTP servers. * */ //deep sleep include extern "C" { #include "ets_sys.h" #include "os_type.h" #include "osapi.h" #include "mem.h" #include "user_interface.h" #include "cont.h" } const uint sleep_timer_user = 1; // sleep in minutes ADC_MODE(ADC_VCC); #include <ESP8266WiFi.h> #include <OneWire.h> #include <DallasTemperature.h> #include <stdlib_noniso.h>
#define ONE_WIRE_BUS D1 // DS18B20 pin OneWire oneWire(ONE_WIRE_BUS); DallasTemperature DS18B20(&oneWire);
const char* ssid = ""; const char* password = "";
const char* host = "api.thingspeak.com"; const char* APIkey = "************";
float oldTemp;
void setup() { //system_deep_sleep_set_option(4); Serial.begin(9600); delay(10);
// We start by connecting to a WiFi network
Serial.println(); Serial.println(); Serial.print("Connecting to "); Serial.println(ssid);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) { delay(500); Serial.print("."); }
Serial.println(""); Serial.println("WiFi connected"); Serial.println("IP address: "); Serial.println(WiFi.localIP()); }
void loop() {
float temp;
DS18B20.requestTemperatures(); temp = DS18B20.getTempCByIndex(0); Serial.print("Temperature: "); Serial.println(temp);
char charVal[12];
dtostrf(temp, 8, 2, charVal);
Serial.print("connecting to "); Serial.println(host);
// Use WiFiClient class to create TCP connections WiFiClient client; const int httpPort = 80; if (!client.connect(host, httpPort)) { Serial.println("connection failed"); return; }
// We now create a URI for the request String url = "/update?key="; url += APIkey; url += "&field1="; url += charVal;//String(temp);
Serial.print("Requesting URL: "); Serial.println(url);
// This will send the request to the server client.print(String("GET ") + url + " HTTP/1.1\r\n" + "Host: " + host + "\r\n" + "Connection: close\r\n\r\n"); delay(10);
// Read all the lines of the reply from server and print them to Serial while (client.available()) { String line = client.readStringUntil('\r'); Serial.print(line); }
Serial.println(String("Voltage = ")+ ESP.getVcc() +String(" V")); Serial.println("closing connection"); //WiFi.mode(WIFI_OFF); //delay(900000); //wifi_set_sleep_type(NONE_SLEEP_T); //system_deep_sleep_set_option(4); //Serial.print("wifi Sleep type = "); //Serial.println(wifi_get_sleep_type());
//ESP.deepSleep(sleep_timer_user_60_1000_1000); // ESP.deepSleep(sleep_timer_user_60_1000_1000,WAKE_RF_DEFAULT); //19mA with step-up // ESP.deepSleep(sleep_timer_user_60_1000_1000,WAKE_RFCAL);//19mA with step-up //ESP.deepSleep(sleep_timer_user_60_1000_1000,WAKE_NO_RFCAL);//19mA with step-up ESP.deepSleep(sleep_timer_user_60_1000*1000,WAKE_RF_DISABLED);//19mA with step-up }
So after some measurements I found this consumption on different deep sleep modes : //ESP.deepSleep(sleep_time);//12mA without UART //ESP.deepSleep(sleep_time,WAKE_RF_DEFAULT); //31mA without UART //ESP.deepSleep(sleep_time,WAKE_RFCAL);//12.4 mA without UART //ESP.deepSleep(sleep_time,WAKE_NO_RFCAL);//10-10.3mA working wifi after reset without UART //ESP.deepSleep(sleep_time,WAKE_RF_DISABLED);//10-10.3mA working wifi after reset without UART
I couldn't activate deep sleep for a consumption of uA... maybe this board have some regulators that consume 10mA, but I don't know. If anyone can give me a tip.
Thanks.
yes biggest 3 PIN component looks like a regulator, shut make 5V to 3V3. the board looks more or less like the nodemcu excepted the power supply.

i only use the ESP12 and ESP7 boards directly with my custom boards. never had a problem with it. have you a schematic for you board?
you can try to unsolder the 3V3 pin of the LDO (regulator) and attache the ampere-meter there.
Does this board have LEDs? They're a power drain...
I agree with what Markus is saying - you won't minimise the power consumption with a load of bells and whistles on the board.
On 24 August 2015 at 20:37, Markus [email protected] wrote:
yes biggest 3 PIN component looks like a regulator, shut make 5V to 3V3. the board looks more or less like the nodemcu excepted the power supply.
[image: IMG] https://raw.githubusercontent.com/nodemcu/nodemcu-devkit/master/Documents/NODEMCU_DEVKIT_SCH_BIG.png
i only use the ESP12 and ESP7 boards directly with my custom boards. never had a problem with it. have you a schematic for you board?
you can try to unsolder the 3V3 pin of the LDO (regulator) and attache the ampere-meter there.
— Reply to this email directly or view it on GitHub https://github.com/esp8266/Arduino/issues/719#issuecomment-134332636.
Well thanks for the support, after a lot of soldering and re-soldering and desoldering a lot of pins :) I finally get where the problem was. 1)the problem is not the UART chip, it has some sleep mode which enters. 2)the regulator is the problem it uses power.
To make it simple, all you need to do for deep sleep is to cut PIN 1, and supply directly the ESP12-E.
In my case, I used o wire for the pin1 and a wire to the solder pad of pin1, in this case when I need to program it over USB where I have 5V, I just connect the wires and it regulates the voltage to 3.3, but when it runs stand-alone, I disconnect and it enters sleep mode.

So the final consumption is 250-270uA in deep sleep, I will try to cut down the UART chip in order to have a lower consumption, but today it is enough.
Again, thank you @Links2004 for interest.
Hi!
I took a stab at reproducing your work and wasn't able to get the current value below 7.8 mA.
The code I'm using is as follows: ` #include <ESP8266WiFi.h>
int pin=2;//wifi LED since you can't use the builtin LED because it's being used for wakeup (it's D0 = 16)
void setup() { WiFi.mode( WIFI_STA ); pinMode(pin, OUTPUT); // Initialize the pin as an output
}
// the loop function runs over and over again forever void loop() { digitalWrite(pin, LOW); // Turn the LED on (Note that LOW is the voltage level // but actually the LED is on; this is because // it is acive low on the ESP-01) delay(3000); // Wait for a second digitalWrite(pin, HIGH); // Turn the LED off by making the voltage HIGH
//put into deep sleep for awhile
ESP.deepSleep(9000000, WAKE_RF_DISABLED); // Sleep for 9 secs `
The following relates to a NodeMCU ver 1
I unsoldered Pin 1 from the voltage regulator from the circuit board and added two jumpers. One jumper from the pad of the voltage regulator to the ground on a 3.7V battery. The other jumper on Pin 1 of the voltage regulator is hanging loose. I then added a jumper from the ESP8266 module per your photograph to the positive side of the battery. The code runs well and the current is as follows:
80mA on startup (that's the wifi module pulling that). The wifi module blue light illuminates due to the program pulling pin 2 low.
It appears to enter deeps sleep and the current is 7.8 mA.
9 seconds later it comes out of deep sleep and pulls 25 mA. There is a flicker in the onboard LED (due to wakeup) and the wifi led glows solid and bright.
The unit then goes into sleep and the current is 7.8 mA. The last two steps repeat.
I can't seem to locate the source of the 7.8 mA drain. I have tried unsoldering the regulator completely and that does not reduce the current.
which board are you using? If it is one equipped with a usb2serial chip that is powered from the 3v, e.g. nodemcu v1 using CP2102, then this is the source also try using 2xaa batteries a 3.7v lipo battery gives 4+v when charged. and if you are bypassing the voltage regulator the module gets lots of voltage
On Wed, Apr 20, 2016 at 5:02 AM, dmody [email protected] wrote:
I unsoldered Pin 1 from the voltage regulator from the circuit board and added two jumpers. One jumper from the pad of the voltage regulator to the ground on a 3.7V battery. The other jumper on Pin 1 of the voltage regulator is hanging loose. I then added a jumper from the ESP8266 module per your photograph the positive side of the battery. The code runs well and the current is as follows:
80mA on startup (that's the wifi module pulling that). The wifi module blue light illuminates due to me pulling pin 2 low.
It appears to enter deeps sleep and the current is 7.8 mA.
9 seconds later it comes out of deep sleep and pulls 25 mA. There is a flicker in the onboard LED (due to wakeup) and the wifi led glows solid and bright.
The unit then goes into sleep and the current is 7.8 mA. The last two steps repeat.
I can't seem to locate the source of the 7.8 mA drain. I have tried unsoldering the regulator completely and that does nothing.
— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/esp8266/Arduino/issues/719#issuecomment-212208979
@dmody : well there is the usb-to-serial converter, you must cut it's power too. I will try to do it myself the next week, and put out a clear tutorial.
@vlast3k : after bypassing the regulator and cut power of usb-to-serial (CH430G in my case), I get from ADC port around 3.6-3.7V, when battery is fully charged 4.2V. It worked for me this way for about, 8months. I know it's not ok, because from 3.3V to 4.2V it's a long way, but for me it works.
@luciancerbu87, in fact do you need to cut the voltage regulator? What i did was to supply the power directly via the 3.3 v input. But on the nodemcu v1 i was still getting around 15ma, and this is why i suspected the CP2101 so i switched to the nodemcu v0.9 with the CH340g, which is powered from the 5v line, and then i got 90 ua i supposed in your case the 240 ua, are due to you are powering it with higher voltage and it consumes a bit more, but if worked for so long time - apparently it is not that weak :)
Basically, I think you'd be better to use a different module - what you're trying to do is start from a very complete module and strip away everything that's using power, why not start with a basic module that doesn't have any of the extras?
I'm running an ESP-12, with the LEDs removed, in deep sleep mode, waking every ten minutes, and the current is too low for my multimeter to read when it's sleeping. There's nothing but the basics so it should be around the quoted 7.8uA (if that includes the Flash chip).
Start with the absolute minimum and add the parts you need - thay way you know you're not powering anything you don't need.
On 20 April 2016 at 14:02, vlast3k [email protected] wrote:
In fact do you need to cut the voltage regulator? What i did was to supply the power directly via the 3.3 v input. But on the nodemcu v1 i was still getting around 15ma, and this is why i suspected the CP2101 so i switched to the nodemcu v0.9 with the CH340g, which is powered from the 5v line, and then i got 90 ua i supposed in your case the 240 ua, are due to you are powering it with higher voltage and it consumes a bit more, but if worked for so long time - apparently it is not that weak :)
— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/esp8266/Arduino/issues/719#issuecomment-212397458
Great advice everyone. Thanks so much!
@duncan-a You're probably right. My approach was to keep the part count to a minimum to reduce the time debugging due to my lack of knowledge. I could see myself in need of a prototyping board that you can plug the ESP-12 module into easily, do some programming and testing, then pull it out for final testing and use. Does anyone know of such a beast?
You can't "plug the ESP-12 module" easily (if you're thinking breadboards) as they're 2mm spacing (as are most of the others).
You could use one of these (but fit 8-way stackable, long-pin, female headers, not the male headers supplied - they span the whole space on a breadboard).
http://www.banggood.com/ESP-07-ESP8266-Serial-WIFI-Module-with-IO-Adapter-Plate-p-980652.html
I have a couple of these which I prototype with and then design a PCB for a soldered ESP-12 (or an ESP-07 on the rare occasions I want an external antenna).
Remember that you'll need a USB-FTDI adaptor too.
On 20 April 2016 at 20:35, dmody [email protected] wrote:
Great advice everyone. Thanks so much!
@duncan-a https://github.com/duncan-a You're probably right. I could see myself in need of a prototyping board that you can plug the ESP-12 module into easily, do some programming and testing, then pull it out for final testing and use. Does anyone know of such a beast?
— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/esp8266/Arduino/issues/719#issuecomment-212549857
Well, I guess I see a nice business opportunity. :)
If you mean for breakout boards that are narrower, I've done that but never had them manufactured - if you mean for a board using "Pogo Pins" or something to hold an ESP-07/12/12E temporarily, I'm working on it...
I suspect the ESP-32 will probably take over quite a lot but, with two processors, minimum current will be higher, plus there are all the new additions which may take a toll.
On 20 April 2016 at 20:59, dmody [email protected] wrote:
Well, I guess I see a nice business opportunity. :)
— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/esp8266/Arduino/issues/719#issuecomment-212558929
re: 'fakir' board with pogo pins, there was such a thing featured on hackaday a while back. I ordered the pogo pins (about 1$ for 50!) but didn't go as far as making anything than fiddle with them...
re: ESp-32, the beta boards are 1mm pitch, that's going to get beyond what regular DIYselfers like me can solder with their sturdy fingers...
Ah, also, there have been designs floating around where the ESP is powered through a switchable regulator (or maybe also a FET, if I recall well) controlled by a RTC chip. Typically, the ESP tells the RTC to switch its power off and re-wake up (power-on) later.
Re the pogo pins ESP board, see this: http://hackaday.com/2016/01/24/truly-versatile-esp8266-wifi-webcam-platform/
re: RTC clock controlling ESP's power: http://www.esp8266.com/viewtopic.php?f=13&t=5747