Transistor Switches

What is a Transistor?

It’s a current amplifier. This means that it makes a small current flow into a much larger current flow. The difference between the small (input) current and the large (output) current is called the gain (beta) β. For a small signal transistor such as the now obsolete ZTX108 this ranges from 80-120. A modern small signal transistor such as the BC587 has a gain of 120-200. The relationship between the gain, base and collector currents is given by the following equation:

hfe

Why is this important?

Well, microprocessors and microcontrollers do not provide high current outputs – typically 10-20mA of current can be provided into a load. This will be sufficient to light an LED which typically wants 12-20ma of forward current to make the LED illuminate. If you need to spin a motor or drive multiple LEDs from a single pin then the output pin of the microcontroller will need some assistance. This is where our transistor comes into its own.

When there is zero input current i.e the input voltage is zero then the transistor is essentially an open circuit and no current will flow through through the output pin (this is not strictly true as very small leakage currents will cause a tiny current to flow but we need not worry ourselves of this small quantum property!) As the input current increases ohms law will cause a voltage drop to appear across the base-emitter pin and as this voltage approaches 0.6-0.7 volts the transistor will start to conduct causing a current to flow through the output – from the collector through to the emitter junction. The current at the emitter is equal to that flowing through both the base and collector (in an NPN configuration) as the collector current is several magnitudes greater than that through the base it can be considered insignificant.

How to calculate the base current (Ib)

Knowing the relationship between the gain and base or collector currents it’s easy to work out either of the currents from two of the three variables and a simple re-arrangment in the form of Ohm’s law:

RBase

When designining the switch it’s essential that the traisistor operates in the saturation region. To ensure that this is the case ensure that Ib(min) is made three times higher than the calculated version.

As we’re looking for a defined collector current (Ic) use this value and work the calculations backwards. Here’s an example:

A transistor is required to switch a collector current of 10mA. From the data sheet the gain is specified as 80min and 120max.

Rearranging the hfe equation to find ib:

IBB

Now we know the switching base current to make the transistor saturate we can calulate the base resistor to limit the base current to the right level. In the calculation shown below a switching voltage of 5Volts is applied to the base via a resistor that we’re calculating. Subtracting 0.7 from the switching voltage is a requirement of the base-emitter voltage drop which occurs at saturation.

RBB

Using the E12 resistor series, chose the nearest preferred (lower) value giving a resistor of 330KΩ

Leave a comment