I'm new to electronics and here's a newbie question that I would like to ask: How do I know if which leg is the emitter or the collector in a Transistor (For both PNP and NPN) using only an analog multimeter?
Set meter to lowish ohms range so a diode conduction can be seen - trial and error OR diode test if available.
With an NPN transistor the base will have two diodes facing away from it. ie with most positive meter lead on the base the other two leads will show a conducting diode when the negative lead is placed on them
With a PNP transistor the base will have two diodes facing towards it. ie with most positive negative (usually black) meter lead on the base the other two leads wil show a conducting diode when the positive lead is placed on them
OK - now you know NPN from PNP and which is base. Now
Connect positive to guessed collector for NPN and negative to guessed emitter. Set meter to 1 megohm plus range.
-Connect base to guessed collector via a high value resistor - probably 100k to 1M. A wet finger works well. Note reading.
- Now swap guessed emitter and collector and repeat. Again resistor is added from base to guessed collector. Note reading
One of the two above will have a much lower R_CE reading when base is forward biased. That's the correct guess.
Once you get used to this you can pick up a leaded transistor, juggle it with meter leads till you find the two diodes giving base and NPN or PNP then lick your finger and do a forward bias base test - and then declare pinout. Looks like magic to many. Works.
You can or course formalize that on a breadboard and even add (gasp) switches to swap polarity etc.
Note that you can get some idea of Beta (current gain _ from this once you learn to calibrate your wet finger.
Useful information to know (complements the other answers) which applies to both NPN+PNP bipolar transistors and N-channel and P-channel MOSFETs:
TO92 transistors are almost always pinned-out as EBC (bipolar) / SGD (MOSFET) when you are facing the flat part of the transistor package and the leads are pointing down.
TO220/TO247/DPAK/D2PAK transistors are almost always pinned-out as BCE (bipolar) / GDS (MOSFET) when you are facing the front part of the transistor (tab on the back side) and the leads are pointing down. This is easy to remember by the mnemonic GDS = Gosh Darn Son-of-a-gun. (Or something like that. :-)
Transistors with metal tabs (TO220, TO247, DPAK, D2PAK, SOT-223, etc.) almost always have the tab as the collector or drain. This has to do more with the construction of the device than from any sort of convention; the collector/drain is the part of the die that is the most thermally coupled to the metal tab, so it's a natural point of electrical attachment.
Surface-mount transistors with two pins on one side and the third standing alone on the other side (SOT-23, SOT-323) almost always have the collector / drain standing alone. This is because the gate-source / base-emitter voltage differential is small, whereas the collector / drain may be tens or hundreds of volts different, so it provides a larger clearance for that voltage differential to have the collector / drain off on its own. The same holds true for DPAK / D2PAK transistors, where the middle pin is cut short and sticks up in the air; it's done to provide voltage clearance and you connect electrically through the collector / drain via the tab, which is (usually) the same piece of metal as the center pin.
I suppose there are certain transistor parts that are exceptions to these rules (most likely in the SOT-23 and SOT-323 packages) but I'm not aware of any -- still, always check the datasheet.
Simplest way is measuring forward voltage between junction BC and BE, BC junction will have lower forward voltage. In case you use normal Digital Multi Meter (DMM), with similar test current to mine 2n5551 gave me this results: Vbc=642mV Vbe=648mV if i try with resistance range Rbc=23Mohm Rbe=29Mohm For analog multi-meter test currents are little bit higher compared to the digital ones so you can expect lower resistance values (100K-1M) and it is highly non linear doing it this way, but relative forward voltage is lower for BC junction (translates relative resistance is lower for BC junction) compared to BE junction...