Transistors: Your Complete Guide On How To Use Them In Electronics


Here you will find the complete guide on transistors.

From the basics of transistors, the different types, the most popular parts, and how to use them in circuits, I have you covered in this transistor guide.

This is part of our Basics series on diodes and transistors.​

What Is A Transistor?

Let's get started with an easy to understand transistor definition. In order to define transistor, we want to look at the big picture and how it fits into electronics.

We can define it as follows:

transistor = electronic device that can be used to switch or amplify electrical energy

#1 Lessons: Transistors make great switches and amplifiers, and the two main types of are:

Bipolar Junction Transistors (BJT) - you use current to manipulate

Field Effect Transistors (FET) - you use voltage to manipulate

The transistor is a fundamental building block of modern day electronics. When it was invented, it led to an electronic revolution that ushered in a new era of technology.

The transistor radio was one of the first things to be revolutionized from this technology. The size of a radio dramatically dropped by not needing to use vacuum tubes anymore.​

Without the transistor, modern electronics would not exist.

Who Invented The Transistor?

You might be asking: so when was the transistor invented? There are three important dates in regards to the invention of the transistor:

1927 - Julius Lilienfeld patents the field-effect transistor, but couldn't produce it at that time due to limits of technology.

1947​ - William Shockley, John Bardeen, and Walter Brattain invent the point-contact transistor at the company Bell Telephone Laboratories, Inc.

1956 - Nobel Prize in Physics awarded to Shockley, Bardeen, and Brattain for the transistor.

What Does A Transistor Do?

The two main transistor functions are as an amplifier and a switch.​ These functions work for individual transistors as well as combinations of them.

Joining several transistors with other electrical components like resistors and diodes can even create logic gates.

We will walk through each of these in more detail next.​

Transistor Amplifier

Any time you want to use a little of something to get even more of something, its called amplification.

As an analogy, consider mechanical leverage. When you need to do mechanical work on something, if you add leverage, you can amplify your work.

The physics of transistors allows us to use either voltage or current to manipulate leverage of electrical energy in the transistor.

The net effect is that we can use a little voltage or current to control a much larger voltage or current. That is what we call an amplifier.​

We will look at this in more detail when we review the different types of transistors later.​

Transistor Switch

One of the best features of transistors that enables modern digital electronics is that a transistor can act like a switch.

When you turn on the light switch in your home, you do a little mechanical work with your hands that allows electricity to flow through your light bulbs.

Using a transistor as a switch, similar to a light switch, allows us to use voltage or current to turn it on or off, which then allows current to flow through another part of the circuit.​

Putting many different switches together in different combinations allows us to build all sorts of different logic gates, which we will cover next.​

Transistor Gate

A typical logic gate these days has several transistors as well as other components in it.​ It turns out that there's been a long evolution for the creation of logic gates in circuits as manufacturing technology got better and better.

Transistor logic gates these days are usually made out of MOSFETs, and more specifically CMOS. We will cover them in detail later.​

A transistor AND gate for example, ​can be made with two transistors at a minimum. To see how other gates can be made from transistors, check out this awesome resource.

Over years of development, transistors keep getting smaller and smaller. For example, back in 1971, transistors were 10 micro-meters.

As of 2014, they are 14 nano-meters with expectations of 10 nano-meters by 2017.​ If you do the math, that is a size reduction of around 1,000 in just 46 years.

Keep in mind this is what can be manufactured. There are research and development groups that have reached transistors the size of 1 nano-meter. This is the current known smallest transistor as of 2017.

The reduction in transistor size allows more and more transistors to be packed into devices like central processing units (CPUs) in computers.

The overall trend of shrinking component size leading to doubling the number you can fit on a device is known as Moore's Law. It's always a fun exercise to go see the transistor count in devices across the years.

As an example, the modern day Intel processor transistor count is in the billions and continuing to grow. The popular i7 CPU is around 1.75 billion transistors.

Also, a way to optimize the number of transistors used in gates is called pass transistor logic.​ Technology is always pushing the bounds of getting more with less size and less components. This leads to cramming more capability into the same physical space.

Transistor Symbol

So what does a transistor diagram look like? Let's find out.

To make things easier, we will look at 6 different types of transistors that you will most commonly run across.

The NPN transistor symbol and the PNP transistor symbol are the most common. They are part of the Bipolar family.

