ESP8266 Deepsleep

Download as xlsx, pdf, or txt
Download as xlsx, pdf, or txt
You are on page 1of 11

https://www.youtube.com/watch?

v=Q8GT-GBH7o
https://randomnerdtutorials.com/esp8266-deep-s
1. ESP8266 Deep Sleep with Timer Wake Up
The RST pin of the ESP8266 is always HIGH while th
RST pin receives a LOW signal, it restarts the mcu.
If you set a deep sleep timer with the ESP8266, on
signal. That means that GPIO 16, when connected
after a set period of time.

To put the ESP8266 in deep sleep, you use ESP.dee


time in microseconds. 30e6 corresponds to 30,000
seconds.
For ESP-01 Timer Wake Up Circuit - see the same w
Maximum deep sleep is 4,294,967,295 MICROSECO
just reboots, because the variable gets the maximu

2. ESP8266 Deep Sleep with External Wake Up


This code puts the ESP8266 in DSp mode for an ind
to pass 0 as an argument to the deepSleep() functi

# Schlumberger-Private
# Schlumberger-Private
e.com/watch?v=Q8GT-GBH7ok ESP8266 NodeMCU Timer Wake Up Sketch
tutorials.com/esp8266-deep-sleep-with-arduino-ide/ void setup() {
Serial.begin(115200);
ep with Timer Wake Up Serial.setTimeout(2000);
SP8266 is always HIGH while the ESP8266 is running. However, when the
OW signal, it restarts the mcu. // Wait for serial to initialize.
ep timer with the ESP8266, once the timer ends, GPIO 16 sends a LOW while(!Serial) { }
hat GPIO 16, when connected to the RST pin, can wake up the ESP8266
time. // Deep sleep mode for 30 seconds, the ESP8266 wakes up b
connected to the RESET pin
n deep sleep, you use ESP.deepsleep(uS) and pass as argument the sleep Serial.println("I'm awake, but I'm going into deep sleep mod
s. 30e6 corresponds to 30,000,000 microseconds which is equal to 30 ESP.deepSleep(30e6);

ake Up Circuit - see the same web-page above. }


void loop() {
p is 4,294,967,295 MICROSECONDS(~71.5 minutes). After that the board
e the variable gets the maximum number possible. }

ep with External Wake Up ESP8266 External Wake Up Sketch


void setup() {
SP8266 in DSp mode for an indefinite period of time. For that, you just need Serial.begin(115200);
ment to the deepSleep() function: Serial.setTimeout(2000);

// Wait for serial to initialize.


while(!Serial) { }

// Deep sleep mode until RESET pin is connected to a LOW s


Serial.println("I'm awake, but I'm going into deep sleep mod
ESP.deepSleep(0);
}

void loop() {
}

# Schlumberger-Private
# Schlumberger-Private
e Up Sketch

onds, the ESP8266 wakes up by itself when GPIO 16 (D0 in NodeMCU board) is

I'm going into deep sleep mode for 30 seconds");

T pin is connected to a LOW signal (for example pushbutton or magnetic reed switch)
I'm going into deep sleep mode until RESET pin is connected to a LOW signal");

# Schlumberger-Private
https://www.youtube.com/watch?v=IYuYTfO6iOs Good Video

I'm using pushover to receive messages directly to my phone from some projects. it is a paid app but totally worth it (is "free"
up to a limit and you need to buy the client app). Try to look at Pushbullet. Its free.
Problem with the code: You should be using static_cast<float>(ESP.getVcc()) , since ESP.getVcc() returns a uint16_t, otherwise
uint16_t values.
const float VCC_ADJ(0.00104);
float voltage((float)ESP.getVcc() * VCC_ADJ);
I tested it now and verified with a volt meter, so it should be pretty accurate now.

Hello, anyone watching this in 2019 - I believe the now preferred LDO(LowDropOut) regulator is the Holtek HT7833. The HT7
using a little bit more of the battery's full capacity by going as low as 3.6 volts
Question, the maximum voltage supplied by two AA batteries would effectively be 3.0V (the min voltage the ESP8266 requires
battery capacity/voltage starts dropping (I believe for a single battery, the voltage can be effective at 1.3V), does this mean yo
capacity of the AA batteries? Any suggestions for utilizing more of the batteries' capacities if I were to go this route, perhaps a

One thing you forgot to mention was the 0 ohm short (located under your cap). needs to be removed when a regulator is used

Do i have to use a tantalum capacitor or can i just use an electrolytic one at 1000uf 6v?
I ran into an unexpected problem w/ LiFePo4 batteries. I wanted to use one to avoid the need for a V reg-r. ESP8266 ran great
didn't supply enough V for the DHT22 I was using. To get around, I'm going to add a V reg-r and use 2 1/2AA Li-Ion batteries in
Is there any better way around this? Does anyone know if the DHT21 will work at 3.2 volts?

to power ESP8266 from LiPo18650 I will use HT7333 for stabilisation - it means that only part of 18650 capacity will be used, c
work at 3,45 V (3.3+dropdown). But lower level of V on 18650 (fully discharged) is about 2.5 V. How to use it's capacity from 3
Can U use external RTC and completely turn off power from ESP8266 ? In this case it can drain 80mA just for sending data and
remaining time. This means that from Li-ion battery w/ 100mAh such combination would work ~ 150 days with 1 hour period o

I use a 18650 battery with the HT7333, ESP will be powered w/ 3.3V if battery V is higher than 3.39V, right? In this case, ESP.ge
always return same value and it would not be possible to accquire "real" battery state, right? As there is no regulation below 3
decreasing further and then it would be possible to warn user w/ a battery low message, e.g. at let's say 3V. Is this how you do

I have worked with the esp8266-12e for a while, I love them, but for my sensor project I needed a bit more range and batteryl
esp8266 as a base station sending all recieved data to internet and using talk2 whisper nodes for my sensor work, they use su
communication, which gives far better range, and have great battery life (run on 1 cr2032 coincell for weeks) they are a great
currently writing a blogpost on them on www.Thomaslang.nl

would you still recommend a 1000uF capacitor on the power line? All the datasheets that I can find for these capacitors show
least 40uA which would seem to negate the advantage of using the efficient HT7333. Perhaps a 300 or 100uF power line capa
sufficient? It would be great if you could do a video about this.

One issue I read about was leakage current for electrolytic caps being very high (like mA range scaling with capacitance). Do y
what the leakage current is for the tantalums you used?

received HT7333's. do I need to remove the middle resistor on the other side of the board if I solder the HT7333? And where d

After lots of searching (and testing) I found there are 2 types of boards. 1 has a 0Ω resistor (000 code) and the other board has
boards have different capabilities. If for instance you want to use 5V on the 0Ω board you need to remove the resistor. If you w
the 10KΩ board you need to remove the resistor and wire the 2 connections points together (to create a 0Ω connection). I wil
more with different configurations and supply voltages and if I find anything interesting I will post it here.

# Schlumberger-Private
After lots of searching (and testing) I found there are 2 types of boards. 1 has a 0Ω resistor (000 code) and the other board has
boards have different capabilities. If for instance you want to use 5V on the 0Ω board you need to remove the resistor. If you w
the 10KΩ board you need to remove the resistor and wire the 2 connections points together (to create a 0Ω connection). I wil
more with different configurations and supply voltages and if I find anything interesting I will post it here.

the maximum that am seeing is 72 minutes with micropython, have you used a different timer lets say for 8 hours or more?

# Schlumberger-Private
p but totally worth it (is "free" to send notifications

returns a uint16_t, otherwise you are using only

I learned this from one of my viewers after the video.

the Holtek HT7833. The HT7830 might be good for

n voltage the ESP8266 requires), which means as the Watch video #64
ve at 1.3V), does this mean you are not using the full
ere to go this route, perhaps a step-up regulator?

moved when a regulator is used in normal operation. I discovered, that there are different white boards available

watch my video #91. Yes, you can. Sometimes it's even better.
or a V reg-r. ESP8266 ran great, but the LiFePo4 There are temp sensors like BMP180 which run on lower voltages
use 2 1/2AA Li-Ion batteries in the AA/14500 holder. if you need 3.3volt stable, then your plan with a linear regulator
is good.
18650 capacity will be used, cause HT7333 will stop
How to use it's capacity from 3.45v to 2.5v ?
0mA just for sending data and about 5uA in I thought about that myself and came to the conclusion, that it is possible. But it is m
~ 150 days with 1 hour period of sending data. energy used in the active period is much bigger compared to sleep energy for device
only small. If you sleep longer, you have to have a reliable RTC and also a way to set
cases uses more space and is more expensive than just use a bigger battery. There is
hungry sensors which are read only once a day. I will cover that case in a future vide

39V, right? In this case, ESP.getVcc() method will


there is no regulation below 3.39V, the V will start
let's say 3V. Is this how you doit? better connect ADC pin via a V divider directly to battery. So you always get V of the

a bit more range and batterylife, I ended up using


r my sensor work, they use sub GHZ RF
ell for weeks) they are a great combination, I'm

