Optimizing Energy Consumption in LoRa System with ESP32

Hello everyone! I'm working on a project that utilizes an ESP32 in Deep Sleep mode for a LoRa transmission system. Currently, I've managed to reduce the consumption to 0.3mA, but I need to decrease it even further. My goal is to maximize the energy efficiency of this system.

The system consists of a Fire Beetle ESP32 that consumes 0.01mA in Deep Sleep without connected peripherals. I'm using an ADXL345 sensor to wake up the ESP32 via an interrupt. Once awakened, the ESP32 reads the date from the DS3231 clock and transmits the data via LoRa using the SX1278 Ra-02 module. I've made some configurations, such as removing the diode and LED from the DS3231 to reduce consumption, and disconnecting the RST cable from the LoRa module, which helped lower the consumption. However, the consumption is still higher than desired.

I would like to hear your suggestions and advice on how I can further optimize the energy consumption of this system. Are there any additional settings I can adjust or any other techniques I can implement to achieve my goal of reducing consumption? Any ideas or experiences you have to share will be greatly appreciated!

This is an image to give an idea of my circuit and its connections, including the elements I removed from the DS3231. Also, I clarify that all peripherals such as sensor, LoRa, and DS3231 are connected to the 3.3V pin of the ESP32.

In the code, I used LoRa.sleep(); to put the LoRa module to sleep and also the following for the DS3231:

rtc.disable32K();
 rtc.disableAlarm(1); // Deshabilitar la alarma para configurarla
 rtc.disableAlarm(2);
 rtc.clearAlarm(1);

~~ Alexander

I moved your topic to a more appropriate forum category @alexander_idid.

The Nano ESP32 category you chose is only used for discussions directly related to the Arduino Nano ESP32 board.

In the future, please take the time to pick the forum category that best suits the subject of your question. There is an "About the _____ category" topic at the top of each category that explains its purpose.

Thanks in advance for your cooperation.

What is the target and why?

Have You measured the entire project current consumption?
Putting the controller into any sleep mode, what about the other circuitry?

The objective is for the device to work with batteries because it will be located in an area where it cannot be energized, currently with the use of Deep Sleep the entire circuit consumes 0.33mA. I power it with a 3.7V 1800mA battery. In theory it lasts 7 months, however I need it to last at least a year.

Reviewing the circuit I think you could remove the pull up resistors from the adlx345 and ds3231 and use the ones that the board comes with on the i2C inputs, I don't know the value but it should work.

I hadn't thought about it but I don't know if it's useful, according to the graph it does have resistance there. but I don't know how they should be removed from the ADLX345 and the ds3231 and if that fireBettler resistor would work

What about 2 such batteries in paralell?
Extending 7 months to 12 is a big step.

Yes it works, but I need at least a battery to last about a year, since I don't have that much space

Start with the bare ESP32, you have already said that has a deep sleep of 10uA.

Add the LoRa module and write some code to initialise that then put it into deep sleep also.

By adding parts in sequence, and testing the deep sleep current when you add each part, you will have a much better idea where the 300uA is going.

Its really hard to investigate a 'high' deep sleep current on a board with a heap of parts.

One tip, there is no need to remove the NRESET pin on the LoRa module, just make sure the pin is kept high during deep sleep. Sleep current of the LoRa module should be less than 1uA.

I already did it, these are the results

• firebeetle (deep sleep) = 0,01mA

• firebeetle (deep sleep) + ADXL345 (using as interrupt to wake up) =0,22mA

• firebeetle (deep sleep) + ADXL345 (using as interrupt to wake up) +ds3231 (con bateria, removido diodo y led)=0,28mA

• firebeetle (deep sleep) + ADXL345 (using as interrupt to wake up) +ds3231 (with battery, diode and led removed) + LORA RA-02 SX1278 (with the command LoRa.sleep(); and without connecting the rst pin
) =0,31mA ~ 0,33mA

The problem is obviously in the ADXL345 sensor that it uses to wake up the ESP32, what I mentioned before, try removing both the sensor resistors and using the internal ones on the board, also from the programming look at the possibility of reducing the reading resolution so that it reads At a lower resolution, you can try to lower the sensor load. You can also try disabling (low) the I2C pins before going to sleep.

1 Like

Useful information.

So forget about all the other stuff for now and see if the ADXL345 sleep current can be reduced.

Veery low sleep current with I2C devices can be tricky.

I didn't dive deep into the datasheet but the ADXL345 shouldn't be that much power hungry :

You are right, I currently have it connected to the 3.3V and gnd pin of the ESP32. I don't understand what configuration it could be, I use the SparkFun_ADXL345 library and I have it configured like this

adxl.powerOn();
adxl.setRangeSetting(16);
adxl.setActivityXYZ(1, 0, 0);
adxl.setActivityThreshold(40); //0 -255
adxl.setImportantInterruptMapping(1, 1, 1, 1, 1);
adxl.ActivityINT(1);
adxl.getInterruptSource();
pinMode(interruptionSensor,INPUT);

Yes, in the documentation of the ADXL345 module it says:

Ultra-Low Power: 40uA in measurement mode, 0.1uA in standby@ 2.5V

And it is refering to the module (not the IC). This one:


If you are using this one.

EDIT: corrected, I had read it wrong

I don't know what it could be, I have the module.
the connections are
Vin -> 3.3V from esp32
gnd -> esp32 gnd
SDA -> SDA esp32
SCL->SCLesp32
INT 1 -> Gpio4

image

and the esp32 is powered with a 3.7V battery at Vin and gnd

I think I would have to feed at a lower voltage, at 2.5V, do you know of any regulator that does not consume so many mA that could help me regulate the voltage?

No.

No, this is just the consumption at that voltage, as a reference. At 3.3V could be slightly higher.

EDIT: corrected, I had read it wrong

Where do you see such a ridiculous figure? The OP reported 220 uA:

firebeetle (deep sleep) + ADXL345 (using as interrupt to wake up) =0,22mA