ESP32 + Lora + MP3 Energy consumption

Hi,
I'm currently working on a company project with an ESP32S3-WROOM-1, a DFPlayer Mini(DFRobotDFPlayerMini library) and a LoRa Ra-02(SX1278) module (Sandeep mistry library).
Everything work fine but I definetly use too much energy, I tried several things :

  • put to sleep the Lora and the MP3 (no change on the consumption)
  • reduce CPU frequency from 240 to 80 (significative change on the consumption)
  • deep sleep my ESP (huge difference on the consumption)

But I'm still consuming too much, plus I think there is something I'm missing because when I see others consumption on the forum it's lower than mine.
My stats :

65mA is with the test code and 100mA is with the real code

Also for the deep sleep I tried to wake up from a button, that's working fine but I can't get the fact that the button was pressed after the wake up and I need this information any tips ?
I also tried to wake up my ESP when the Lora receive a message but I don't get it to work and I don’t see any exemple with this module and library.

I want to precise that my circit can't change now because it's a card made by a professional and the welds are inside the card. So for my test I got an other cirkit made by myself with the same components exept the ESP32S3-WROOM-1 is replace with an ESP32-WROOM-32.

My ESP32S3 cirkit :

I can’t upload my real code because it’s for the company but here is a light version we can work with :

#include "Arduino.h"
#include "LoRa.h"
#include "DFRobotDFPlayerMini.h"

// Lora
#define ss 10
#define rst 14
#define dio0 2

// MP3
#define FPSerial Serial1
DFRobotDFPlayerMini myDFPlayer;

// LED
#define LED 45

void setup_lora(){
  Serial.println("LoRa Borne");

  LoRa.setPins(ss, rst, dio0);

  while (!LoRa.begin(433E6))
  {
    Serial.println(".");
    delay(500);
  }
  delay(200);

  LoRa.setTxPower(10);
  LoRa.setSpreadingFactor(7);
  LoRa.setSignalBandwidth(125E3);
  LoRa.setCodingRate4(5);
  LoRa.setPreambleLength(8);
  LoRa.enableCrc();
  LoRa.setSyncWord(0xA5);

  Serial.println("LoRa Initializing OK!");
}

void setup_MP3(){
  FPSerial.begin(9600, SERIAL_8N1, /*rx =*/RX, /*tx =*/TX);
  delay(200);

  Serial.println();
  Serial.println("DFRobot DFPlayer Mini Initialisation");

  while(!myDFPlayer.begin(FPSerial)){
    Serial.println(".");
    delay(500);
  }
  delay(200);

  myDFPlayer.setTimeOut(500); // Set serial communication time out 500ms  
  myDFPlayer.volume(25);  // Set volume value (0~30).  
  myDFPlayer.EQ(DFPLAYER_EQ_NORMAL); // Set equalizer  
  myDFPlayer.outputDevice(DFPLAYER_DEVICE_SD); //----Set device we use SD as default----  

  Serial.println("DFPlayer Mini online.");
}

void setup() {
  Serial.begin(115200);
  delay(1000);
  setup_lora();
  setup_MP3();

  pinMode(LED, OUTPUT);

  digitalWrite(LED, HIGH);
  delay(10000);
  digitalWrite(LED, LOW);

  esp_sleep_enable_timer_wakeup(10 * 1000000);
  esp_deep_sleep_start();
}

void loop() {
}

Thanks for your response !

For designing applications which require low running or sleep power consumption, you need to test the setup at the breadboard stage, in particular if using the ESP32, since exactly which pins you use on the LoRa module can prevent it going into sleep mode or waking up the ESP32 when a packet is received.

With lora and mp3 connected?

If you want to understand the power draw, do it step by step, starting with bare Esp32. Also, how are you measuring it? With some regulators included?

And do you know how low a power you want the setup to consume ?

To measure the power consumption I use Kowsi USB-C Power Meters. And as I say I cannot measure the consumption component by component because the board is fix but I tried with my self made cirkit with an ESP32 and this is what I got :

The numbers you see from other posts are confusing you for two reasons. The first is the lowest numbers you see are for the actual esp32 NOT the entire DEV board. The second is they are probaby using something like a current ranger in order to get accurate readings. See the Swiss guy videos on burden voltage to understand why you bench meter is creating wrong readings.
The best way to save power is to use an external power latch circuit, so instead of sleeping, you turn the ESP32 off, and it uses ZERO amps. That requires something like a DS3231 to periodically turn on the ESP32, but there are even other means to turn it on. Do not try to use the ZS-042 with its many flaws; get a Chronodot genuine RTC.

MpPlayer looks very hungry. You likely need a circuit to power it off.

I checked others' posts on the forum, their expectations, and what they really got. I also checked the ESP32S3 documentation.

The ESP32 himself in deep sleep mode should be 8 µA, and I got 3 mA. I’m far away from the expectation with the ESP32 in the first place, and I want to know why because maybe it can reduce the consumption with the MP3 and the Lora.

My goal is to get this circuit powered by a lithium rechargeable battery of 3000 mAh. Right now I calculated it can last 1 week, which is not possible for the client, so the first step I have is to make it last 1 month and ideally 6 months or even longer.

You are measuring usb power, that includes voltage regulator etc.

1 Like

Thanks for your response. Actually, I want my ESP32 to wake up when a button is pressed or when a Lora message is received, so the periodic may not work in my case.

Yeah, I see something like a transistor or resistor on some circuit for powering off the module when the ESP32 is in deep sleep. Is it the right way to do it ?

Sounds completly unrealistic.

The LoRa module in receive mode will consume at least 12mA, so a total current of 15mA including the normal ESP32 board regulator.

So a battery life of 8 days or so, maximum.

I’m really new to this; it’s my first project, and I don’t have much cognizance on the subject. Thank you for pointing this out ! So actually when I power my ESP32 with the battery, the consumption will slightly reduce ?

Can be p-channel mosfet or transistor, signal relay or some sophisticated latching circuit.

Depends on the converter you have between battery and esp.

So if I just focus on the wake-up-by button and I just forget about the wake-up-by receive, can I optimize it to several months ?

No, what I am talking abot is using the RTC board DS3231. If you also want a button or Lora then a button is a trivial matter to add to the DS3231 but Lora is a totally seperate approach. I would be inclined to research suppliers like WaveShare? who sell esp32 with LORA built in, they may have the perfect answer. Another I would check closely is SEEED Studio as they ave thumbnail esp32-s3 and more plus a LORA module and they sort of specialize in thumb nai module and low power. Real low power as in uA, mA is a heater almost (tongue-in-cheek)
The only downside with SEEED is wading through there docs. I am redoig my game cameras using SEEED XIAO esp32-s3-sense and I might add HaLo or LoRa from them as well.
Here is a link to one solution LINK and here is a slightly different solution LINK. The specs mention 5uA but message them for link to ALL the power specs for both solutions. The 2nd board is a different but supported processor, the nrf52840. I installed the boards package with the most supported devices (last one). Contact SEEED support for clarification.

This is an advanced project. You would be better to start with the Arduino Cookbook. You will also need significant coding skills and hardware knowledge.
Good luck.

1 Like