Transistors are electronic switching devices, which are the basis of nearly all electronic circuits. This page will give a brief outline of what they are, as well as different methods to interface analog transistors from digital circuitry.
Introduction
The simple explanation of a transistor is that it is a combination of three 'doped' pieces of semi-conductor material. The piece in the middle is called the Base (in Bipolar Junction Transistors), and the outside edges are the Collector, and the Emitter.
When current is put into the Base, it changes the voltage characteristics of the entire transistor, and so it is possible to control the current flowing from the Collector to the Emitter. So a small change of current on the base, results in a large change between the Collector and Emitter.
Bi-Polar Junction Transistors (BJT)
NPN
This is the simplest type of BJT to understand. As you can see in the diagram below, when you apply voltage to the base of the BJT, it turns on the transistor.
A more detailed explanation is that when current is applied onto the base, it changes the voltage difference between the collector and the base. This difference changes the bias within the transistor, causing current to flow from the collector to the emitter.
When there isn't a lot of charge on the base, there are areas within the semiconductor that aren't capable of carrying current from collector to emitter. This means that a lot of power is dissipated to drive the current through. When there is so much charge on the base that no more will fit, the transistor is said to be saturated. There are plenty of carriers for the current, and not much power is dissipated, making the transistor more efficient. This is only true when the transistors Emitter is connected directly to ground (Common Emitter).
This diagram shows how an NPN is turned on. When the base is turned off (connected to ground), there is no way to put current through the transistor, so the transistor is off. When the base voltage is raised, driving charge onto the base, it turns the transistor on.
PNP
The PNP isn't quite as simple. The base still controls the flow of current, but it is more or less opposite. In order to turn the transistor on the base is connected to ground (turned off). To turn the transistor off, voltage is applied to the base.
The reason for this is because of the type of semi-conductor used. When the base is connected to ground, loose electrons are taken away, creating 'holes'. These holes can be thought of as positive charges, and are capable of carrying current from the Emitter to the Collector.
A PNP transistor will saturate only when it is set up as a Common Emitter
The diagram below shows how this works.
This diagram shows how an NPN is turned on. When the base is turned off (connected to ground), there is no way to put current through the transistor, so the transistor is off. When the base voltage is raised, driving charge onto the base, it turns the transistor on.