esp32 intermediate 20 min

ESP32: run from a USB battery bank (and why most of them break)

Power an ESP32 from a USB battery bank. The hidden auto-shutoff feature that turns off most battery banks after 30 seconds with low-current loads.

Code available for: ESP32 ArduinoArduino CMicroPythonPython
Published Aug 25, 2026

USB battery banks are the cheap, easy power source for ESP32 projects. Plug in a battery bank, plug in the ESP32, and you have hours of runtime. Most projects, no problem.

But if your ESP32 sleeps for a while, the battery bank turns off after 30-60 seconds. Then it is useless.

This is the single most common “why does my project work for an hour and then stop” complaint in ESP32 projects that run from USB battery banks. This tutorial is the honest version: what the auto-shutoff is, which battery banks have it, and the 4 ways to work around it.

The auto-shutoff feature

USB battery banks are designed for charging phones. Phone charging draws 500 mA to 2A continuously. The battery bank monitors the load current; if it drops below about 80-100 mA for 30-60 seconds, the battery bank assumes nothing is using the output and turns off.

This is great for phones (which draw continuously). It is the enemy of ESP32 projects, especially deep-sleep ones.

The workaround: keep current above the threshold

The four reliable workarounds, in order of effort:

1. Add a constant load resistor

Wire a resistor across the 5V and GND that draws 80-100 mA:

ESP32 5V --[ 47 ohm resistor ]-- GND

At 5V, a 47 ohm resistor draws about 100 mA. That keeps the battery bank awake. Power consumption: 5V * 0.1A = 0.5W, which drains a 10,000 mAh battery in 60 hours.

Downsides: heat from the resistor, faster battery drain, and the resistor is always on.

2. Periodic wake + heavy load

Have the ESP32 wake up periodically and do something that draws > 100 mA:

void loop() {
  if (millis() - lastWake > 5000) {
    // Wake and transmit
    esp_wifi_start();
    // ... Wi-Fi activity ...
    esp_wifi_stop();
    lastWake = millis();
  }

  esp_sleep_enable_timer_wakeup(5000);
  esp_deep_sleep_start();
}

This works for projects that transmit periodically. The transmissions draw > 100 mA, keeping the battery bank awake.

Downsides: every project needs a 5-second transmission window or faster. If your project sleeps for 10 minutes, the battery bank still turns off.

3. Pulse a load every 30 seconds

A timer or a separate microcontroller can pulse a load resistor:

void loop() {
  digitalWrite(LOAD_PIN, HIGH);
  delay(100);   // 100 mA draw for 100 ms
  digitalWrite(LOAD_PIN, LOW);
  delay(29000); // wait 29 seconds
}

This pulses every 29 seconds, just before the 30-second auto-shutoff. The battery bank sees a load, stays on.

Downsides: an additional GPIO pin and a load resistor. The ESP32 has to spend a tiny amount of time awake, which costs battery life.

4. Use a battery bank without auto-shutoff

Some battery banks explicitly disable the auto-shutoff:

  • RAVPower older models (the 16,000 mAh ones without Quick Charge)
  • Anker PowerCore models sold before 2018
  • Goal Zero battery banks (the outdoor ones)
  • DIY 18650 + TP4056 + boost converter (from the previous tutorial)

Newer battery banks (2018+) almost all have the auto-shutoff. Check the manufacturer’s specs.

The current consumption threshold

Different battery banks have different thresholds:

Battery bankThresholdTimeout
Anker PowerCore 1000080 mA30 sec
Anker PowerCore 2000080 mA30 sec
RAVPower 16,00050 mA60 sec
Goal Zero Venture 30NoneN/A
Cheap unbranded100 mA30 sec

The actual numbers vary by batch. The 80 mA / 30 sec is the most common.

How to detect the issue

If your project works for 30-60 seconds and then dies, it is the auto-shutoff. The battery bank LED turns off; the ESP32 loses power.

Test:

  1. Plug in the ESP32.
  2. Watch the battery bank’s indicator LED.
  3. If the LED turns off after 30-60 seconds with the ESP32 in deep sleep, it is the auto-shutoff.
  4. Run the ESP32 with the LED on (no deep sleep). The LED stays on because the current is high enough.

The “always-on” battery banks

Some battery banks are designed for low-power devices:

  • Cygnett ChargeUp Pro (10,000 mAh): no auto-shutoff below 80 mA.
  • mophie Powerstation (some models): long timeout, no shutoff.
  • DIY: 18650 + TP4056 + boost converter is always-on.

For an ESP32 deep sleep project, get one of these or build your own.

The wiring for workaround 1 (resistor load)

ESP32 5V (USB pin) -- 47 ohm resistor -- GND

The 47 ohm resistor draws about 100 mA at 5V. Power dissipation is 0.5W; use a 1W or 2W resistor to avoid overheating.

Alternative: use a lower-current resistor and pulse a high-current load briefly:

ESP32 5V --[ 100 ohm ]-- GND         // constant 50 mA
ESP32 GPIO 4 --[ 47 ohm ]-- GND      // pulsed load, 100 mA

The 100 ohm is constant; the 47 ohm is pulsed every 30 seconds. Total load is 50 mA constant + 100 mA pulsed, which keeps the battery bank awake.

The runtime math

A 10,000 mAh USB battery bank at 5V holds 50 Wh of energy. The ESP32 in deep sleep with Wi-Fi off draws about 10 mA (50 mW). Without the constant load resistor, runtime would be 1000 hours. With a 47 ohm constant load adding 500 mW, runtime drops to:

runtime = 50 Wh / (0.05 W + 0.5 W) = 91 hours

A 47 ohm load consumes 80% of the battery. Use a higher resistance or pulsed load to extend runtime.

The best solution

For battery-bank-powered projects:

  1. Pick a battery bank without auto-shutoff, or
  2. Pulse a load every 30 seconds, or
  3. Use a 18650 + TP4056 + boost converter for the long-term solution.

The “DIY battery” approach (from the 18650 tutorial) gives you full control over power management and is the right answer for permanent projects.

What you learned

  • USB battery banks have a 30-60 second auto-shutoff for low-current loads.
  • The threshold is typically 80-100 mA.
  • Workarounds: load resistor, periodic wake, pulse load, or a battery bank without auto-shutoff.

When something breaks

  • Project runs for 30-60 seconds and dies. Auto-shutoff. Add a load resistor or pulse a load.
  • Battery bank gets hot. Load resistor too small. Increase resistance or use PWM to reduce duty cycle.
  • Project dies after 24 hours. Battery bank discharged. Replace or recharge.

What to build next

  • The 18650 + TP4056 tutorial covers the DIY battery approach that bypasses this issue entirely.
  • The deep sleep tutorial shows how to keep current low enough for any power source.
  • The book ESP32 Battery Projects covers solar + battery bank + ESP32 in depth.