Why Your Project Works on USB Power But Not on Battery
You build a project. It runs perfectly from USB. You add a battery. It resets when the motor starts. Or the sensor readings go haywire. Or the LEDs flicker. You try different batteries. The problem persists.

Battery-powered Arduino project — USB power is stable, battery power has internal resistance that causes voltage dips during current spikes.
The battery is not weak. The problem is that USB power and battery power behave differently under load, and your project has a power architecture problem.
USB Power Is Not Just 5V
A USB port from a computer can supply 500mA (USB 2.0) or 900mA (USB 3.0). More importantly, the USB port has low output impedance. When your project draws 300mA, the voltage does not droop significantly because the computer's power supply is robust and close to the port.
A battery has higher internal resistance. A fresh alkaline AA battery has an internal resistance of 0.1-0.3 ohms. A 9V alkaline battery has 1-2 ohms. A LiPo battery has very low internal resistance (milliohms), but the protection circuit and wiring add resistance.
When your motor draws 200mA from a 9V battery with 1 ohm internal resistance, the battery drops 0.2V. The Arduino sees 4.8V instead of 5V. If the motor draws 500mA in stall, the battery drops 0.5V and the Arduino sees 4.5V, which might be below the brownout threshold.
The Arduino's 5V regulator needs at least 6V input to regulate to 5V. If the battery drops below 6V under load, the regulator drops out and the Arduino resets.
The Current Burst Problem
Some components draw current in bursts that are much higher than their average current. Motors are the worst: stalled motor current is 5-10x the running current. The ESP32 WiFi transmission current spikes to 240mA for short bursts.
When the burst happens, the battery voltage dips. The Arduino's onboard capacitor (typically 100µF on the 5V rail) provides some buffering, but if the burst is longer than the capacitor can sustain, the voltage dips below the brownout threshold.
The solution is to add bulk capacitance at the point of load, not just at the Arduino. For a motor driver circuit, put a 470µF capacitor directly across the motor driver power input, as close to the pins as possible. This capacitor provides the instantaneous current for the motor without drawing it from the battery.
For the ESP32, the WiFi burst is brief (a few milliseconds). A 100µF capacitor at the ESP32 power pins is sufficient. But if you are reading sensors simultaneously, the combined current draw might exceed what the capacitor can sustain.
Linear Regulators vs. Switching Regulators
Most Arduino boards use a linear regulator (LM7805 or similar) to convert the input voltage to 5V. Linear regulators convert excess voltage to heat. If you power a 9V battery into an Arduino, the regulator drops 4V at 100mA, dissipating 400mW of heat.
This is fine as long as the battery can sustain the current. But a 9V alkaline battery has maybe 500mAh at 100mA discharge. It will last 5 hours. But the voltage will sag as the battery depletes.
For battery-powered projects, use a switching regulator (buck converter) instead of a linear regulator. A buck converter efficiency is typically 85-95%, meaning 85-95% of the battery energy goes to the load. A linear regulator might only give 50-60% efficiency at 9V input.
The efficiency difference matters for battery life. A project that runs 24 hours on 4 AA batteries with a linear regulator might run 72 hours with a buck converter.
The Battery Chemistry Matters
Different battery chemistries have different discharge curves and internal resistance characteristics.
Alkaline (AA, AAA, 9V): Flat discharge curve until the end, then rapid drop. High internal resistance, especially when cold. Good for low-current projects, poor for motor drivers.
NiMH (AA, AAA): Lower internal resistance than alkaline. Better for high-current pulses. Discharge curve drops steadily. Nominal 1.2V per cell (not 1.5V).
LiPo / Li-Ion: Very low internal resistance, high energy density. Excellent for high-current projects. Requires protection circuit. Dangerous if over-discharged or shorted. Must be charged properly.
LiFePO4: Safer than LiPo, lower energy density. Excellent for projects that need 3.2V per cell (close to 3.3V logic). Good for ESP32 projects without regulator.
For an ESP32 project running from battery: use a LiPo with a proper protection circuit and a buck converter to 3.3V. The ESP32 draws 240mA during WiFi and 20µA in deep sleep. A 2000mAh LiPo will run it for months in deep sleep mode with occasional transmissions.
The Brownout Detection Threshold
Most Arduinos have brownout detection (BOD) that resets the chip when VCC drops below a threshold. The ATmega328P default BOD is 2.7V (brownout at 2.7V). If VCC drops below 2.7V, the chip resets.
When a motor starts, the battery voltage dips. If it dips below 2.7V, the Arduino resets. This is why the project works with a computer USB (stable 5V) and fails with a battery.
You can disable BOD in the fuse settings, or set it to 1.8V. But disabling BOD means the chip operates with unreliable power, which can cause erratic behavior or data corruption.
The correct fix is to fix the power architecture. Add bulk capacitance. Use a battery with lower internal resistance. Use a switching regulator to isolate the motor power from the logic power.
Power Architecture for Battery Projects
For any battery-powered project with motors or WiFi:
- Separate power domains. The motor and the microcontroller should have separate regulators or separate battery connections. A motor startup spike should not affect the microcontroller power.
- Add bulk capacitance at every power entry point. 100µF at the Arduino 5V pin. 470µF at the motor driver. 100µF at the ESP32.
- Use a buck converter for the microcontroller power. Efficiency matters for battery life.
- Use the right battery for the load. High current loads need LiPo or NiMH. Low current projects can use alkaline.
- Monitor battery voltage with the ADC. When battery voltage drops below a threshold, go to sleep or shut down gracefully.
The project works on USB because USB power is stable. It fails on battery because batteries have internal resistance and cannot sustain current spikes. The fix is in the power architecture, not the battery choice.
For reliable battery-powered projects:
MT3608 Buck Converter Module — 2A output, 90% efficiency. Step down from 12V or 9V battery to 5V for Arduino projects. (Amazon)
LiPo Battery 3.7V 2000mAh — Low internal resistance, high current capability. Good for ESP32 and motor projects. Includes protection circuit. (Amazon)
470µF 16V Electrolytic Capacitor — Bulk capacitance for motor driver power input. Place as close to driver pins as possible. (Amazon)
I earn from qualifying purchases.
Article #018, 2026-04-18. Content Farm pipeline, Run #018.
Top comments (0)