Achieving Low Power while using the WiFi

papaisou11
Posts: 3
Joined: Tue Sep 14, 2021 7:08 am

Achieving Low Power while using the WiFi

Postby papaisou11 » Wed Jan 12, 2022 5:04 pm

Hello,

Help Needed. I am starting to design a circuit that is a door lock system. However, It will be battery Powered and I am expecting it to last 1 Year at least using a 3.7V 2500mAH battery. My problem is, if it is continuously connected to the wifi 24x7, it will not last long due to the Power consumption of ESP32. I could not make it sleep as someone will send door unlock or lock command it needs to be received by it.

I am expecting 10-15 lock-unlock events entire day. How can I reduce the current consumption of ESP32? This is the most power hungry system in my application. For all other devices, such as motor, sensors, all will be disconnected from power source until or unless I receive the command from wifi.

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: Achieving Low Power while using the WiFi

Postby WiFive » Thu Jan 13, 2022 4:00 am

Most of the locks on the market use plug in wifi bridges. The eufy lock that uses wifi has a 10Ah battery to last 12 months.

alanesq
Posts: 86
Joined: Thu Dec 14, 2017 8:38 pm

Re: Achieving Low Power while using the WiFi

Postby alanesq » Thu Jan 13, 2022 8:01 am

This thread may be of interest
https://www.esp32.com/viewtopic.php?t=12067

boarchuz
Posts: 626
Joined: Tue Aug 21, 2018 5:28 am

Re: Achieving Low Power while using the WiFi

Postby boarchuz » Thu Jan 13, 2022 4:35 pm

I had another look at this today out of interest, as there have been significant improvements to light sleep since my comment in the linked thread - average ESP32 light sleep current now settles <400uA with the right config.

With a very high listen interval of 30 (ie. max ~3 seconds between receiving queued up packets from the router), I'm seeing about 850-1100uA average current now with WiFi connected. That's pretty good, but you're still going to chew through your battery in less than half the target time, and that's without the motor, sensors, interface, etc.

There's a TCP task waking the ESP32 every 500ms though, which isn't helping. Might be a bug? Giving this task a much higher timeout, and setting the listen interval to 50, average current can go as low as 600uA while maintaining a WiFi connection.

ESP32-WROOM-32D, ebf7e811b12e3c1e347340e5b9ec014e9c6319ba

alex_d
Posts: 1
Joined: Sun Jan 19, 2025 5:07 pm

Re: Achieving Low Power while using the WiFi

Postby alex_d » Sun Jan 19, 2025 10:24 pm

Hey @boarchuz,
I just discovered this thread while working on my product.
Is there any chance you can share the approach or what exact settings did you use to achieve this exceptional 0.85-1.1 mA current consumption? I feel like I hit the wall.
My current best is waking up from light sleep every 25 seconds to ping AWS and show some traffic to wifi router. Otherwise I get disconnected from WiFi. This setup still drains battery like hell. I believe I chew through some 40mA/h
I appreciate any help.

boarchuz
Posts: 626
Joined: Tue Aug 21, 2018 5:28 am

Re: Achieving Low Power while using the WiFi

Postby boarchuz » Mon Jan 20, 2025 5:36 am

alex_d wrote:
Sun Jan 19, 2025 10:24 pm
My current best is waking up from light sleep every 25 seconds to ping AWS and show some traffic to wifi router. Otherwise I get disconnected from WiFi.
Use automatic light sleep if you want to maintain a WiFi connection. Don't try to manually enter and exit light sleep as the ESP32 WiFi stack is not designed to support this and you're at the mercy of the router as to how tolerant it wants to be of the seemingly unresponsive ESP32.

https://docs.espressif.com/projects/esp ... e-soc.html

I assume I enabled Dynamic Frequency Scaling (DFS) as well at the time. With this, the ESP32 will lower CPU frequency when possible. As in the comment, I also used an unusually high listen interval; I would guess something like 3-10 is probably more realistic which would result in higher average power consumption. Power was measured using a bench power supply through a Joulescope.

25 seconds is a relatively long time - consider if it may be more worthwhile deep sleeping between requests. Vanilla ESP-IDF is not really optimised for this so I would guess not without significant development effort to speed up wakeup, bootloader, WiFi initialisation, connection, etc.

Who is online

Users browsing this forum: No registered users and 38 guests