← Power and motors

Power and motors: recap

For after the lessons: one card per lesson, to check what you remember. Answer each question in your head or on paper first, then check it. Nothing here is marked.

Driving a motor

1. Why a motor can't run from a pin

Try firstWhy can't you run a motor from an Arduino pin, and what do you use instead?

Check your answer

A pin gives about 20 mA and a motor needs hundreds. The pin switches a transistor or motor driver, which switches the motor's own battery.

A pin is a signal, not a power supply. It can give about 20 mA (40 at most), and a small motor needs about 150 mA turning and 700 mA starting. So the pin switches a transistor, and the transistor switches the motor's own battery. A motor is a coil: switching it off makes a voltage spike, so a diode across it gives the spike a safe path.

Pin 9 switches a transistor; the battery drives the motor.
Pin 9 switches a transistor; the battery drives the motor.
A signal, not a supply · Sound on for the voiceover
Open the lesson →

2. Motor drivers

Try firstWrite the three lines that make a motor (IN1 on 8, IN2 on 7, ENA on 9) go forwards at full speed.

Check your answer

digitalWrite(8, HIGH); digitalWrite(7, LOW); analogWrite(9, 255);

A motor driver (an H-bridge) can send the battery's current through the motor either way. Two pins set the direction: IN1 HIGH and IN2 LOW is forwards, swapped is backwards, the same stops it (both HIGH brakes). A third, PWM pin on ENA sets the speed with analogWrite (0–255). Two jobs, two kinds of signal.

An H-bridge driver between the Uno and the motor, with its own battery.
An H-bridge driver between the Uno and the motor, with its own battery.
Direction and speed · Sound on for the voiceover
Open the lesson →

3. Two supplies, one ground

Try firstTwo supplies power a project. Which terminals do you join, and why?

Check your answer

The negative terminals (the grounds), so both sides measure signals from the same 0 V. Never the positives.

The motor gets its own battery, but the grounds must be joined: a signal is a voltage compared with ground, so the driver can't read the Uno's pins without a shared 0 V. The + sides stay separate. Powering a motor from the Uno's own 5V pulls that supply down when the motor starts, and the Uno resets.

Two supplies, one ground: the Uno's GND and the battery's − are joined at the driver.
Two supplies, one ground: the Uno's GND and the battery's − are joined at the driver.
A shared 0 V · Sound on for the voiceover
Open the lesson →

Batteries

4. Choosing a battery

Try firstA 1500 mAh pack and a robot drawing 500 mA. Using 80%, how long does it run?

Check your answer

1500 × 0.8 = 1200 mAh; 1200 ÷ 500 = 2.4 h = 144 minutes.

Voltage (V) is how hard a battery pushes; capacity (mAh) is how much charge it holds. Run time ≈ capacity ÷ current, and plan on using about 80% of it. A robot's battery must meet every criterion: voltage in the driver's range, enough run time, and light enough to carry.

Four AA cells: 6 V, 2000 mAh, about 100 g.
Four AA cells: 6 V, 2000 mAh, about 100 g.
How long, not how hard · Sound on for the voiceover
Open the lesson →

5. LiPo safety

Try firstGive three rules for charging a LiPo.

Check your answer

Any three of: balance charger set to LiPo and the right cell count; in a fire-safe bag on a non-flammable surface; never left unattended; inspect first and never charge a damaged or swollen pack; charge at 1 C or less.

LiPo packs are light and give big currents, but store a lot of energy in a soft pouch. Damaged, over-charged or run-flat cells can swell and catch fire. The rules: inspect every time; charge on a balance charger set to LiPo, in a fire-safe bag, with someone watching; never run below the cutoff (about 3 V a cell); store at about 3.8 V a cell; retire any pack that swells. Your teacher signs you off before you use one.

Open the lesson →