← Engineering

Power and motors

Make things move. Why a pin can't run a motor, motor drivers and the H-bridge, two supplies with one ground, and choosing a battery, then LiPo safety before any LiPo is used. Years 9–10, after Arduino.

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

Driving a motor

Why a pin can't, and what can: transistors, drivers and a shared ground.

1Why a motor can't run from a pinNot started

A pin is a signal, not a power supply: it can give about 20 mA, and a motor needs hundreds. The pin switches a transistor, and the transistor switches the motor's own battery. A diode across the motor catches the spike when it switches off.

  1. Motor on a pin
  2. Try: wire it straight
  3. Worked example: the pin only switches › Two currents
  4. Worked example: the pin only switches › Find the mistake
  5. Vary: switch it off › Switch off
  6. Vary: switch it off › Fit the diode
  7. Practise: which can a pin drive?
  8. Wire it safely
Start lesson
2Motor driversNot started

A motor driver (an H-bridge) lets two pins choose the direction: IN1 HIGH and IN2 LOW is forwards, swapped is backwards, the same is stop. A third, PWM pin on ENA sets the speed with analogWrite. Two jobs, two kinds of signal.

  1. Backwards
  2. Try: drive it › Forwards
  3. Try: drive it › Backwards
  4. Worked example: the signals in code › Direction, then speed
  5. Worked example: the signals in code › Find the mistake
  6. Vary: change one thing › Brake
  7. Vary: change one thing › Coast
  8. Practise: drive codes › Two motors
  9. Practise: drive codes › Speed
  10. A gentle start
Start lesson
3Two supplies, one groundNot started

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. Powering the motor from the Uno's own 5V pulls it down when the motor starts, and the Uno resets.

  1. Separate supplies
  2. Try: join the grounds › Start it
  3. Try: join the grounds › Join them
  4. Worked example: what each supply does › Signal, power, ground
  5. Worked example: what each supply does › Find the mistake
  6. Vary: power from the Uno › From 5V
  7. Vary: power from the Uno › Its own battery
  8. Practise: grounds › Which wires?
  9. Practise: grounds › Resets
  10. Fix the robot
Start lesson

Batteries

Voltage, capacity and run time, and LiPo safety.

4Choosing a batteryNot started

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 battery for a robot has to meet every criterion: voltage in range, enough run time, light enough to carry.

  1. The 9 V battery
  2. Try: compare them
  3. Worked example: run time › Hours and minutes
  4. Worked example: run time › Find the mistake
  5. Vary: a hungrier robot › 900 mA, one hour
  6. Vary: a hungrier robot › Rechargeables
  7. Practise: run times › Hours
  8. Practise: run times › Capacity needed
  9. A light robot
Start lesson
5LiPo safetyNot started

LiPo packs are light and give big currents, but they 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 in a fire-safe bag while someone watches, never run below the cutoff, store at storage charge, and retire any pack that swells. Required before any LiPo use; your teacher signs it off.

  1. A puffy pack
  2. Safe or not? › Sort them
  3. Safe or not? › Balance charging
  4. Practise: the numbers › Full
  5. Practise: the numbers › After a run
  6. The charging routine
  7. Sign-off
Start lesson

Progress is saved in this browser only. Nothing is sent anywhere.

For teachers: Teacher guide (notes, answers, solutions, slides and worksheets)