Different power consumption in sleep-modes !?

Moderators: grovkillen, TD-er, Stuntteam

Post Reply
Message
Author
Micha_he
Normal user
Posts: 140
Joined: 07 Feb 2018, 19:14

Different power consumption in sleep-modes !?

#1 Post by Micha_he » 27 Jan 2020, 18:27

Hardware: ESP-01 without power-led for my battery-powered window-contact. Wakeup only via RST.
Software: ESP_Easy_mega-20191208_normal_ESP8266_1M_VCC.bin (same with older versions)

If I configure the DeepSleep via 'Config/Sleep Awake Time', the ESP-01 goes into DeepSleep and need less than 20µA. All Ok.

Now I'll use the rules to publish some values and then go to DeepSleep with the Command 'DeepSleep,1' (zero doesn't work). The parameter 'Config/Sleep Awake Time' is reset to 0 and the rule put the ESP-01 to DeepSleep after some seconds. But the power consumption is ~13mA ! That's factor 650 more...

Is there a problem with the DeepSleep-command ???

seb82
Normal user
Posts: 51
Joined: 05 Sep 2018, 10:56

Re: Different power consumption in sleep-modes !?

#2 Post by seb82 » 28 Jan 2020, 10:34

deepsleep,1 will put the esp in deepsleep for ... 1s.

Look at the example in this documentation.
Sébastien - espRFLinkMQTT gateway RFLink MQTT on esp

seb82
Normal user
Posts: 51
Joined: 05 Sep 2018, 10:56

Re: Different power consumption in sleep-modes !?

#3 Post by seb82 » 28 Jan 2020, 10:37

If you want something really efficient for a door contact, you need to add an attiny13 or use another protocol (zigbee for example).
Sébastien - espRFLinkMQTT gateway RFLink MQTT on esp

Micha_he
Normal user
Posts: 140
Joined: 07 Feb 2018, 19:14

Re: Different power consumption in sleep-modes !?

#4 Post by Micha_he » 28 Jan 2020, 11:24

Yes, I know that. But the GPIO-16 is NOT connected to RST ! So it doesn't matter, if it sleep 1s or more... The ESP didn't wake up, that's sure.

And with the DeepSleep from the config-page, my two AA-batteries reach ~ 1 year, before I must change it. Without ATtiny13.

I assumed the command would do an identical DeepSleep, like the DeepSleep-configuration from the config-page.

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

Re: Different power consumption in sleep-modes !?

#5 Post by TD-er » 28 Jan 2020, 21:49

Maybe the ESP doesn't wake up, but the timer will trigger an alarm to wake up and I am not sure if that pulse will trigger every second, or maybe remains triggered.

What you can do is use an FET to power the ESP.
Connect the switch to trigger it over the FET and set a pin that's pulled up (e.g. GPIO2) to the gate.
Then the ESP will draw almost nothing when off (as little as the leaking current of the FET) and to let the ESP switch itself off, draw the GPIO pin low.

See for example: https://electronics.stackexchange.com/q ... th-esp8266
And a very nice tutorial on transistors: https://www.youtube.com/watch?v=Kvl-mR5gldw

N.B. by switching off like this, you will loose RTC information, so connecting to wifi may take a bit more time and you cannot refer to sensor values from before switching off.

Micha_he
Normal user
Posts: 140
Joined: 07 Feb 2018, 19:14

Re: Different power consumption in sleep-modes !?

#6 Post by Micha_he » 29 Jan 2020, 08:26

Nice idea with the FET-schematic....

But back to the real problem:

There is no difference between the comands "DeepSleep,1" and "DeepSleep,300" ! All over the (sleep-) time, the ESP needs 10-13mA. If you were right, it should be less in the second case, until the timer ends.

It appears, the ESP goes into a different sleep mode with the rule commands. Either because a timer is running or some other components (CPU, RTC, WIFI) are not disabled.

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

Re: Different power consumption in sleep-modes !?

#7 Post by TD-er » 03 Feb 2020, 14:38

I was thinking about this.
What if the sensors are indeed not put into some sleep mode, so not the ESP is to blame, but some of the sensors.

Can you test it with a unit without any external sensor connected?

Micha_he
Normal user
Posts: 140
Joined: 07 Feb 2018, 19:14

Re: Different power consumption in sleep-modes !?

