(SOLVED)Random Power Shutdowns

I'm confused. I've written this incredibly simple code for my ESP32 WROOM:

int LED = 15;

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

}

void loop() 
{
  
  pinMode(LED,OUTPUT);
  digitalWrite(LED,HIGH);
  delay(1000);
  digitalWrite(LED,LOW);
  delay(1000);
  digitalWrite(LED,HIGH);
delay(1000);


}

And, just like my project I wrote it to test, it works perfectly... For a short time

After about 45 seconds of the LED turning on and off, it just shuts down out of nowhere. All lights turn off and the device can't be turned back on except by completely disconnecting and reconnecting the battery.

I'm powering the WROOM through a 5V powerbank, which is connected to a voltage regulator, which drops the voltage to 3.3V.

The 3.3V trace is connected to several things:

  1. The ESP32, to power it
  2. --> Resistor --> another status LED that is always on
  3. Provides power to a multiplexer and to a timer
  4. Several small capacitors for circuit protection

I'm considering the idea that the 3.3V trace should only be connected directly to the controller, and the LED, multiplexer and timer should be powered using a single GPIO pin configured as an output pin. But I don't know why this would cause the problem I described.

Is anyone able to explain this strange Arduino behavior?

I'm powering the WROOM through a 5V powerbank,

Many of those power banks (for phone charging) will shut down if insufficient current is being drawn (phone charged). You can add a LED or some other load to keep the current draw sufficient to keep the power bank on or, as I did with mine, add a load that you switch on periodically and of short duration to keep it on. For my power bank I have an LED ( that draws an extra 20mA) that I turn on for 30ms every 8 seconds (timing and extra current draw determined experimentally).

You sir, are an absolute saint. Thank you so much for helping me find the problem.

You're completely right, the device stays on when more complicated codes are being run (powering multiplexer/timer/etc) I never understood why until now.

I wish I could give you like 10,000 karma for this!

:slight_smile: :slight_smile: :slight_smile:

Typically some 50-70 mA is needed for power banks to stay on, the exact number varies of course per model.