Will also have included the N-channel JFET and the P-channel JFETs, which are junction gate field-effect transistors.

And last, but not least, we have the N-channel MOSFET and P-channel MOSFETs, which are metal-oxide semiconductor field-effect transistors.

Notice for the NMOS and PMOS (MOSFETs) in the diagram, that the dashed line in the middle of them means they are enhanced mode.  If they were straight lines without dashes, they would be depletion mode transistors.​

We will cover each of these types of transistors in much greater detail.​ Here are the symbols for each of them:

transistor symbol

Notice how the direction of the arrow on the symbols is usually what designates an n-type versus a p-type.

Transistor Pinout​

As you can see from the symbol diagram, we have several different pinouts for each type of transistor.​

For a bipolar transistor, the three main pins are the Base (B), Collector (C), and Emitter (E).

Whereas for the FETs (JFETs and MOSFETs), the pins our Source (S), Gate (G), and Drain (D).​

We will look at what these pins do in the next section.​

How Does A Transistor Work?

We have looked at what transistors are, what they do, and the symbols we use for them in circuits. Now let's look at how a transistor works in more detail.​

We'll go over some transistor basics, and then show you the operating modes of each type.

The whole intent of a transistor is to allow you to use a little bit of electrical energy to control a lot more electrical energy.

We can either do this in a binary mode (on or off) like in a switch, or we can use the full range of operation in the transistor and create an amplifier.​

With that said, there are two main transistor types that work in different ways. We are going to keep the theory at a high level where it is practical knowledge for you to use in electronics.

If you are interested in all of the physics behind this, there are entire fields of study in semiconductors and many books for you to explore.​ Remember that people make careers out of this stuff.

Bipolar Junction Transistor​

The first type is called Bipolar Junction Transistors (BJTs).​ A BJT transistor uses both electron and hole carriers, much like diodes.

The holes and carriers are created by semiconductor materials known as P-type (holes) and N-type (electrons).

Both N-type and P-type materials behave a certain way, and when sandwiched together, you can get even more interesting effects.

A typical diode is usually an N-type and P-type material together. Whereas a BJT is three of these together.​ There are both NPN and PNP type transistors.

For example, an NPN is exactly how its named, where there is a sandwich of N-type, P-type, and N-type material put together. 

Back in the day, Germanium transistors were the common way to make BJTs. However, now Silicon transistors are the norm.​

A few key points about BJTs is that the hfe (sometimes called Beta) is a quick form indicator of the amplification ability of the transistor, also known as DC current gain.

Also, transistor saturation simply means that any more current through the base won't give you any more current through the collector and emitter.​

Now let's look at an NPN vs PNP transistor so that we understand better how they work.​

NPN Transistor

An NPN is exactly how its named, where there is a sandwich of N-type, P-type, and N-type material put together.​ An example of the structure can be seen below.

npn transistor

​The structure of this device is set up so that current will not normally flow between the two N-type materials, because a P-type material separates them.

What is interesting though is that when we manipulate the P-type material with current, we can create a bridge between the two N-type materials, which lets current flow between them.​

For example, for the typical single NPN, if we put around 0.7 Volts on the Base, then current will flow through the Base to the Emitter.

This will in turn allow current to flow through the P-type material easier. That allows current to flow from the Collector to the Emitter as the end result. It's allow about material manipulation.​

The basics that you need to know here from a high level are as follows:

For a BJT NPN, when current flows from the Base to the Emitter it turns the transistor on and allows much more current to flow from the Collector to the Emitter.

This is why we often refer to BJTs as current controlled devices.​

NPN Operation

​Now let's look at some big picture ways of operating an NPN. We know that the pins are Base (B), Collector (C), and Emitter (E).

  • ​Cut Off ("off"):  Emitter > Base < Collector
  • Saturation ("on"): Emitter < Base > Collector
  • Forward Active ("proportional"):  Emitter < Base < Collector
  • Reverse Active ("negative proportional"):  Emitter > Base > Collector

For these different modes, a switch will use the cut off and saturation modes.

An amplifier will use the forward active mode, where the current from the Collector to the Emitter is proportional to the current from the Base to the Emitter.

Reverse active mode is where current flows from Emitter to Collector, which is reverse of normal active mode. This mode is not often used.

The key here is that the Base to Emitter Voltage (Vbe), typically around 0.7 Volts, is one of the main ingredients to turn on the NPN.​

Of course, NPN behavior is much more complex than that, but that is the overall take away. ​

PNP Transistor

In a similar way, PNPs have a P-type, N-type, and P-type material order as seen below.

pnp transistor

PNPs are similar to NPNs, but the current direction is different.

The main idea behind this device is that the two P-type materials are separated by an N-type, which means that current won't flow normally between the two P-type materials.

However, when we add current to the mix, we can manipulate the N-type material to act as a bridge between the P-type materials, allowing current to flow.

Here is our main takeaway:

For a BJT PNP, when current flows from the Emitter to the Base, much more current can flow from the Emitter to the Collector.​

PNP Operation

​Next we will look at the different ways of operating a PNP. We remember that the pins are Base (B), Collector (C), and Emitter (E).

  • ​Cut Off ("off"):  Emitter < Base > Collector
  • Saturation ("on"): Emitter > Base < Collector
  • Forward Active ("proportional"):  Emitter > Base > Collector
  • Reverse Active ("negative proportional"):  Emitter < Base < Collector

​The PNP is similar to the NPN, but the currents are reversed. NPN use is much more common, but you'll occasionally come across a PNP.

Many times NPNs and PNPs are used together to get more complex circuit behavior. A good example is a push pull amplifier circuit.

Again, PNPs are a little more complicated than that, but for most circuits that's all you need to know.​

Field Effect Transistor

What's even cooler than manipulating material with current? Manipulating it with voltage instead!​ That's exactly what we are doing with field effect transistors (FETs).

FETs allow us to use an electric field to manipulate the electrical conductivity of the channel in them that controls the switch.

Let's take a closer look at the two main types of FETs.​

JFET Transistor​

A junction field-effect transistor (JFET) is a very simple device.

The main idea is that a JFET will normally conduct current between the Source and the Drain, unless there is a voltage applied to the Gate. ​

This means that a JFET is normally turned on, until a voltage on the Gate turns it off.

The voltage creates an electric field that has the effect of "pinching" the channel that current is flowing through. Just like if you pinch a garden hose to restrict water from flowing through it.

There are two flavors here, where N-type or P-type material can be used for the channel. The material type will determine what type of voltage must be applied to the gate.

N-Channel JFET

The typical construction of an n-channel JFET can be seen below.​

jfet transistor n-channel

The main things to know about an N-channel JFET are:

  • Voltage across Source and Drain causes current to flow. More voltage will increase current flow up until a certain point. Saturation mode is where current stays the same with increasing Drain to Source voltage, Vds.
  • Putting a voltage across the Gate and Source will restrict the overall current flow from Source to Drain, based on how much voltage.  Once the Gate to Source voltage reaches the pinch-off voltage, no current will flow from Source to Drain. This shuts the device off.

To get your head around this, check out this awesome visualization.

P-Channel JFET

In contrast, the typical construction of an p-channel JFET can be seen below.​

jfet transistor p-channel

The P-channel JFET works very similar to the N-channel JFET, except the currents and voltages are reversed.

MOSFET Transistor​

A much more popular form of a FET is the metal oxide semiconductor field effect transistor (MOSFET). Sometimes, people just refer to them as a MOS transistor for short.

As we will see, the MOS part of the name comes from the structure of the transistor, which makes it easier to remember its overall function.​

A MOSFET is normally off until a voltage on the Gate turns the transistor on and allows current to flow between the Source and the Drain.​

They are commonly used in digital electronics and processors.

There are two forms of a MOSFET. They are N-channel (NMOS) and P-channel (PMOS). Let's look at the differences in detail next.

NMOS Transistor

For NMOS, we have a simple structure where the Source and Drain are N-type material, and they are separated by a P-type material. On top of the separation is an oxide layer and on top of that is a metal layer, which is the Gate.

You can see this structure below.​

nmos transistor

Basically, whenever a voltage is on the Gate to the Source (Vgs), the electric field produced affects the P-type material to form a channel between the two other N-type materials, which are the Source and the Drain.

This voltage creates a channel and allows current to flow through it between the Source and the Drain.

Next, let's look in more detail at the different modes of operation for an enhancement mode NMOS.

The main variables are Vgs (voltage from Gate to Source), Vth (Vgs threshold voltage), Vds (Voltage from Drain to Source), and Vds-sat (Vds saturation voltage).

  • Cutoff:  Vgs < Vth, no current flows from Source to Drain
  • Ohmic:  Vgs > Vth  and Vds < Vds-sat, channel is formed based on Vgs, Vds increase causes current increase in a linear fashion
  • Saturation:  Vgs > Vth and Vds > Vds-sat, channel fully formed, Vds increase does not cause current increase

