/ /Darlington Transistors
The Tip120 transistor allows you to control a high-current DC load such as a DC motor or an incandescent light from a microcontroller.
Parts
- Solderless breadboard
- hookup wire
- Arduino Microcontroller
- Light Emiting Diodes, LED 10uF electrolytic capacitor
- 10Kohm resistors 10Kohm potentiometer
- power diodes
(for DC Motor version only) - DC power supply
- TIP120
- DC Motor - or - Incandescent lamp and socket
Prepare the breadboard
Conect power and ground on the breadboard to power and ground from the microcontroller. On the Arduino module, use the 5V and any of the ground connections:
Add a potentiometer
Connect a potentiometer to analog in pin 0 of the module. You'll use this later to control the output, whether it's a motor or a light.

Connect a TIP120 transistor to the microcontroller
The transistor allows you to control a circuit that's carrying higher current and voltage from the microcontroller. It acts as an electronic switch. The one you're using for this lab is an NPN-type transistor called a TIP120. It's designed for switching high-current loads. It has three connections, the base, the collector, and the emitter. The base is connected to the microcontroller's output. The high-current load (i.e. the motor or light) is attached to its power source, and then to the collector of the transistor. The emitter of the transistor is connected to ground.
The schematic symbol of an NPN transistor where B is the base, C is the collector, and E is the emitter.

Connect a motor
In the motor circuit below, there is a diode in parallel with the collector and emitter of the transistor, pointing away from ground. This is there to protect the transistor should the polarity of the current reverse (for example, if the motor was turned in reverse, or when it releases back voltage). Be sure to add the diode to your circuit correctly. The silver band on the diode denotes the cathode which is the tip of the arrow in the schematic.


This circuit assumes you're using a 12V motor. If your motor requires a different voltage, make sure to use a power supply that's appropriate. Connect the ground of the motor's supply to the ground of your microcontroller circuit, though, or the circuit won't work properly.
Connect a lamp
Likewise, the lamp circuit below assumes a 12V lamp. Change your power supply accordingly if you're using a different lamp. In the lamp circuit, the protection diode is not needed, since there's no way for the polarity to get reversed in this circuit:

Program the microcontroller
Here's a quick program to test the circuit:const int transistorPin = 9; // connected to the base of the transistor void setup() { // set the transistor pin as output: pinMode(transistorPin, OUTPUT); } void loop() { digitalWrite(transistorPin, HIGH); delay(1000); digitalWrite(transistorPin, LOW); delay(1000); }
Now that you see it working, try changing the speed of the motor or the intensity of the lamp using the potentiometer. Try this code:
const int potPin = 0; // Analog in 0 connected to the potentiometer const int transistorPin = 9; // connected to the base of the transistor const int potValue = 0; // value returned from the potentiometer void setup() { // set the transistor pin as output: pinMode(transistorPin, OUTPUT); } void loop() { // read the potentiometer, convert it to 0 - 255: potValue = analogRead(potPin) / 4; // use that to control the transistor: analogWrite(9, potValue); }
Notes
For the motor users:A motor controlled like this can only be turned in one direction. To be able to reverse the direction of the motor, an H-bridge circuit is required.
// HIGH CURRENT DC DEVICES:
You may want to use the Arduino to control a DC powered device that draws higher current. A solution for this situation is to use an NPN Darlington Transistor designed for medium power linear switching applications.
This component can be used to power devices such as motors, solenoids and fans, where the only necessary operation control operation is ON and OFF.
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. 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.
/ / Multiple LEDs
Each digital pin on the Arduino has an internal pull up resistor that can be turned on and off using the digitalWrite() command when it is configured as an output. When it is HIGH, 5V sent to the pin and can deliver 40mA of current. This is adequate to power an LED, but most devices that you will want to power will require more current. A device that is trying to draw more current than this can cause the Arduino to shutdown and could easily damage the chip. There are many methods to increase the current that can be sources on an output pin. When a relatively small amount of additional current is needed, a 2N3904 NPN Transistor (or any similar type) can be used to accomplish this. In this example, you will connect four LEDs to one output pin using this simple transistor circuit.
/ / Transistors
Transistors are used to amplify current. The leads are divided into BASE, COLLECTOR and EMITTER or GAIN.
The GAIN is simply the amount of amplification. The formulas and example questions are set out below:

A point to remember is that collector current is always greater than base current, sometimes by many times.
If the collector current of a transistor is 0.12 amps and the gain is 40, what is the base current?

If the collector current of a transistor is 0.4 amps and the base current is 0.002 amps, what is the current gain?
If the collector current of a transistor is 0.5 amps and the gain is 100, what is the base current?

If the collector current of a transistor is 0.4 amps and the base current is 0.002 amps, what is the current gain?
If the collector current of a transistor is 0.5 amps and the gain is 100, what is the base current?