How do transistors differ?

Hi, I am pretty new to Arduino and I have come across many different types of transistors (2N2222A, TIP41C, BB135 etc.) so I was wondering how they all differ, don't they all consist of two P type and one N type or the opposite. And can I substitute them for each other? As far as I can tell the only difference is the layout of Collector, Base and Emitter.
Thank you.

There are many videos on YouTube that will explain things.

Also see things on the internet.

examples:

https://www.google.com/search?q=youtube+transistors&rlz=1C9BKJA_enCA832CA832&oq=youtube+transistors&aqs=chrome..69i57j0l3.11017j0j7&hl=en-US&sourceid=chrome-mobile&ie=UTF-8

I understand how transistors work (to some extent) I just don't get what different types do differently.
Thanks.

BJTs vary mostly in frequency, power capabilities, and by type (NPN/PNP) characteristics.

For low power applications on the Arduino, the common 2N2222 will suffice.


FYI

So they all do the same thing?

The differences which transistors? Can you be more specific? Are you talking generally or specifically? I don’t understand the question.

All BJTs operate on the same basis.

They are current controlled devices.

In its simplicity, a small base current controls collector current.

BJTs have a gain factor, example 2N2222 has a HFE (gain) of ~100.

A base current of 1mA can result in a collector current of 100mA.

Urge you to view the YouTube videos.

Thank you larryd. I have one more question I tried looking it up and I'm pretty sure most videos had the answer but I couldn't follow, I see everywhere that the two main functions are switching and amplifying, but I don't really get when it does what. How do you switch without amplifying? Does it depend on the base current?

It has to do with biasing. To used a transistor you have to set the dc bias to get it to do what you want. Research common emitter. It’s the most common form.

OK. I think I got it.
Thank you so much for your time and patience.

Next thing to understand is the VI curve and saturation vs linear region. hFE or beta is not dependable and can vary widely between transistors from the same batch. It will also be higher or lower due to current. Transistors are very interesting devices but one that many people find difficult and challenging to master.

There are many peculiarities including it’s non linear region due to the diode junction of Vbe and all the different ways to bias them... plus the complexity doubles with NPN vs PNP. I believe that’s why many folks just use MOSFET in saturation. But to amplify, BJTs are better without Vgs to overcome.

Switching applications are similar to amplifying.

In digital applications, a 2N2222 can be used as a digital switch with the base used as the input and the current in the collector controlled between some maximum level to a zero level.

A small amount of output current from the Arduino (maybe 20mA to 0mA) goes into the 2N2222 base, then a LED connected to the collector can be turned ON the OFF. Maybe the LED current flow is from 500mA to 0mA.

The same transistor can be connected to a microphone where a small microphone current goes to the 2N2222 base and the collector then sends a much larger current to a power amplifier that drives a speaker.
The small microphone current is not capable of operating the 2N2222 like the previous switching of a LED.
The 2N2222 operates as a linear device, that is, the microphone current might be multiplied by a factor of 10.
A 0.1mA microphone level would be converted to 1mA, a 0.2mA microphone current (when shouting) would give 2mA. 0.3mA gives 3mA etc.

Linear amplification is like a ratio like 1 to 10, 1 on the input 10 on the output, 2 at input 20 at the output.
Switching is from 0 to a maximum, 0 gives 0, 1 gives 500, 2 gives 500, 3 gives 500.

So a switch use Base as input and collector as output while a amplifier use base as base collector as input and emmiter as output??? :confused:

BJT amplifiers can be a: common base, common collector or common emitter configuration.

Each of the above have certain characteristics which are necessary in ‘linear’ amplifier designs.

~90% of the time, however, you will see a common emitter configuration.

These have the input going to the ‘base’ the ‘emitter’ is common and the output is at the ‘collector’.

This is similar to the BJT ‘transistor switch’ configuration.


Unless there is a reason for you to learn about ‘linear’ amplifiers, suggest you concentrate on BJT and MOSFET transistor switches.

virtuos1:
Thank you larryd. I have one more question I tried looking it up and I'm pretty sure most videos had the answer but I couldn't follow, I see everywhere that the two main functions are switching and amplifying, but I don't really get when it does what. How do you switch without amplifying? Does it depend on the base current?

There are 4 modes of operation for a BJT depending on whether each of the EB and BC junctions is forward
biased or not:

EB forward, BC reverse: active mode, used for analog amplification. The current gain hfe applies only to this.
EB forward, BC forward: saturation - used in switching, its the on state, base current needs to be about 5 to 10% of collector current for full saturation.
EB off/reverse, BC reverse: cutoff mode, used for switching, its the off state, only leakage current flows.
EB off/reverse, BC forward: reverse active - useless for almost anything.

Note that switching and analog use different modes, and different current gains apply.

Typical transistors have around 100 times higher doping in the emitter to the base, and the base has
typically 100 times the doping of the collector. The emitter's job is to inject carriers into/across the base,
the collectors job is to handle high voltages in reverse bias. There is nothing symmetrical about BJTs
despite 'NPN' and 'PNP' looking symmetric.

A lot of the variation between devices is due to the doping levels and profiles across the two junctions, the
width of the base and the width of the collector (must be large for high voltages). For switching transistors
and RF transistors special "trap" dopants are also used (as well as p- and n-dopants) to speed up
recombination of electrons and holes on switch-off, or to increase the maximum frequency of
operation - you may sometimes see the phrase "gold doped", gold is one such trap dopant.

In manufacture the dopants can be added by deposition, can be diffused into the surface, and can be
implanted by an ion-beam - so there are many possibilities for dopant profiles to tailor a device
for a specific task. Some features that transistors are designed for are high bandwidth, high power pulse
handling, low noise, low leakage, high gain, accurate logarithmic Vbe curves, high voltage, robustness
to avalanche breakdown, low inductance, low capacitance. Its a very complex subject.

virtuos1:
So a switch use Base as input and collector as output while a amplifier use base as base collector as input and emmiter as output??? :confused:

This illustrates the danger of trying to summarize a huge subject in a few forum posts. Those are device configurations that might be used with a switch, an amplifier, or even an oscillator.

I get it.
Thank you so much.