A great visualization for these modes can be found here. The datasheet for your NMOS part should have some chart curves that display drain current (Id) versus Vds, with lines representing different Vgs.

A great example of a high current NMOS is the IRLML6344TRPBF.

If you pull open the datasheet for this part, you'll see that it requires the Vgs to be above 1.1 Volts (Vth). The curve shows us that for different levels of Vgs above that threshold voltage, we get different curves of drain current.

The Vds-sat looks to be around 1 Volt for most cases, which is where the curves start to flat line.

For CMOS, when a voltage is high on the Gate, the transistor is on, and when a voltage is low on the Gate, the transistor is off.

PMOS Transistor

For PMOS, it is very similar to NMOS, except the N-type and P-type materials are reversed. You can see the structure below.​

pmos transistor

The PMOS works very similar to the NMOS, except some things are in reverse. Let's look at the different modes.

The main variables are Vgs (voltage from Gate to Source), Vth (Vgs threshold voltage), Vds (Voltage from Drain to Source), and Vds-sat (Vds saturation voltage).

  • Cutoff:  Vgs > -Vth, no current flows from Source to Drain
  • Ohmic:  Vgs < -Vth  and -Vds > -Vds-sat, channel is formed based on Vgs, -Vds going more negative causes more current in a linear fashion
  • Saturation:  Vgs < -Vth and -Vds < -Vds-sat, channel fully formed, -Vds going more negative does not cause more current

Here is the main point:

For PMOS, when a voltage is high on the Gate, the transistor is off, and when a voltage is low on the Gate, the transistor is on.

CMOS Transistor​

What happens when you combine NMOS and PMOS on the same part? You get a very handy component.

In fact, complimentary MOS (CMOS) is at the heart of processors, SRAM, and logic chips. There are a lot of technical benefits for using CMOS, with details here.​

Transistor Packaging

Transistors come in many different package options, including through hole, surface mount, and chassis mount.

Most electronics designs will use surface mount. However, hobbyists will often use the through hole options.

Higher power dissipation needs might require through hole or chassis mount to get the heat off of the circuit.​

A common through hole package is the TO-92, which has a plastic encasing with three leads. A popular surface mount package is the SOT-23​, which also has 3 pins.

Most Popular Transistors

Darlington Transistor​

Say you need an NPN current amplifier or switch, but the single transistors that you have found just don't have a high enough gain (hfe) to take your low current input to a high current output.

We know that we can amplify current with one transistor, then why can't we do it twice to get even more?

The answer is we can.​ Multiple transistors cause multiple stages of gain, which multiply times each other to give us much greater gain overall.

This is as simple as connecting the two Collectors of the NPNs together, and hooking the Emitter of the first one to the base of the second one.

The darlington symbol is shown below to illustrate this setup.​

darlington transistor

It turns out this is a very powerful device. Of course we could create it with two discrete transistors, but it saves a lot more space if its done in the same integrated circuit.

For example, with the FZT605TA, we could use 1 milli-Amp to drive the first transistor which is amplified to drive the second transistor and allow us to control over 1 Amp of current flow from the Collector to the Emitter.

That's an amplification of over 1,000 times!​

Power Transistor​

When we say power transistor, we usually mean transistors that can handle more than 1 Amp on the output side. This means that for BJTs, the Collector and Emitter current, and for FETs, the Source and Drain current has a max rating of more than 1 Amp.

Some things to look for when looking for a transistor like this is its internal resistances and its max heat dissipation.

Also, if you are dealing with a lot of heat, does it have packaging that allows it to be connected to a heatsink?​

The TO220 package is a famous through hole package that has a nice metal landing pad and screw hole for mounting various heatsinks.

The TIP transistor series is a popular BJT option in this class of part. Here are some great examples:

TIP31 Transistor - collector current max = 3 Amps, hfe = 10, max power = 2 Watts, link

TIP120 Transistor​ - collector current max = 5 Amps, hfe = 1000, max power = 2 Watts, link

​If you are in need of a power FET here, then the IRLML6344TRPBF is a popular choice. It has a max drain current of 5 Amps and a max power of 1.3 Watts. The FET is an enhanced mode NMOS.

