How-to · Beginner · 4 min read
How to Power an Arduino or ESP32 from Batteries
By Geekobot Learning Team · Updated 24 Oct 2026
On this page
For an Arduino Uno or Nano, feed 7 to 12 V into VIN or the barrel jack (6 x AA works well), or regulated 5 V into the 5V pin or USB. For an ESP32 or Pico, use a single Li-ion cell through a low-dropout 3.3 V regulator, or 5 V USB from a power bank. Avoid 9 V PP3 batteries for anything beyond a demo: they hold little energy and sag quickly.
Key specs at a glance
- Arduino Uno / Nano
- VIN or jack 7 to 12 V; 5V pin needs regulated 5 V
- ESP32
- 5 V on VIN/USB, or 3.3 V on 3V3 (LDO from a Li-ion cell)
- Raspberry Pi Pico
- VSYS 1.8 to 5.5 V: 2 x AA, Li-ion or USB directly
- Typical current
- Uno 45 mA idle; ESP32 80 to 250 mA with Wi-Fi, 10 µA in deep sleep
- Run time
- hours = mAh x 0.8 / mA
- Power banks
- Many switch off below about 50 to 100 mA load
A shorted, over-charged or damaged lithium cell can get very hot and catch fire. Use a protection board or BMS, never short the terminals, charge on a non-flammable surface and do not leave a charging pack alone. Throw away cells that are swollen or dented.
Battery options compared
| Battery | Voltage | Energy | Best for | Avoid for |
|---|---|---|---|---|
| 9 V PP3 alkaline | 9 V | About 500 mAh | Quick Uno demos on VIN | Motors, Wi-Fi, anything over a day |
| 4 x AA alkaline | 6 V | About 2500 mAh | Pico (VSYS), 5 V boards via 5V pin at light load | Uno VIN (6 V is just under the 7 V minimum) |
| 6 x AA alkaline | 9 V | About 2500 mAh | Uno/Nano VIN, weeks of low-power use | |
| 1 x 18650 / LiPo | 3.7 V | 2000 to 3500 mAh | ESP32 and Pico with LDO, rechargeable | 5 V boards without a boost converter |
| 2S Li-ion | 7.4 V | 2000+ mAh | Uno VIN, robots with motors | Needs BMS and matched cells |
| USB power bank | 5 V | 5000+ mAh | Any board via USB | Low-current sleepy projects (bank switches off) |
- 9 V PP3 alkaline
- Voltage:
- 9 V
- Energy:
- About 500 mAh
- Best for:
- Quick Uno demos on VIN
- Avoid for:
- Motors, Wi-Fi, anything over a day
- 4 x AA alkaline
- Voltage:
- 6 V
- Energy:
- About 2500 mAh
- Best for:
- Pico (VSYS), 5 V boards via 5V pin at light load
- Avoid for:
- Uno VIN (6 V is just under the 7 V minimum)
- 6 x AA alkaline
- Voltage:
- 9 V
- Energy:
- About 2500 mAh
- Best for:
- Uno/Nano VIN, weeks of low-power use
- 1 x 18650 / LiPo
- Voltage:
- 3.7 V
- Energy:
- 2000 to 3500 mAh
- Best for:
- ESP32 and Pico with LDO, rechargeable
- Avoid for:
- 5 V boards without a boost converter
- 2S Li-ion
- Voltage:
- 7.4 V
- Energy:
- 2000+ mAh
- Best for:
- Uno VIN, robots with motors
- Avoid for:
- Needs BMS and matched cells
- USB power bank
- Voltage:
- 5 V
- Energy:
- 5000+ mAh
- Best for:
- Any board via USB
- Avoid for:
- Low-current sleepy projects (bank switches off)
Powering an Arduino Uno or Nano
- VIN / barrel jack: 7 to 12 V. The onboard linear regulator drops it to 5 V and wastes the rest as heat, so 12 V with a 200 mA load makes it warm; 7.4 to 9 V is the sweet spot.
- 5V pin: connect only a clean, regulated 5 V, such as a buck converter output or a USB power bank. It bypasses the regulator and the polarity protection.
- USB: the simplest option on the bench or with a power bank.
- Motors and servos get their own supply with a common ground; see motor drivers.
Powering an ESP32 or Pico from a Li-ion cell
An ESP32's pins need 3.3 V, and its Wi-Fi bursts draw over 250 mA. The AMS1117 on most dev boards needs about 4.4 V in, so a single cell (3.0 to 4.2 V) will not work through VIN. Instead, feed the cell into the 3V3 pin through a low-dropout regulator such as the ME6211, HT7333 or MCP1700 (250 to 500 mA), or buy a board with built-in charging (many ESP32 boards and the Pico-compatible boards include a JST connector and charger). Use a TP4056 to charge. The Pico's VSYS accepts the cell directly.
Estimating run time
Run time in hours is roughly capacity (mAh) x 0.8 / average current (mA).
- Uno idle at 45 mA on 6 x AA (2500 mAh): about 44 hours.
- ESP32 sending a reading every 10 minutes, deep sleep between, averaging 2 mA, on an 18650 (2600 mAh): about 40 days.
- ESP32 streaming over Wi-Fi at 150 mA on the same cell: about 14 hours.
Deep sleep is the biggest lever: ESP32 deep sleep draws about 10 µA for the chip, though cheap dev boards add 5 to 10 mA through their USB chip and LEDs. For long battery life, pick a board designed for it (for example a FireBeetle or a bare module) or remove the power LED.
ESP32 deep sleep example
#define SLEEP_SECONDS 600
void setup() {
Serial.begin(115200);
// read sensors, send data here
Serial.println("Going to sleep");
esp_sleep_enable_timer_wakeup((uint64_t)SLEEP_SECONDS * 1000000ULL);
esp_deep_sleep_start(); // setup() runs again on wake
}
void loop() {}What to avoid
- Feeding 9 V into the 5V pin (destroys the board).
- Running an Uno from 4 x AA on VIN; at 6 V the regulator drops out and the board resets.
- Expecting a 9 V battery to run motors.
- Powering a Pi from a microcontroller-sized battery.
- Letting Li-ion cells discharge below 3 V without protection; use a protected cell or a TP4056 board with DW01A.
Try it: Battery life calculator
Change the values and the diagram and results update as you type.
Common mistakes to avoid
- Putting unregulated voltage into the 5V or 3V3 pin.
- Powering an ESP32 from one Li-ion cell through VIN and an AMS1117.
- Using a power bank for a sleepy project that draws too little to keep the bank awake.
- Sharing a weak battery between the microcontroller and motors.
- Using 9 V PP3 batteries for anything that must run for more than a few hours.
Frequently asked questions
Can I power an Arduino with a 9 V battery?
Yes, through the barrel jack or VIN, but a PP3 holds only about 500 mAh and sags under load, so it suits short demos only. Six AA cells give the same voltage with five times the energy.
Can I power an Arduino Uno with 4 AA batteries?
Not on VIN: 6 V is below the regulator's 7 V minimum. You can feed 6 V fresh alkalines into the 5V pin at light load, but it is out of spec; a 5 V buck or boost converter is the proper way.
How do I power an ESP32 with a 3.7 V battery?
Through a low-dropout 3.3 V regulator (HT7333, ME6211, MCP1700) into the 3V3 pin, or use an ESP32 board with a built-in LiPo connector and charger.
How long will an ESP32 run on an 18650?
About 10 to 15 hours with Wi-Fi active, or weeks to months using deep sleep between short transmissions.
Can I run an Arduino from a USB power bank?
Yes, by USB cable. Make sure the project draws enough current (about 50 to 100 mA) to stop the power bank from switching itself off, or choose a bank with an always-on mode.
Parts for this guide
Calculators
Terms in this guide
Keep learning
Sources
- Arduino UNO R3 power section (Arduino)
- ESP32 Series Datasheet, power consumption (Espressif Systems)
- Raspberry Pi Pico datasheet, powering the Pico (Raspberry Pi Ltd)
Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.




