Education – the Bipolar Transistor

Hello readers

Today we continue with the series of articles on basic electronics with this introductory article about the bipolar transistor, and using it as a switch.

What is a transistor?  It is a semiconductor with three leads, with which a small voltage or current applied to one lead can control a much larger current flowing through the other two leads. A transistor can be used as either a switch or an amplifier. Furthermore, there are two main types of transistor – the bipolar and the field-effect transistor. This article will examine and refer to bipolar transistors as transistors. Let’s go!

A transistor consists of three layers of silicon, P- and N-type in fact. Do you recall the diode article? A transistor is basically two diodes connected together in a Y-formation, in one of two ways as shown below:


Also notice the circuit symbols for NPN and PNP-type transistors. Transistors can be found in many shapes and sizes, the size usually being directly proportional to the amount of current the particular transistor is designed to handle. Thankfully the physical shape or package design has been standardised, and each casing type has a designation. Let’s look at some of the more common ones now:

TO-92 casing. When the flat-side is facing you, the pin numbering is 1-2-3. This casing style is for transistors that usually handle up to 100 mA. Unfortunately there are three varieties with regards to which pin is the base, collector and emitter – so always check your data sheet if in doubt.

TO-220 casing. When the metal tab is at the rear (above), the pin numbering is 1-2-3. The metal tab acts as a heatsink, and the hole enables one to bolt it to a larger heatsink, metal chassis, etc. This casing style is for transistors that usually handle up to around 8 amps.

TO-3 casing. These are all metal in order to dissipate heat – as they can handle up to around 75 amps of current. The entire metal case and ends are pin 2; pins 1 and 3 are the usual leads. Check your data sheet for pins 1 and 3! There are many other types of casing, but the three above are usually the most common.

How do transistors work?

For current to flow from the base of a transistor to the emitter, it needs to be forward-biased by at least 0.6 volts. In other words, there must be a potential difference between the base and emitter by 0.6V. If the base is connected to ground, the transistor will not let current pass from the collector to the emitter:


The transistors in the circuits above are NPN transistors. The current that flows from the base to the emitter is known as base current or Ib. The current that flows from the collector to the emitter is known as the collector current, or Ic. An interesting property of the transistor is this: the ratio of Ic to Ib is constant, and Ic is always larger than Ib. The ratio of Ic/Ib is known as the gain of the transistor. When reading a data sheet, gain is usually defined as hFE. This formula also proves that if there is no base current, there will be no collector current – you can’t divide by zero.

Using the transistor as a switch

To use a transistor as a switch, we need to know several things to be successful. For example:

To use the transistor to turn on the “load” we need to:

  • know the current drawn by the load. This is also the transistor’s Ic (collector current). Or the load’s resistance, as Ohm’s law can be used to calculate the current
  • know the transistor gain (hFE)
  • calculate Ib (base current)
  • use the above data to find a value for that lonely resistor

Let’s do that now with a contemporary problem… we have an Arduino that needs to turn a relay on and off at certain times. However you can only source up to 20 mA from a digital output on the Arduino, so we want to use it instead to switch a transistor which can control the relay coil. The problem is, what value resistor to use to control the base current?


First of all, let’s note what we do know. The relay (data sheet) coil requires 60 mA of current to activate, it is a 5 volt relay, and the coil has a resistance of 83 ohms. The transistor (data sheet) is a BC548 NPN transistor, very cheap and easy to find. It can handle a collector/load current of 100 mA, and the hFE (gain) is 110.  That diode is there to loop back pulse current when the relay is switched off. The supply voltage is 5 volts, and the digital output from the arduino is also 5 volts when active. There is also one more thing to take note of – the base-emitter junction is a diode, and therefore has a voltage drop of 0.7 volts. When you are switching large voltages, this is not an issue – however as we are working with a small voltage, the drop needs to be taken into account.

So, let’s calculate Ib, the base current. If hFE = Ic/Ib then 110 = 0.06 A/Ib; which translates to Ib = 0.06/110 = 0.0005 A. Which is basically nothing, so we’ll round it up to 1 milliamp.

Next, the resistor value. Using Ohm’s law (voltage = current x resistance):

Voltage = (5-0.7) = 4.3 volts (we need to take into account the voltage drop over the base-emitter junction of the transistor)

Current = 0.005 A (Will use a slightly higher current just to be on the safe side)

So, resistance = 4.3/0.005 = 860 ohms. For such a tiny current and small voltage, a 1/4-watt resistor is fine. (power = volts x current; = 4.3 * 0.005 = 0.0215 < 0.25)

If we didn’t have an 860 ohm resistor, a little higher is OK. I have used a 1k ohm resistor and it has worked nicely.

And there you have it – a transistor used as a switch. As stated at the beginning, this is only an introduction. There are literally hundreds of thousands of pages of material written about the use of transistors, so don’t stop here – experiment and do your own research and learning! In the next few weeks we will look at using transistors as amplifiers.

As always, thank you for reading and I look forward to your comments and so on. Furthermore, don’t be shy in pointing out errors or places that could use improvement. Please subscribe using one of the methods at the top-right of this web page to receive updates on new posts. Or join our new Google Group.

Some information for this post is from: historical info from Wikipedia; various technical information and inspiration from books by Forrest Mims III;  TO-3 package photo from Farnell Australia.

The following two tabs change content below.

John Boxall

Person. Author of Director of Rare updater of VK3FJBX

4 Responses to “Education – the Bipolar Transistor”

  1. Seeker says:

    I have a couple of questions regarding the transistor tutorial. When you are calculating the base current,using your calculations you came to a value of .0005A, rounded up to 1mA, but decided to use .005A. Does this mean that the transistor only requires 5 milliamps at 5v to activate the base part of the transistor and allow a connection between collector and emitter? Also, why is the resistor necessary? If the transistor can handle 100mA, and the arduino only supplies 20mA, why is the resistor necessary to limit the current to 5mA? Before I came across your page I used the arduino’s 20mA output to trigger transistors, and it worked fine.

    Also, I can’t thank you enough for your tutorials. I have learned so much from your site, far more than any of the arduino books I’ve read. In fact, you really should publish these tutorials as a book! In particular, you explanations of the formulas used to calculate different variables needed (such as the ones above!) in practical circuits are absolutely invaluable, and yours is the only place I’ve found that explains the actual calculations used for circuit, and not some mundane, overwritten explanation of mechanisms.

    • John Boxall says:

      Thanks for your kind words regarding the tutorials.
      From memory I was using the resistor to control the base current Ib as it is related to the gain and base current.

  2. Dario says:

    Hi, i’ve seen a lot of your post’s and your work is really good.
    I Have a couple of questions about the diagram you’ve made in the beginning, to use the relay with the arduino digital out. If i had to do so, i would connect the relay to the emitter, doing that is good? And ca i use an 2N3904 instead the BC548?
    (sorry for my english, i’m learning)


Leave a Reply

Subscribe via email

Receive notifications of new posts by email.

The Arduino Book

Arduino Workshop

Für unsere deutschen Freunde

Dla naszych polskich przyjaciół ...

Australian Electronics!

Buy and support Silicon Chip - Australia's only Electronics Magazine.

Use of our content…

%d bloggers like this: