The transistor lab explains how to control a higher voltage circuit with a lower voltage one. In this case, I used the Arduino and a transistor to start and stop a DC motor running on a separate 9V power source.

The circuit looks like this. The diode across the transistor prevents voltage from flowing back through the circuit while the motor (…now a generator) spins down after power is cut.

An Arduino connected to a breadboard with a potentiometer, transistor, and motor

And a little code will set the motor starting and stopping. I initially tried to run the motor on the Arduino’s 5V power supply, but as soon as it turned the motor on the Arduino would brown out and reset. Hooking up an external 9V supply fixed this. (However, judging from the frantic sounds the motor produced, 9V might have been more than it wanted.)

Using a potentiometer to control a PWM signal to the transistor allowed for speed control: