Powering your robot
What you’ll learn
- Common battery types and their voltages
- What mAh means and how to estimate run time
- Why motors and microcontrollers need careful power wiring
Battery types
| Type | Voltage per cell | Rechargeable | Good for |
|---|---|---|---|
| Alkaline AA/AAA | 1.5 V | No | First projects, cheap and safe |
| NiMH AA | 1.2 V | Yes | Classroom robots, safe and reusable |
| Li-ion 18650 | 3.7 V nominal (4.2 V full) | Yes | Longer run times |
| LiPo pack | 3.7 V per cell (2S = 7.4 V) | Yes | Drones, fast robots; needs care |
| 9 V block | 9 V | Some | Low-current only; bad for motors |
| USB power bank | 5 V | Yes | Powering a Raspberry Pi or Arduino |
Capacity: mAh
Battery capacity is measured in milliamp-hours (mAh). A 2,000 mAh battery could, in theory, supply 2,000 mA for 1 hour, or 500 mA for 4 hours.
Run time ≈ capacity (mAh) ÷ current draw (mA)
Example: a robot drawing 400 mA from a 2,000 mAh pack → 2,000 ÷ 400 = about 5 hours. In real life expect roughly 60–80% of that, because batteries lose voltage as they drain and motors draw extra when starting.
Motors are power-hungry
- An LED: ~15 mA. An Arduino: ~50 mA. One small motor: 200 mA–1 A+, and much more when it stalls (is blocked).
- When motors start, they pull a sudden burst of current. The battery voltage dips, and a microcontroller on the same supply can reset or behave strangely.
The golden rules
- Never power motors from a microcontroller’s pins or its 5 V pin. Use a motor driver board and feed it from the battery.
- Connect all grounds together (battery −, motor driver GND, Arduino GND). Without a common ground, signals have no reference and nothing works.
- Consider separate batteries for motors and logic, or add a capacitor near the motor driver to smooth dips.
Getting the right voltage
- Arduino UNO: 5 V via USB, or 7–12 V into the barrel jack/VIN (its onboard regulator drops it to 5 V).
- 3.3 V boards (ESP32, Pico): never feed 5 V into their input pins.
- Voltage regulators / buck converters: small boards that step a higher voltage (e.g. 7.4 V) down to 5 V efficiently.
A typical beginner robot power plan
6× AA (≈9 V) ──┬──▶ Motor driver (VM) ──▶ 2 DC motors │ └──▶ Arduino VIN (regulated to 5 V on board)
GND ───────────── all GNDs joined ──────────────Example: planning a robot car’s battery
| Part | Current |
|---|---|
| 2 × gear motors (driving) | 2 × 250 mA = 500 mA |
| Arduino UNO | 50 mA |
| Ultrasonic + line sensors | 30 mA |
| Total | 580 mA |
With a 2000 mAh pack: 2000 ÷ 580 ≈ 3.4 h in theory, about 2–2.5 h in practice.
Example: why the robot resets
Motors start and pull 1.5 A for a moment. The battery voltage dips from 6 V to 4 V, below what the Arduino’s regulator needs, so the board resets. Fix: a separate battery for the Arduino, or a bigger battery plus a large capacitor (e.g. 470 µF) near the motor driver.
Run timeEasy
A 1200 mAh pack powers a robot drawing 400 mA. How long will it run, in theory? 1200 ÷ 400 = 3 hours (expect about 2 in real life).
Pick the packMedium
Your Arduino needs 7–12 V on VIN and your motors want about 6–9 V. Which AA pack works for both? 6 × AA (about 9 V with alkalines, 7.2 V with NiMH). It’s in range for VIN and for the motor driver.
Fix the resetsHard
List three different fixes for an Arduino that resets every time the motors start. Fresh or bigger batteries; separate batteries for logic and motors (grounds joined); a large capacitor across the motor driver supply; start motors gradually instead of at full power.
Quick check
Finished this lesson?