Hi, testing my project that should even use a tamper, with a pull-up circuit, I discover that my D1 mini (usb powered, but also if supplied with 5V pin) drain current for pin in deep-sleep mode too .
So I decided to measure whole current drained. My D1 mini drain 72mA when on (right) and 3.2mA when turned in deep-sleep mode from a switch in Home Assistant (too much, should be 0.17mA).
I used shutdown because I want that Home Assistant put to deep sleep the board and even more because it will be awakened by RST pin linked to ground thanks to another circuit.
Is not enought shutdown switch platform?
Is it needed deep_sleep component too? How could I configure it (run_duration and sleep_duration are unknown)?
OK, I duplicated your setup and can verify the ESP is sleeping and the board current is 3.22 mA.
Which I would expect because even if the processor is āshut downā, none of the other chips on the Wemos D1 Mini are. The CH340 and the Flash memory are still connected to the 3V3 line, so that is where much of the 3.22mA is going.
Which is probably why the D1 mini is a poor candidate for a battery operated device.
Is there any reason you couldnāt use an ESP8266-01?
A Zigbee switch or button is far superior to the ESP boards for low battery drain. What is it you are trying to do?
And thanks for alerting me to the Shutdown Switch platform. That could come in handy.
@stevemann the pages @Giove8 pointed to quoted .17mA for the whole d1 mini in deep sleep.
@Giove8 there are a number of versions of the d1 mini, I donā't know the differences. Plus there are numerous cheap knockoffs out there. Many are crap.
He may be looking at the ESP8266 chip itself where the default sleep mode (modem-sleep) will be about 17mA:
I have to question the docs here because the deep_sleep component has a sleep_duration configuration parameter, but in deep sleep the ESP clock is off. So, how does the ESP know when to wake?
BS. I buy my Miniās from the most convenient and/or the cheapest supplier, usually 5 at a time because they are so cheap. I have NEVER had one DOA out of the static envelope.
Thanks to you @stevemann!
In the next days Iāll try again, maybe also with deep_sleep componentā¦ because however itās not normal that D pin(s) still active on deep sleep mode.
I read that MQTT could be better than API for sleep mode, but I donāt believe that could work (I never installed MQTT on Home Assistant, so I canāt try now).
And if Iāll have a D1 mini v3 o v4 Iāll test thatā¦
@stevemann I donāt know ESP8266-01, I should checkā¦ I didnāt find zigbee switch or button with low dimensions, low drain that can drive a relay or even npnā¦ If you could suggest something Iāll appriciate appreciate it
# Example configuration entry
deep_sleep:
run_duration: 10s
sleep_duration: 10min
If the ESP clock is off in deep-sleep, how does it know how long to run and how long to sleep?
At the end of the sleep_duration, the ESP pulls GPIO16 low. And GPIO16 must be connected to RST.
So, the ESP clock is running, thus it canāt be in deep-sleep mode, but in the default modem-sleep mode.
A 5V relay with 40mA will be perfect (even 3V relay will be ok), relay will drive a step-up voltage regulator that manage an important load. But also drive a simple npn, as I tested with D1 mini will be fineā¦
Because it will not stay at home, but outside and I canāt give energy with cable (all the system is power with batteryā¦ but the important load for few minutes drain less that D1 mini, if drain 3mA for few weaks)