ESP32 Tips to save Power (for battery driven use)

Kazuya91
Posts: 27
Joined: Wed Aug 23, 2017 11:33 am

ESP32 Tips to save Power (for battery driven use)

Postby Kazuya91 » Fri Jan 05, 2018 3:45 pm

I have a battery driven project with my ESP32. One of the main goals is that the ESP runs with the given battery as long as possible so that the user doesnt need to change the battery too often.

My ESP32 just checks 5 Sensors, connects to WIFI, sends the outputs from the sensors via HTTP Post and goes into deep Sleep for 24 hours and repeats.

Now I am searching for settings which lower the battery usage. Thats what I use in the Settings so far:

In make menuconfig I...

1. excluded Bluetooth
2. set CPU Frequency to 80MHz instead of 240MHz
3. excluded the ULP CoProcessor
4. activated "run FREERTOS only on first core" since my routine needs to do tasks in a specified order. Also I read about problems with using both cores and that the actual support for both cores is not finished yet. (is that true?)

Are there any other tips? I would really appreciate it! :D

User avatar
urbanze
Posts: 301
Joined: Sat Jun 10, 2017 9:55 pm
Location: Brazil

Re: ESP32 Tips to save Power (for battery driven use)

Postby urbanze » Fri Jan 05, 2018 3:55 pm

-Read sensor's with ULP, if it's possible. (This would be of extreme importance as it can help a lot.)
-Use ESP32 with 2MHz if not using periphals, like UART or WiFi, to read sensors if ULP doens't work.
-And the main point.... Schedule correctly.

A well-programmed mcu in this portable paradigm can increase the useful life of the 20x battery easily. Avoid unnecessary connections with WiFi, avoid sending repeated data from the sensors (if the project allows) and etc ...

Kazuya91
Posts: 27
Joined: Wed Aug 23, 2017 11:33 am

Re: ESP32 Tips to save Power (for battery driven use)

Postby Kazuya91 » Fri Jan 05, 2018 7:21 pm

Thanks for the reply.

As I said, i am using WIFI to send data to my server. I would like to know how I can use the ESP with just 2 MHz? In make menuconfig i just have the option to use it with 80/160/240MHz...

And of course you are right, the schedule is a very important factor. I already optimized my schedule.

User avatar
urbanze
Posts: 301
Joined: Sat Jun 10, 2017 9:55 pm
Location: Brazil

Re: ESP32 Tips to save Power (for battery driven use)

Postby urbanze » Fri Jan 05, 2018 7:30 pm

Kazuya91 wrote:Thanks for the reply.

As I said, i am using WIFI to send data to my server. I would like to know how I can use the ESP with just 2 MHz? In make menuconfig i just have the option to use it with 80/160/240MHz...

And of course you are right, the schedule is a very important factor. I already optimized my schedule.
As far as I know, the peripherals like WiFi, uart, led pwm ... do not work with the clock below 80MHz, so it does not have the 2MHz option for choice in menuconfig. But you can use 2MHz for accounts, conditionals, and stuff like that. You should know how to rate the speed where necessary, should it return something satisfactorily.

To enable 2MHz, try using:
from "rtc.h"

Code: Select all

rtc_clk_cpu_freq_set(RTC_CPU_FREQ_2M);

Who is online

Users browsing this forum: Dennie, Google [Bot] and 97 guests