The Controlling Multiple LEDs Tutorial uses the 2N3904 small current transistor. This works well for controlling additional relatively small current devices with the Arduino. You may want to use the Arduino to control a DC powered device that draws more current that the 2N3904 transistor can supply. A solution for this situation is to use an NPN Darlington Transistor designed for medium power linear switching applications. In this tutorial we will use a TIP122 transistor, which can power devices up to 100VDC at 5 Amps. This can be used to power devices such as motors, solenoids and fans, where the only necessary operation control operation is ON and OFF (see the H-Bridge Tutorial for bi-directional rotation and speed control of DC motors.)
The circuit is identical to the 2N3904 transistor circuit - the base of the transistor (PIN 1) is connected to the Arduino output pin (D6) through a 1K OHM resistor. The emitter (PIN3) is connected to ground and the collector (PIN2) is connected to one end of the coil of the device being driven (in our example we have a 12VDC Solenoid connected). The other end of the coil is connected to the +12VDC external power supply (the ground from this power supply is connected to a common ground with the Arduino - this is necessary for the transistor to function). It is very important to put a diode across the coil of the device being powered to protect the control circuit from a potential voltage spike that can be created when current is released from the device being powered.