Page 1 of 1

deep sleep problem need help

Posted: Sun Nov 07, 2021 3:50 pm
by moetaz
hello
i building esp8266 with breakout board logger

i use the RTC to adjust logging time and date

i try to use this function to implement the deep sleep mode
def deep_sleep(msecs):
rt = machine.RTC()
rt.irq(trigger=rtc.ALARM0, wake=machine.DEEPSLEEP)
rt.alarm(rtc.ALARM0, msecs)
machine.deepsleep()

the system before deep sleep use 74 mA
but after enter un deep sleep and try to walk up
the power consumption go to be 32 mA
and the system going to freeze
i connect RST with GPIO 16
also the RST is connected from the board itself to VCC with res 10 K

and suggestion to how to solve this

Re: deep sleep problem need help

Posted: Mon Nov 08, 2021 9:16 pm
by Roberthh
I tried this command sequence with my Wemos D1 Mini, and it works well. The device comes up properly after deep sleep. Commands used (just yours):
import machine
rtc= machine.RTC()
rtc.irq(trigger=rtc.ALARM0, wake=machine.DEEPSLEEP)
rtc.alarm(rtc.ALARM0, 30000)
machine.deepsleep()

Re: deep sleep problem need help

Posted: Tue Nov 09, 2021 12:06 am
by moetaz
when i try to do this code
this is the result
rr$r$ and some symbol not can copy it
and the esp8266 freeze

please note
i use it without any support board so i direct connect GPIO 16 to RST

i think the issue is hardware or it need some resistor or something like this

what you suggest

Re: deep sleep problem need help

Posted: Tue Nov 09, 2021 7:18 am
by Roberthh
In addition to the Pull-up at Reset you need at least a pull-up at GPIO0. With GPIO0 low at Reset the device will go into bootloader mode. Pull-Up Resistors at GPIO2, EN are helpful as well, and a pull-down at GPIO15. The EN pin can be used to switch the device on/off.

Re: deep sleep problem need help

Posted: Tue Nov 09, 2021 2:12 pm
by moetaz
i do all but still the same issue

i think the problem come from pin 16
the negative pulse is too short so it doesn't make the rst down

Re: deep sleep problem need help

Posted: Tue Nov 09, 2021 2:49 pm
by Roberthh
It works with my ESP8266. How long is the Reset pulse? You could add a 100nF capacitor between reset and GND. That extends the pulse a little bit.

Re: deep sleep problem need help

Posted: Tue Nov 09, 2021 8:23 pm
by moetaz
capacitor idea not working

i think about transistor that can work on the negative pulse from gpio16
so will connect rst to gnd direct

do have idea about this transistor

Re: deep sleep problem need help

Posted: Tue Nov 09, 2021 8:42 pm
by Roberthh
A single transistor will not work. And it would not extend the pulse width.
I'm still wondering why the GPIO16 to RST connection does not work. Do you have any tool to measure the existence and length of the pulse? A simpe 10$ logic analyzer would be suitable for that.

Re: deep sleep problem need help

Posted: Tue Nov 09, 2021 10:21 pm
by moetaz
i found this issue with a lot of user especially with esp produced from espressif Co.
but with ESp from AI co. deep sleep work
i will post this discussion

but at the moment hard rest work with chip , deep sleep not walk up the chip

so i try to find cheap solution to reduce the power consumption

that why i go to transistor to test

do you have any other advice

Re: deep sleep problem need help

Posted: Tue Nov 09, 2021 10:25 pm
by moetaz
also may be the function machine.deepsleep() need amendment

and i don't know how to access it and amend