Photo Transistor​

When you want to transform photons into current, the most common way is with a photodiode. However, sometimes, the diode won't produce a lot of current from the amount of light that it is exposed to.

Since we know from earlier that transistors make great current amplifiers, why not use a transistor to get us the output current to the levels that we want?

There's clearly two options here.

1. As a circuit designer, we could use a photodiode with a transistor to give us a higher current output from the diode. These are often called photocurrent amplifier circuits.

2. Another option is that for specialized cases, manufacturers actually make single parts (example: PT15-21B/TR8) that simply have a window cut out in them to expose the transistor to photons, which directly effect the transistor in the part. It is also known as an optical transistor.

Depending on your situation, you can make the choice of which one to use based on your requirements.

There are some phototransistors offered in the visible light range. More often, they are intended for the infrared range of the spectrum. That way they are invisible to the human eye. Chances are your TV receiver for your remote control uses one of these.​

If you can find the single part solution at an acceptable price and for the wavelength of light that you need, then go for it. If not, you can always use a photodiode and transistor together to amplify the current from the photodiode.

It turns out that Sharp put out a great application sheet for these types of circuits that covers all of the different options. You can find it here: SMA99017


In addition, optoisolators (also known as a photocouplers) are parts that work by having an LED and a phototransistor built into the package.

See the FOD817 as an example. That way, you are getting true electrical isolation, as the internals only interact by photons.​


On the mechanical side, if you need a way to detect something in motion that can fit precisely through a slot in a material, then a photointerruptor is a neat little device.

It works the same way by having an LED and a phototransistor, such that your circuit can detect when the light between the two is broken and when it is not. The GP1S094HCZ0F​ is a great example.

2n2222 Transistor​

Over the years, one of the most popular transistors for low current and low power has been the 2n2222 transistor​. It often also goes by the name of 2n2222a. This part is a BJT NPN.

Here are the typical specs of the 2n2222a:

  • ​Max collector current = 0.8 Amps
  • Max power = 0.5 Watts
  • DC current gain = 100
  • Collector to Emitter breakdown = 40 Volts

The part is still very popular. Most people go for the plastic package version since its a lot more economical. This version is known as the Pn2222a, and an example is the PN2222ABU.

​2n3055 Transistor

If you need a high current transistor, then the 2n3055 is a great option. It is a BJT NPN, and comes in a beefy TO-3 package.​

Here are the typical specs of the 2n3055:

  • ​Max collector current = 15 Amps
  • Max power = 115 Watts
  • DC current gain = 20
  • Collector to Emitter breakdown = 60 Volts

2n3904 Transistor

Another extremely popular low current transistor is the 2n3904. It is also a BJT NPN.

This transistor is one of your best choices for general purpose circuit current amplifiers, assuming it meets your requirements.

Here are the typical specs for the 3904 transistor:

  • ​Max collector current = 0.2 Amps
  • Max power = 0.625 Watts
  • DC current gain = 100
  • Collector to Emitter breakdown = 40 Volts

The part is offered in the plastic TO-92 package, which makes it very economical for most applications where through hole parts are needed. Hobbyist will often choose this transistor.​

The 2n3906 transistor is the PNP version and a popular one can be found here.

2n4401 Transistor

If you want a general purpose transistor, but need a little more current than the 2n3904, then the ​2n4401 is a good choice.

Here are the typical specs for the 2n4401:

  • ​Max collector current = 0.6 Amps
  • Max power = 0.625 Watts
  • DC current gain = 100
  • Collector to Emitter breakdown = 40 Volts

BC547 Transistor​

Yet another popular low current transistor is the BC547. It is also a BJT NPN. It is known for its super high current gain.

Here are the typical specs for the BC547:

  • ​Max collector current = 0.1 Amps
  • Max power = 0.5 Watts
  • DC current gain = 420
  • Collector to Emitter breakdown = 45 Volts

Using Transistors​

Now that we got through most of the theory and different parts, let's look at some useful transistor circuits.​

Before we get into some transistor tutorials, let's cover a very basic concept that is important to know next.​

Transistor Biasing

Simply put, transistor biasing is setting the voltage and/or current levels to the sweet spot so that the transistor will properly amplify an AC signal to your liking.

Obviously, a lot of this depends on the transistor you are using, as well as the surrounding circuit and voltages.