#8 Post by Micha_he » 03 Feb 2020, 16:07

The ESP has no other sensors. Only two reed-contacts, one for the RST and one for close position.
And between the current-measuring-tests, I've nothing changed on the wiring. Here's the schematic:
FK001_Schaltplan.jpg
FK001_Schaltplan.jpg (24.44 KiB) Viewed 4122 times

Micha_he
Normal user
Posts: 140
Joined: 07 Feb 2018, 19:14

Re: Different power consumption in sleep-modes !?

#9 Post by Micha_he » 03 Feb 2020, 17:53

TD-er wrote:
28 Jan 2020, 21:49
Maybe the ESP doesn't wake up, but the timer will trigger an alarm to wake up and I am not sure if that pulse will trigger every second, or maybe remains triggered.
Sorry, my mistake (The second test-esp01 has a additional resistor at GPIO16). You're right!
While the sleeptime from the deepsleep-command, the ESP needs only ~20µA. But when the sleeptime is over, he needs ~13mA, forever... !

Then I'll have to wait, until the command 'DeepSleep,0' works.

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

Re: Different power consumption in sleep-modes !?

#10 Post by TD-er » 03 Feb 2020, 18:07

Can you measure what happens on GPIO16 after the sleep time is over?

I will have a look at the code to see what is the difference between going to sleep using the command and when it goes into deep sleep as interval.
What version are you running?
I thought I had changed something like this a few months ago, but apparently not enough?

User avatar
ThomasB
Normal user
Posts: 690
Joined: 17 Jun 2018, 20:41
Location: USA

Re: Different power consumption in sleep-modes !?

#11 Post by ThomasB » 03 Feb 2020, 19:18

Perhaps the serial log's Info Level will provide some useful information. That is to say, compare the sleep messages that appear during Config/Sleep Awake Time versus those you see in the Command DeepSleep. If they are different then post the logs for review.
Can you measure what happens on GPIO16 after the sleep time is over?
Good idea. FWIW, the logs will also report if GPIO16 has canceled/disabled the sleep operation. It is reported as:

Code: Select all

SLEEP: Deep sleep cancelled (GPIO16 connected to GND)
- Thomas

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

Re: Different power consumption in sleep-modes !?

#12 Post by TD-er » 03 Feb 2020, 19:52

I have noticed 2 differences in deep sleep behavior between normal deep sleep and when called from a command:

- Deep sleep from a command directly calls

Code: Select all

void deepSleepStart(int dsdelay)
- Deep sleep via the regular interval does only call deep sleep at the end of

Code: Select all

loop()
and it also does a check whether deep sleep is enabled.

The check for enabled deep sleep does:
- return false when deep sleep awake time is set to 0
- return false if GPIO-16 is low (by enabling pull up resistor on GPIO-16)
- else return true.

So maybe we should just keep track of a flag in memory which can be set from the rules command.
In this check for enabled deep sleep, we then need to have a look at this flag, which only will be set via this command.
Then the execution of going to sleep is exactly the same as when doing the regular sleep.

Micha_he
Normal user
Posts: 140
Joined: 07 Feb 2018, 19:14

Re: Different power consumption in sleep-modes !?

#13 Post by Micha_he » 24 Mar 2020, 13:48

TD-er wrote:
03 Feb 2020, 18:07
Can you measure what happens on GPIO16 after the sleep time is over?
When sleep-time (from command deepsleep,xxx) is over, the voltage level goes from ~Vcc to GND and stay there. That seems ok, because it should normally reset via RST (not wired in my circuit). But in this state, the ESP needs to much energy :(

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

Re: Different power consumption in sleep-modes !?

#14 Post by TD-er » 24 Mar 2020, 14:18

So during sleep it does consume the expected low current (roughly 60 uA) and after this the energy consumption rises even when the node does not boot?

This means we need to make the deep sleep command act the same as the regular deep sleep.

Micha_he
Normal user
Posts: 140
Joined: 07 Feb 2018, 19:14

Re: Different power consumption in sleep-modes !?

#15 Post by Micha_he » 24 Mar 2020, 14:33

TD-er wrote:
24 Mar 2020, 14:18
So during sleep it does consume the expected low current (roughly 60 uA) and after this the energy consumption rises even when the node does not boot?
Yes, that is right.

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 18 guests