← Power and motors

Two supplies, one ground

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.

The motor has its own battery, the Uno has USB, every wire is checked, and the motor does nothing. Or the motor runs, and the Arduino keeps restarting. What's missing?

A voltage is always between two points. "Pin 9 is at 5 V" means 5 V above the Uno's GND. A driver on another supply measures against its ground, so unless the two grounds are joined, it can't read the Uno's signal at all.

WidthMore contexts, same idea.
PredictRead the problem and decide what you think before you try anything. A wrong guess is fine: it shows you what to look for.

Separate supplies

The Uno is on USB; the driver and motor are on a battery. Pin 9 goes to the driver's ENA, but the Uno's GND isn't joined to the driver. When pin 9 goes HIGH, the motor…

TryTry it on the board and compare the result with your prediction.

Try: join the grounds

Try it yourselfYour edits are saved in this browser.

Start the motor. What happens?

Use the board. This ticks when you get there.

Join the grounds.

Use the board. This ticks when you get there.

InvestigateWork out why it happens, one step at a time.

Worked example: what each supply does

Worked exampleBefore each step, say what you think comes next.
  1. Uno (USB)\text{Uno (USB)}Runs the code and makes the signals: pins at 0 V or 5 V above the Uno's GND.

Now pick the wires that join the two halves.

Which wires join the two halves of the circuit?

Sam's motor never responds. Click the line where Sam's reasoning first goes wrong.

ModifyChange the problem on purpose and see what happens.

Vary: power from the Uno

Try it yourselfYour edits are saved in this browser.

This motor runs from the Uno's 5V. Start it.

Use the board. This ticks when you get there.

Give the motor its own battery (grounds joined) and start it again.

Use the board. This ticks when you get there.

Modify TypicalChange the problem on purpose and see what happens.

Build it in Tinkercad

PractiseA few on your own, to check you have it.

Grounds

A robot's Uno runs on a 9 V battery and its motors on a 6 V pack. Which wires should be joined?

A robot resets every time it starts to move. What is the most likely cause?

MakeMake your own problem using what you have learned. Expect a few tries; that is normal.

Fix the robot

Try it yourselfYour edits are saved in this browser.
Need a hint?

Two faults: where the motor's power comes from, and the ground.

Another hint

Battery power for the motor, and join the grounds.

Another hint

Then start it.

This robot resets and its driver can't read the Uno. Fix both, then start the motor.

Use the board. This ticks when you get there.

For teachers

Students start a motor whose driver has its own battery but no shared ground (nothing happens), join the grounds, separate signal, power and ground in a worked example, run the motor from the Uno's 5V and watch it reset, and fix a robot with both faults. About 35 minutes.

Open the teacher guide: answers, solutions, slides and a worksheet.

Students will be able to

Before class

Model: without a common ground the driver doesn't respond (in reality the behaviour is unpredictable); a motor on the Uno's 5V resets the Uno when it starts (a brown-out). Some driver boards join the grounds for you on the board; still teach the wire.

Running the lesson

  1. Predict: ask '5 V compared with what?'
  2. Vary: the reset is the classic symptom students will meet on their own robots.

The hard part (on purpose)

'Separate supplies' sounds like 'separate circuits'. Draw the two halves and the one ground wire between them.

When students get stuck

Stretch and support

Stretch: Some drivers take a separate logic supply (VCC1) and motor supply (VCC2). Which goes to which, on an L293D?

Support: A picture with signal wires in one colour, power in another, ground in black.

Where it leads

Next: Choosing a battery.

Sources

What each step is for

Now you can
Next lesson4. Choosing a batteryVoltage (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.