Configure Deep Sleep on ESP12-F

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
ulfh2018
Normal user
Posts: 39
Joined: 19 Feb 2018, 06:11
Location: Oslo Norway

Configure Deep Sleep on ESP12-F

#1 Post by ulfh2018 » 29 Sep 2018, 10:31

I have been looking at how to configure deep sleep on my Wemos ESP12-F devices, but honestly spoken, I'm a bit confused. I have tried to follow some of the advices, but it all boiles down to the fact that I'm not sure if I have to do some hardware modifications on my devices (that is soldering a jumper, which was a part of https://www.instructables.com/id/Enable ... SP8266-01/.

I want to run the chips on batteries, and as it is now, the batteri is drained very fast. I'm feeding the chips via the micro usb interface, using 5 volt from a rechargable battery pack, which runs dry far too fast.

Can somone pleas help me sort this out?

Best regards

Ulf

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Configure Deep Sleep on ESP12-F

#2 Post by TD-er » 29 Sep 2018, 19:41

Apart from the sleep, did you also do other changes to the board?
For example the default voltage regulator used is not really efficient and the USB=>serial chip may also still be powered.
Also are the sensors still powered when in deep sleep? Depending on the sensor used, that may also add up quite a lot.

When running wifi, it will take about 70 - 80 mA (on 3.3V for the module, but also at 5V, since probably a linear voltage regulator is used)
In deep sleep, the module should be using less than a mA.
Getting connected to wifi will take 3 - 5 seconds on average. Running DHCP also may take the same amount of time.
And some sensors also need some time to get their first value.

Try to light a LED on boot (using rules for example) so you can make sure the board is actually starting only at the interval you'd expect.
And maybe another LED when powering down to deep sleep.

ulfh2018
Normal user
Posts: 39
Joined: 19 Feb 2018, 06:11
Location: Oslo Norway

Re: Configure Deep Sleep on ESP12-F

#3 Post by ulfh2018 » 29 Sep 2018, 22:24

No, I have not done any changes to the board.

I am taking power using the usb-plug, since the power source I have is 5V.

I am not using DHCP, but have hard coded the IP address.

I am powering the DTH22, which I use for getting the data I need, from the 5 volt pin on the board, and use GPIO 2 for reading the values, whitch are sent to a MQTT broker and displayed via Node-Red.

I am planning to let the device sleep for 10 minutes, maybe more, to save power, since the temperature and humidity will fall and rise slow.

Using LEDs to check the staus is a good idea - but have to wait a couple of days to implement, since I am a bit bussy this weekend.

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Configure Deep Sleep on ESP12-F

#4 Post by grovkillen » 29 Sep 2018, 22:35

ulfh2018 wrote: 29 Sep 2018, 22:24 I am taking power using the usb-plug, since the power source I have is 5V.

...

I am powering the DTH22, which I use for getting the data I need, from the 5 volt pin on the board, and use GPIO 2 for reading the values, whitch are sent to a MQTT broker and displayed via Node-Red.

...
The DTH22 is then powered constantly, just measure and you'll see that Vin is giving 5V and the same for the other output pins.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Configure Deep Sleep on ESP12-F

#5 Post by TD-er » 29 Sep 2018, 23:41

DTH22 may take up-to 1.5 mA if it is measuring.
I don't know if that sensor will be "not measuring" when the ESP is in deep sleep.
So worst-case scenario, it will be using 1.5 mA constantly.
The USB=> serial will also be powered and that one may use more than 1.5 mA

You can also calculate back what it must be using, by taking the accu capacity and the time it takes to empty that one.
But keep in mind the actual capacity is probably not what's stated on the box and it will stop probably before it is empty.
And those accu packs also don't use 100% efficient electronics and often have LEDs on constantly.
But a 3000 mAh pack should last over 100 hours when the ESP is in deep sleep (normal operations is > 30 mA)

ulfh2018
Normal user
Posts: 39
Joined: 19 Feb 2018, 06:11
Location: Oslo Norway

Re: Configure Deep Sleep on ESP12-F

#6 Post by ulfh2018 » 30 Sep 2018, 09:26

I have been reading that some folks claim to be able to run the ESP for a very long time using deep sleep. Would it be better to power the DTH22 using 3.3 volt, that is if the 3.3 volt pin is shut down during sleep? This means, off cours, I have to get deep sleep to work first - have to dig out som LEDs and do some checking on what's really happening.

Heiend
Normal user
Posts: 10
Joined: 07 Sep 2018, 16:33

Re: Configure Deep Sleep on ESP12-F

#7 Post by Heiend » 30 Sep 2018, 10:30

Supplying ESP-boards with power via USB is not a good idea. On most boards a LED is on to show the board is powered by USB and so on. I found that LLOLIN boards powered via the battery connector are running a very long time with battery. The same battery connected to the USB port is drained much faster. Just now a Lolin D1 Mini Pro runs with a 2000mah battery since 20 hours without sleeping. An other ESP32 LOLIN board runs for about 3 months on a 400mah lithium ion battery connected to the battery connector on deepsleep with wakeups every 90 min and sending a message to ifttt. I tried power supply at first via the usb port and the same battery drained within days.

But be carefull:
Concerning the battery on the lolin board, be aware that the polarity of the connector is not standardized. Make sure that ground on the board is really connected to ground on the battery cable before plugging the battery in, otherwise you'll have a fried board.

ulfh2018
Normal user
Posts: 39
Joined: 19 Feb 2018, 06:11
Location: Oslo Norway

Re: Configure Deep Sleep on ESP12-F

#8 Post by ulfh2018 » 01 Oct 2018, 12:22

I get the message, so I have ordered some LiFePO4 batteries, but still I have to make the deep sleep mode work.

I have tried with an esp8266 running on 3.3 volt, which seems to invoke deep sleep, but I have't connected any sensor, since I am missing some cables. The serial interface reports that the device will enter deep sleep, and I recon that's because there is no reading, but the devices connected via USB does not report anything, exept the readig from the sensors.

ulfh2018
Normal user
Posts: 39
Joined: 19 Feb 2018, 06:11
Location: Oslo Norway

Re: Configure Deep Sleep on ESP12-F

#9 Post by ulfh2018 » 01 Oct 2018, 20:41

Looks like I finally found a solution. This might be obvious for you folks, but it was not for me, and I had to do a lot of digging to find a hint.

Connecting D0 to RST made the trix, and I'll have to find my Digital Ampere Meter tomorrow, and make some testing on the power drain.

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Configure Deep Sleep on ESP12-F

#10 Post by TD-er » 01 Oct 2018, 22:29

Ah, yep that's needed to get the ESP to boot again from deep sleep.

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 30 guests