find for these capacitors show a leakage current of at watch a video #91 on LDO(LowDropOut reg-tors) and capacitors.
300 or 100uF power line capacitor would be

1000uf tantalum has 25uA current on 3.3v, the 220uF tantalum has no measurable l
caling with capacitance). Do you have an idea of much bigger leaking current, but fortunately, not as big as you said. But, for sleep m
You can also add an inductor to help the (smaller) capacitor.
lder the HT7333? And where do I connect VCC? On my board I have three pins on the opposite (2nd) side of the ESP module for the
board was empty when I got it I just soldered the chip to the board. I did not have to
The one I have has 2 10k resistors to pull-up CH_EN and to pull-down GPIO2. The thi
code) and the other board has a 10KΩ resistor. Both pin on the edge of the PCB and VCC of the ESP module. If you replace it with a 0 ohm
to remove the resistor. If you want to use 3.3V on not present at all). The regulator can be soldered to the bottom of the board.
create a 0Ω connection). I will experiment a bit
st it here.

# Schlumberger-Private
code) and the other board has a 10KΩ resistor. Both
to remove the resistor. If you want to use 3.3V on
create a 0Ω connection). I will experiment a bit
st it here.

ets say for 8 hours or more? The ESP8266 cannot do more. You have to handle the issue with EEPROM counter o

# Schlumberger-Private
ailable

en better.
on lower voltages

on, that it is possible. But it is more valuable if you sleep longer (e.g. one day) cause
pared to sleep energy for devices which send every minute or so. Its effect therefore is
iable RTC and also a way to set its time. This is rather complicated and in most of the
st use a bigger battery. There is, however, a mixed scenario where you use power
cover that case in a future video.

ttery. So you always get V of the battery, not only below 3.3 V

F tantalum has no measurable leaking C. So, you are partially right: bigger one has
big as you said. But, for sleep mode, it's important cause it is the same as ESP itself

side of the ESP module for the HT7333 with the right pin configuration. Because my
p to the board. I did not have to remove anything.
and to pull-down GPIO2. The third 10k resistor in the middle is connected to the VCC
le. If you replace it with a 0 ohm resistor (or a bridge) then the regulator is bridged (or
he bottom of the board.

# Schlumberger-Private
he issue with EEPROM counter or RTC RAM

# Schlumberger-Private

You might also like