How to Recognize a Transistor When You See One
The semiconductor material in a transistor is the size of a grain of sand or even smaller, so manufacturers put these teensy components in a metal or plastic case with leads sticking out so you can connect them in your circuits. You can find literally dozens upon dozens of different shapes and sizes of transistors, some of which are shown here.
The smaller packages generally house signal transistors, which are rated to handle smaller currents. Larger packages contain power transistors, which are designed to handle larger currents. Most signal transistors come in plastic cases, but some precision applications require signal transistors housed in metal cases to reduce the likelihood of stray radio-frequency (RF) interference.
Bipolar transistors typically have three wire leads so you can access the base, collector, and emitter of the transistor. One exception to this is a phototransistor, which is packaged in a clear case and has just two leads (collector and emitter) — light is used to bias the transistor, so you don’t have to apply a voltage to the base. All FETs have leads for the source, drain, and gate, and some include a fourth lead so you can ground the transistor’s case to the chassis of your circuit, or for the second gate of a dual-gate MOSFET.
To figure out which package lead is which, consult the documentation for the specific transistor. Be careful how you interpret the documentation: Transistor connections are often (though not always) shown from the underside of the case, as if you’ve turned the transistor over and are gazing at it from the bottom.
You absolutely must install transistors the proper way in your circuits. Switching the connections around can damage a transistor and may even damage other circuit components.