Breadboard view of an Arduino connected to a potentiometer, a transistor, a DC motor, and a DC jack.
A transistor is connected to Digital Pin 9 through a 1-kilohm resistor. A DC motor connects to the transistor and a DC jack. The DC jack connects its positive wire to the first wire of the DC motor. The negative wire of the DC jack connects to ground. The second wire of the DC motor connects to the collector of the transistor.