ESP32 drawing too much current

prarthana_bhat
Posts: 2
Joined: Thu Jan 20, 2022 6:58 pm

ESP32 drawing too much current

Postby prarthana_bhat » Fri Dec 15, 2023 5:12 pm

Hi all,
I have a custom PCB with an ESP32 as the microcontroller, and peripherals connected to it. According to the datasheet, in deep sleep mode, the current drawn is supposed to be less than 0.15 mA. However, my board is drawing 7 mA in deep sleep. I've attached the circuit diagram to the post.
What could the issue be?
Here's the code that I flashed into the esp32:

Code: Select all

 #include <ESP32Time.h>

#define uS_TO_S_FACTOR 1000000ULL  /* Conversion factor for micro seconds to seconds */
#define TIME_TO_SLEEP  5        /* Time ESP32 will go to sleep (in seconds) */

ESP32Time rtc;


void wakeup_reason() {
  esp_sleep_wakeup_cause_t wakeup_reason;

  wakeup_reason = esp_sleep_get_wakeup_cause();
  switch (wakeup_reason)
  {
    case ESP_SLEEP_WAKEUP_EXT0 : Serial.println("Wakeup caused by external signal using RTC_IO"); break;
    case ESP_SLEEP_WAKEUP_EXT1 : Serial.println("Wakeup caused by external signal using RTC_CNTL"); break;
    case ESP_SLEEP_WAKEUP_TIMER : Serial.println("Wakeup caused by timer"); break;
    case ESP_SLEEP_WAKEUP_TOUCHPAD : Serial.println("Wakeup caused by touchpad"); break;
    case ESP_SLEEP_WAKEUP_ULP : Serial.println("Wakeup caused by ULP program"); break;
    default :
      Serial.printf("Wakeup was not caused by deep sleep: %d\n", wakeup_reason);
      rtc.setTime(30, 24, 15, 17, 1, 2021);  // 17th Jan 2021 15:24:30
      //rtc.setTime(1609459200);  // 1st Jan 2021 00:00:00
      //rtc.offset = 7200; // change offset value

      break;
  }
}

void setup() {
  Serial.begin(115200);

  wakeup_reason();

  Serial.println(rtc.getTime("%A, %B %d %Y %H:%M:%S"));   // (String) returns time with specified format

  esp_sleep_enable_timer_wakeup(TIME_TO_SLEEP * uS_TO_S_FACTOR);

  Serial.println("Going to sleep now");
  Serial.flush();
  esp_deep_sleep_start();
}

void loop() {
  
}
Attachments
circuit_diagram.jpg
circuit_diagram.jpg (97.13 KiB) Viewed 30213 times

liaifat85
Posts: 200
Joined: Wed Dec 06, 2023 2:46 pm

Re: ESP32 drawing too much current

Postby liaifat85 » Sun Dec 17, 2023 7:55 am

Since it's a customized PCB, I think you should perform a QC of your PCB. Test with a multimeter. Find out if there is any accidental short circuit somewhere.

MicroController
Posts: 1385
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: ESP32 drawing too much current

Postby MicroController » Sun Dec 17, 2023 2:53 pm

What's U5?

Who is online

Users browsing this forum: No registered users and 27 guests