Learning Goals 5 min
The L3 builds work on the bench because USB supplies endless power. Move to battery and things change fast. This lesson teaches you to budget — calculate current draw, pick a battery, estimate runtime, anticipate sag. By the end of this lesson you will be able to:
- Add up active and idle current of every component in a project to get a total mA figure.
- Choose between battery chemistries (alkaline AA, NiMH, LiPo, Li-ion 18650) based on voltage, capacity, peak current, and rechargeability.
- Spot regulator weakness (UNO's on-board 5V vs an external buck converter) and pick the right power path for your project.
Warm-Up 10 min
Pick a project. List every component on the board. For each, look up (datasheet or measure) two numbers: typical current and peak current.
Example: the L03-43 robot car v2
| Component | Typical mA | Peak mA |
|---|---|---|
| Arduino UNO | 50 | 50 |
| HC-05 Bluetooth | 30 | 40 |
| L298N idle | 50 | 50 |
| TT motor (cruise) | 200 | 1000 (stall) |
| TT motor × 2 | 400 | 2000 |
| HC-SR04 | 15 | 20 |
| Total | ~545 mA | ~2160 mA |
So we need a battery that can supply 2+ A peaks without sagging, and ~600 mA average during driving.
New Concept · The four numbers and the runtime formula 25 min
The four numbers
- Battery voltage. Must match the regulator's input range (UNO VIN: 7–12 V recommended).
- Battery capacity (mAh). How much energy is stored.
- Battery peak current rating. The max it can supply without sagging.
- Project average current draw. From your component list above.
The runtime formula
Runtime in hours ≈ battery capacity (mAh) ÷ average draw (mA). Then multiply by 0.7–0.9 for real-world losses.
2500 mAh AA pack ÷ 545 mA average = 4.6 hours of theoretical runtime. Practically ~3 hours of driving.
Battery comparison
| Battery | Voltage | Capacity | Peak A | Notes |
|---|---|---|---|---|
| 4 × AA alkaline | ~6 V | ~2500 mAh | ~1.5 | Classroom standard. Sags badly under 1 A+ peak. |
| 4 × AA NiMH (rechargeable) | 4.8 V | ~2500 mAh | ~3 | Better peak; lower voltage means UNO VIN won't boot. Use direct on 5V pin via cap. |
| 9 V PP3 alkaline | 9 V | ~500 mAh | ~0.5 | Tiny capacity, terrible peak. Smoke alarms only. |
| 2-cell LiPo (2S) | 7.4 V | 500–3000 mAh | 5–30 | RC car standard. Easily handles motor peaks. Care during charging. |
| 1-cell Li-ion 18650 | 3.7 V | ~2500 mAh | 3–10 | Common in laptops, vapes. Boost to 5 V with a TP4056 + boost converter. |
| USB power bank | 5 V | 2000–20000 mAh | 1–3 | Easiest. Just plug ESP / UNO via USB. No regulator drama. |
Regulator headroom
The UNO's on-board 5V regulator drops voltage. Input below ~7 V and you may not get a stable 5 V out. The UNO accepts USB (already 5 V) AND barrel jack VIN (7–12 V); the regulator only applies on VIN. If your battery is ~6 V, feed it to the 5V pin directly (with care — no reverse voltage protection).
For ESP boards: a clean 5 V to VIN (or USB) is best. ESPs have an on-board 3.3 V regulator that's fine.
Brownout and sag
When current draw exceeds what the battery can supply, the voltage SAGS — drops temporarily. If it drops below the regulator's minimum (say 3.3 V on a UNO), the chip resets. This is the typical "the chip restarts when I start the motor" symptom.
Fixes:
- Bigger / better battery.
- Big bulk capacitor (470 µF+) across the supply close to the motor driver — absorbs peak demand.
- Separate batteries for motor and logic — common ground only.
- Buck converter (5 V output) between battery and the load — provides cleaner regulation than the UNO's on-board.
Worked Example · Plan power for two real projects 25 min
Example 1 — the smart-plant monitor (L03-44)
| Component | Typical mA |
|---|---|
| ESP8266 with WiFi | 80 (peaks 200 during transmit) |
| Soil probe | 5 |
| Total | ~85 mA average |
Plant monitor needs to run continuously for weeks. Battery? Bad fit. USB wall wart (5 V, 1 A) is the right answer. Effectively infinite runtime. We'll talk about deep-sleep + battery in L04-37, but the answer for L3 is "plug it into the wall".
Example 2 — the robot car (L03-43)
545 mA average drive, 2+ A peaks. Capacity needed for 1 hour of play: 600+ mAh. Peak handling: ≥ 2 A.
- 4 × AA alkaline — capacity yes (2500 mAh), peak no (sags under 1 A). Result: works at lower speeds, browns out at high duty + motor stalls. Common "car restarts when I turn sharply" problem.
- 4 × AA NiMH — better peak, but 4.8 V is below UNO VIN minimum. Workaround: feed straight to 5V pin (skips the regulator). Fine for hobby use.
- 2S LiPo (7.4 V, 1500 mAh) — 1 hour comfortable, 10+ A peak available. The professional choice. Charge with a balance charger.
- USB power bank — works on the bench, hard to mount on a moving robot.
The classroom choice: 2S LiPo if your school has charging infrastructure; 4 × AA NiMH otherwise. Plain alkaline AA only for slow-driving, low-stall use.
Verify with a multimeter
- Insert your meter (set to current, 10 A range) in series with battery+ and the L298N's VS.
- Idle the chassis: ~50 mA (L298N + Arduino).
- Drive forward at SPEED 100: ~300 mA.
- Stall one motor by holding the wheel: spikes to 1–2 A briefly.
- Match against your battery's peak rating.
Bulk capacitor for peak smoothing
A 470 µF capacitor across the L298N's VS and GND, with the leads as short as possible, absorbs current spikes. The big "motor starts → Arduino resets" problem usually goes away after adding one. Cost: pennies. Benefit: huge.
Basic 5 min
Goal: Measure idle current of your simplest L3 project (LED + ESP). Multimeter in series with the 5 V supply. Record the value.
Challenge 1 5 min
Goal: Spreadsheet exercise. For each of your 5+ saved L3 projects, build a power table: components, typical, peak, recommended battery. Print and tape into your engineering notebook.
Challenge 2 5 min
Goal: Add a 470 µF bulk capacitor to the L298N supply rails of your robot car. Re-test stall + sharp-turn scenarios. Does the Arduino restart less? Document the difference.
Challenge 3 · Pick the right battery for one build 10 min
- Pick one of your L3 builds (other than the plant monitor — that's USB).
- Calculate average + peak current.
- Recommend a battery from the table in §3.
- Recommend a regulator strategy (on-board, external buck, direct to 5V pin).
- Estimate runtime.
- Document in your notebook.
Recap 5 min
Power budgeting = list components, add up mA, pick a battery that handles both the average AND the peak. Brownouts come from peak sag, not capacity exhaustion. A bulk cap on the motor supply solves most "restart on stall" problems for a few pence. Battery chemistry choice flows from voltage + peak current + rechargeability + safety. Tomorrow: schematic reading III — last lesson before the L3 recap.
- Typical / peak current
- Average steady-state vs short-burst maximum. Most components specify both.
- Capacity (mAh)
- How much charge a battery stores. Runtime ≈ capacity ÷ average current.
- Peak rating
- Max instantaneous current a battery can deliver without sagging.
- Brownout
- Supply voltage briefly drops below the regulator's minimum, causing the chip to reset.
- Sag
- Temporary voltage drop under load. Worse on tired or undersized batteries.
- Bulk capacitor
- Big electrolytic cap (470 µF+) across the supply rails close to a peaky load. Absorbs spikes.
- Buck converter
- Step-down DC-DC regulator. Cleaner and more efficient than linear regulators for high-current loads.
- 2S LiPo
- 2-cell lithium polymer (7.4 V nominal). High peak current; needs balance charging; common in RC.
Extra Mission 5 min
Part 1 — Design a gadget that leaves the wall socket
Pick something that would be better without a cable: a bike light that flashes, a pocket step counter, a tent lamp for a camping trip, a portable score buzzer for a race. On paper, design it with a full power budget.
Your design must include:
- Every part, with its typical and peak current in mA.
- The average current, using how often each part is on.
- Your battery choice from the comparison table, with its voltage and capacity.
- Where the battery connects: VIN, the 5V pin, or USB, and why.
- Your runtime estimate in hours, using the 0.8 loss factor.
Part 2 — Make it
Build your gadget and run it from the battery you chose. Measure its real current with the multimeter in series, both idle and at peak. Compare your measured numbers with your budget, and fix the budget if they differ.
Bring back next class: your design with its budget, your uploaded sketch, and a photo of the multimeter showing the measured current. Bring the L298N and the ESP for L03-47.