The best advice is to take a close look at the datasheet for the transistor, as all of the voltages and currents for the different modes can be found there.

Datasheets also usually have some great example circuits that you can use as a reference for your design.​

The next piece of advice is to use a SPICE type software to simulate your circuit. It's amazing what you can learn when you can quickly iterate through massive failure at lightning speeds with simulation software.

The next best thing is to breadboard a circuit and play around. You can take more risks if you are dealing with cheap parts in case something blows up. However, if you are dealing with expensive parts that are hard to replace, then do the above options first.​

Transistor Amplifier Circuit​

If you have a small signal that you need to amplify or even drive a speaker with, then using a transistor is an option.

The basics are simply that you use the transistor to do the heavy lifting on the current.

There are a few ways you can do this:

  1. ​Emitter Follower - one of the most common, also known as common collector, see example
  2. Common Emitter - see example
  3. Push Pull - see example

For simple amplifiers, its great to use a transistor. If you need more advanced amplification, then you really should consider using an op-amp. That way you can get better control over the bandwidth and noise of the circuit.

If you didn't already know this, op-amps are made up mostly of transistors. Sparkfun has a great article where they take you through the most basic amplification circuits and end up putting it all together and showing the basics of an op amp's internals.​

There's a reason why op-amps have lots of transistors in them to control all of the little effects. Don't be afraid to use an op-amp for what its meant for.

A general purpose op amp will cost the same as one or two transistors, so why go to the trouble of designing a complex amplifier circuit out of transistors when you can just grab an op amp and get a much better result.

NPN Transistor Switch​

Often times, we have a processor or microcontroller with a digital pin that can only source around 10 to 20 milli-Amps (check your datasheet). Therefore, we cannot drive anything with more current directly.

A transistor is a great buffer that we can use to amplify the current to control things with. For example, a fan, heater, or other medium to high current device.​ A BJT NPN is a popular choice for these situations.

Design Example​

In the following NPN transistor circuit, we are using the NPN to handle the high current of the fan, while allowing us to control the fan with a low current digital pin.​

transistor amplifier circuit

In this example, we are using the BJT as a NPN switch, since the two operating states are either on or off.

You can see from the schematic that the NPN transistor pinout is such that the Base is connected to the control signal with a resistor, the Collector is connected to the low end of the fan, and the Emitter is connected to ground.

Transistor Selection​

So how do you pick the right transistor for the job? In this case, we look at a few key specs and we need to derate by choosing 2x-3x values for our transistor.

  • Max Collector to Emitter current should be 2x-3x the current through the fan. Example: if the fan pulls 0.15 Amps, NPN should have Collector current (Ic) max greater than 0.3 Amps
  • The hfe needs to be high enough to at least be the current through the fan divided by the current from our digital pin. Example: if our fan pulls 0.15 Amps, and we can source 0.01 Amps through our digital pin, then hfe needs to be greater than 15 (0.15 / 0.01)
  • The NPN Collector to Emitter breakdown voltage (Vce) max needs to be 2x-3x our supply voltage for our fan. Example: if we have a 12 Volt fan, then we need a Vce max of 24 Volts or greater

Those are the main things to look for when picking a transistor for this circuit. Keep in mind that a lot more went into the design of this circuit that someone did the work on long ago.

When we look at the available parts, we find that the PN2222ABU​ meets all of our requirements. It has Ic = 1 Amp max, Vce = 40 Volt max, and hfe = 50 min @ Ic = 0.15 Amp.

To give ourselves some extra margin, we can divide the hFE by 2, which becomes 25. This is  higher than our required 15, which is what we want. 

It means we can probably get away with 0.006 Amps of Base current to drive 0.15 Amps of Collector current (0.15 / 25). We plan on using 0.01 Amps of Base current, which will put us further into saturation mode.

What if your fan or load pulls a lot more current than our example? You might need a more powerful NPN. The TIP120 is a beast with a min hFE of 1,000 across many Collector currents. ​It's also not too much more expensive than our earlier choice.

Resistor Selection

For inquiring minds, to select the right resistor value, R1, we need to look in the transistor data sheet and see the max Base to Emitter voltage, Vbe. For this transistor, its 1.2 Volts.

Then, whatever logic level we are using, we can calculate the resistor. For example:

3.3 Volt logic - 0.6 Volt Vbe = 2.7 Volts

Now we take:

2.7 Volts / 0.01 Amps Base current = 270 Ohms for R1

