Robotics and Embedded Systems

Lesson 9: Power Supplies, Batteries and Safe WiringNew-age

Every robot needs power, and power is where most projects fail — and where most damage happens. A microcontroller needs a steady 5 V or 3.3 V; a motor needs far more current than a microcontroller pin can supply; a battery that is shorted can get hot enough to burn. This lesson is about choosing a power supply, separating the power for logic from the power for motors, and wiring safely so that a mistake costs you a fuse, not a board or a finger.

The ideas are simple, but they are not optional. A project that works on USB power in the classroom and fails on batteries in the field has a power problem, not a code problem. Learn the rules now, and every project after this one will be more reliable.

Key Terms.
  • Voltage — electrical pressure, measured in volts (V). A microcontroller needs a steady voltage.
  • Current — the flow of charge, measured in amps (A). Motors need far more current than logic.
  • Regulator — a circuit that turns a higher, unsteady voltage into a steady lower one.
  • mAh — milliamp-hours: a battery’s capacity, or how much charge it holds.
  • Short circuit — an unintended low-resistance path that lets a large current flow, causing heat.
  • Fuse — a safety device that breaks the circuit if the current gets too high.
  • Ground (GND) — the common reference point of a circuit; all voltages are measured from it.
  • Decoupling capacitor — a small capacitor near a chip that smooths local voltage dips.

Voltage, current and what a board needs

Voltage and current are different, and confusing them causes most power mistakes. Voltage is the pressure: an Arduino Uno needs 5 V, and giving it 9 V on its 5 V pin will damage it. Current is the flow: a board draws only what it needs, so a 5 V supply rated at 2 A is safe for a board that draws 0.2 A — the supply’s rating is a maximum, not a forced amount. The danger is the other way: a supply that cannot deliver the current the load asks for will sag, brown out and reset the board.

Check the numbers before you connect anything. A microcontroller board draws roughly 50 mA on its own; each LED adds about 15 mA; a small servo can draw 500 mA when it moves; a DC motor can draw over 1 A when it starts. Add them up, and choose a supply that can deliver at least twice the total. The margin covers the surges — especially motor start-up, when current briefly spikes to several times the running value.

Batteries: choosing and using them

Batteries are rated by voltage and by capacity in milliamp-hours (mAh). Four AA alkaline cells in series give 6 V and about 2000 mAh; a single lithium-ion cell gives 3.7 V and is rechargeable but needs proper charging; a 9 V battery gives 9 V but only about 500 mAh and a high internal resistance, so it sags badly under a motor’s load. For robots, a pack of rechargeable AA cells or a lithium-ion pack with a proper charger is usually the best choice.

Separate power for logic and motors

Motors are electrically noisy: when they start, stop or reverse, they pull the supply voltage down and throw spikes back up the wires. If the microcontroller shares the same supply, those dips reset it — the classic symptom is a robot that restarts every time its motors start. The fix is to power the motors and the logic separately: one battery or regulator for the motors, another for the microcontroller, with only the ground wire shared between them.

Safe wiring habits

Good wiring is safe wiring. Use red wire for positive and black for ground, consistently, so a mistake is visible. Keep power wires short and thick enough for the current — thin jumper wires are fine for signals but not for motors. Put a fuse or a resettable fuse in the battery’s positive lead, rated just above the normal current, so a short breaks the circuit instead of starting a fire. And always disconnect power before rewiring: most damaged boards are damaged by a wire moved while the power was on.

Worked example — how long will the battery last?

A robot draws 100 mA for its logic and an average of 400 mA for its motors, 500 mA in total. Its battery pack holds 2000 mAh. The rough runtime is capacity ÷ current = 2000 ÷ 500 = 4 hours. In practice it will be less — motors draw more when starting, and a battery’s rated capacity is measured at a low current — so plan on about 3 hours and test it. If the robot must run for a school day, either use a bigger pack or reduce the motor current.

Common mistakes

  • Powering motors from the microcontroller’s 5 V pin. The pin cannot supply the current, and the board will reset or be damaged.
  • Giving the 5 V pin 9 V. The 5 V pin is not an input for a higher voltage — use the barrel jack or VIN for that.
  • Forgetting to join the grounds when using two supplies. Without a common ground, control signals have no reference.
  • Using a 9 V battery for a motor robot. Its capacity is small and its internal resistance is high, so it sags under load.

Discussion questions

  1. A robot resets every time its motors start. What is the most likely cause, and what would you change first?
  2. Why is a supply rated at 2 A safe for a board that draws 0.2 A, while a supply rated at 0.1 A is not? What does the rating actually mean?
  3. Lithium batteries are powerful and cheap. What rules make them safe to use in a school project?

Practice questions

  1. A robot draws 500 mA in total from a 2000 mAh battery. Roughly how long will it run? Answer: About 4 hours: 2000 ÷ 500 = 4. In practice less, because of motor surges and capacity measured at low current. Explanation: Capacity ÷ current = time.
  2. Why should motors and logic use separate power supplies? Answer: Motors pull the voltage down and throw spikes when they start and stop. Sharing a supply lets those dips reset the microcontroller. Explanation: Noise from motors resets logic.
  3. What must be shared between two separate supplies, and why? Answer: The ground. Without a common ground, control signals have no reference voltage and the motor driver cannot read them. Explanation: Share ground, not positive.
  4. A 9 V battery is a poor choice for a motor robot. Why? Answer: It holds only about 500 mAh and has high internal resistance, so its voltage sags badly when a motor draws current. Explanation: Small capacity, high resistance.
  5. What is a fuse for, and where should it go? Answer: It breaks the circuit if the current gets too high, preventing fire from a short. It goes in the battery’s positive lead. Explanation: A fuse sacrifices itself to save the circuit.

✅ Check your understanding

Quick recall check, generated from this lesson’s key terms. It is practice only and is not graded.

Keep reading to complete this lesson