

This circuit allows us to control the speed of a DC motor with a potentiometer. Weeeee!

The TIP 120 is a power transistor. The power flows from the Collector to the Emitter and is controlled by the input coming in from the base. The base pin is connected to a digital out pin on the Arduino (via a 1k resistor). The wiring diagram make it look like the base is in the middle, but it's not - and if you do it wrong it flat out won't work at all (at best) so pay attention.

The other new component is a diode. This diode is here to prevent the motor from sending a charge back through the circuit. It acts, if you will, as a valve. This particular diode is called a Rectifier diode, and like LEDs have a correct orientation and an incorrect one.
Notice that the motor has it's own power supply, but the motor and the arduino have a "common" ground.
You can't run house voltage though this circuit! The TIP120 and diode are not equipped for that, but it can handle small DC motors. You use the same circuit with a low power light bulb for the motor, in fact if you do you won't even need the diode.
To test this circuit, first make sure the arduino has the standard_Firmata software loaded onto it.
Double check your circuit.
Then, in Processing run this code.
void setup() {
void draw() {