This restricts the current from our digital pin to 0.01 Amp max at 0.6 Vbe, and puts the current at 0.008 Amp min at 1.2 Vbe. We should be in NPN saturation for both of these.

Diode Selection

The diode is there because of the inductive load of the fan. The diode is not needed if the load is a heater, LED, or other resistive only load.

A typical diode to use for D1 in this situation is the 1N4001​. It has a 1 Amp forward current and a 50 Volt reverse bias max.

Transistor hFE​

When selecting the right transistor hFE:

Most internet sources have a blanket rule of thumb to treat every transistor as having an hfe of 10. This is kind of silly, as it takes away part of the point of having many different transistors to choose from.

What  the normal path to take for determining if the transistor has a high enough hfe and what Base current is required is to look at the data sheet.

You want to find the saturation curves, match your max Collector current for your circuit, and determine the Base current that puts the transistor in full saturation mode. The curve will look like a hockey stick.

Saturation means that more Base current does not get you any more Collector current on the curve. Go a bit further on the curve after it's flat lined. That is the sweet spot.

Some data sheets won't have these curves, so you have to rely on a table that tells you the hFE at certain Collector currents. This is the typical scenario.

Try to match your circuit's Collector current in the table and then grab the minimum hFE. To be safe, you can divide the hFE by 2 to give yourself plenty of margin for error.​

Many people mess up here and get a Collector current from the table that does not match their circuit, so the hfe they use is wrong.

Then, build and test your circuit to make sure its working right. Try swapping a few transistors of the same part number to confirm they all work.​ The circuit should work and the transistor should not get hot.

If your circuit needs require that you source current through the transistor (instead of sink current for the NPN), then you can make a PNP transistor switch circuit instead.​ Although, this is not near as common as using an NPN for this situation.

Testing Transistors​

From time to time, you may need to confirm that a transistor part is working properly.

It turns out that its pretty easy to test a transistor if you can isolate the part out of the circuit. We will cover some methods next.​

How To Test A Transistor

There are two main ways to test a transistor and we will cover them both next. It is important that you remove the transistor from the circuit.

If it is in the circuit, these tests probably won't work effectively.​

Multimeter Manual Method

Most multimeters today have a diode test mode. Sometimes, it is combined with the ohms measurement, or it might be its own specific knob mode. An example can be found below for a Craftsman meter.​ Notice both diode symbols, the button and the knob mode.

how to test a transistor

In order to test the transistor, we need to remove it from the circuit. Otherwise, the test may not be accurate.

To measure our transistor, we take these 4 steps:

1. We move our knob selector to the diode measurement mode. Depending on our meter, we may additionally need to push a mode button at the top to go from sound alarm to diode mode. The visual display should let us know which mode we are in.

2. For an NPN, place the red probe on the Base pin, and black probe on the Emitter pin. You should typically measure from 0.4 to 1 Volt depending on the transistor.

3. For a PNP, place the red probe on the Emitter pin, and black probe on the Base pin. You should typically measure from 0.4 to 1 Volt depending on transistor​.

4. For both NPN or PNP, place one probe on the Collector and the other probe on the Emitter. You should not get a valid reading here. Reverse the probes and again, you should not get a valid reading.

If the transistor passes these steps, it is good. If not, it is bad.

Multimeter Auto Method​

With this method, we will take advantage of the transistor tester that is built into many multimeters. Of course, you will need to have a multimeter that supports this capability.

This test is intended for through hole parts. If your part is surface mount, then you would need to be able to get test wires to connect your part to the meter.​

​If your meter does have this feature, then somewhere on the controls you will find a few slotted holes with labels for NPN and PNP. See the example below for a Craftsman meter.

transistor tester

This test is a three step process:

1. First, move the selector knob to the section labeled "hFE". This puts the meter in transistor mode.

2. Next, notice that the holes are labeled at the bottom for the different pins of a NPN and PNP. You simply want to match these holes to your part leads. There are two rows, one for NPN and one for PNP.

3. With our transistor inserted correctly, the hFE measurement should be within the specification of our part. We can find that in the transistor datasheet.

If the hFE measured matches our expected hFE for our part, then the transistor is good. If not, it is bad.​


That wraps it up for your transistor guide. I hope this was helpful for you.

If you have any questions or fun stories about transistors, let me know about it in the comments below!​

Leave a comment: