This page explains the operation of transistors in simple circuits, mainly their use as switches.
Practical matters such as testing, precautions when soldering and identifying leads are covered by the
Types of transistor
There are two types of standard (bipolar junction) transistors, NPN and PNP,
with different circuit symbols. The letters refer to the layers of semiconductor material used to make the transistor.
Most transistors used today are NPN because this is the easiest type to make from silicon.
This page is mostly about NPN transistors and beginners should initially focus on this type.
The leads are labelled base (B), collector (C) and emitter (E).
These terms refer to the internal operation of a transistor but they are not much
help in understanding how a transistor is used, so just treat them as labels.
Transistor circuit symbols
A Darlington pair is two transistors connected together
to give a very high current gain.
In addition to standard (bipolar junction) transistors, there are
field-effect transistors which are usually referred to as FETs.
They have different circuit symbols and properties and they are not covered by this page.
The diagram shows the two current paths through a transistor.
The small base current controls the larger collector current.
When the switch is closed a small current flows into the base (B) of the
transistor. It is just enough to make LED B glow dimly. The transistor amplifies
this small current to allow a larger current to flow through from its collector (C)
to its emitter (E). This collector current is large enough to make LED C light brightly.
When the switch is open no base current flows, so the transistor switches off
the collector current. Both LEDs are off.
You can build this circuit with two standard 5mm red LEDs and any general purpose low power
NPN transistor (BC108, BC182 or BC548 for example).
It is a good way to test a transistor and confirm it is working.
A transistor amplifies current and can be used as a switch, as explained on this page.
With suitable resistors (and capacitors for AC) a transistor can amplify voltage such as an audio signal
but this is not yet covered by this website.
Common Emitter Mode
This arrangement where the emitter (E) is in the controlling circuit (base current)
and in the controlled circuit (collector current) is called common emitter mode.
It is the most widely used arrangement for transistors so it is the one to learn first.
Functional model of an NPN transistor
The operation of a transistor is difficult to explain and understand in terms of its internal structure.
It is more helpful to use this functional model.
A base current IB flows only when the voltage VBE
across the base-emitter junction is 0.7V or more.
The small base current IB controls the large collector current Ic
by varying the resistance RCE.
Ic = hFE × IB
(unless the transistor is full on and saturated).
hFE is the current gain (strictly the DC current gain),
a typical value for hFE is 100 (it is a ratio so it has no units).
The collector-emitter resistance RCE is controlled by the base current IB:
IB = 0, RCE = infinity, transistor off
IB small, RCE reduced, transistor partly on
IB increased, RCE = 0, transistor full on ('saturated')
The base current IB must be limited to prevent the transistor being damaged
and a resistor may be connected in series with the base.
Transistors have a maximum collector current Ic rating.
The current gain hFE can vary widely,
even for transistors of the same type!
A transistor that is full on (with RCE = 0) is said to be
When a transistor is saturated the collector-emitter voltage VCE
is reduced to almost 0V.
When a transistor is saturated the collector current Ic is determined
by the supply voltage and the external resistance in the collector circuit, not by
the transistor's current gain. As a result the ratio Ic/IB
for a saturated transistor is less than the current gain hFE.
The emitter current IE = Ic + IB, but Ic
is much larger than IB, so roughly IE = Ic.
Using a transistor as a switch
When a transistor is used as a switch it must be either OFF or fully ON.
It must never be partly on (with significant resistance between C and E) because in
this state the transistor is liable to overheat and be destroyed.
In the fully ON state the voltage VCE across the transistor is almost zero and the transistor is
said to be saturated because it cannot pass any more collector current Ic.
The device switched by the transistor is called the load.
When choosing a transistor to use as a switch you need to consider its maximum collector current
Ic(max) and its minimum current gain hFE(min).
Transistor voltage ratings may be ignored for supply voltages less than 15V.
Transistor technical data
Most suppliers provide data for their transistors and there is a table showing some data on the
Power developed in a switching transistor should be very small
Power developed in a transistor appears as heat and the transistor will be destroyed if it becomes too hot.
This should not be a problem for a transistor being used as a switch if it has been chosen and set up correctly because
the power developed inside it will be very small.
Power (heat) developed in transistor:
Power = Ic × VCE
When OFF: Ic is zero so the power is zero.
When full ON: VCE is almost zero so the power is very small.
Would a relay be better than a transistor switch?
Transistors cannot switch AC or high voltages (such as mains electricity) and they are
not usually a good choice for switching large currents (> 5A).
Relays are suitable for all these situations but note that
a low power transistor may still be needed to switch the current for the relay's coil.
For more information, including the advantages and disadvantages, please see the relays page.
Protection diode for loads with a coil such as relays and motors
If the transistor is switching a load with a coil such, as a motor or relay, a
diode must be connected across the load to protect the transistor from the
brief high voltage produced when the load is switched off.
The diagram shows how a protection diode is connected 'backwards' across the load, in this case a relay coil.
A signal diode such as the 1N4148 is suitable for this.
Why is the protection diode needed?
Current flowing through a coil creates a magnetic field which collapses suddenly
when the current is switched off. The sudden collapse of the magnetic field induces a
brief high voltage across the coil which is very likely to damage transistors and ICs.
The protection diode allows the induced voltage to drive a brief current through the coil
(and diode) so the magnetic field dies away quickly rather than instantly. This prevents
the induced voltage becoming high enough to cause damage to transistors and ICs.
Connecting a transistor to a digital IC's on/off output
Most ICs cannot supply large output currents so it may be necessary to use a transistor
to switch the larger current required for devices such as lamps, motors and relays.
The 555 timer IC is unusual in being able to supply a relatively large current of up to 200mA,
sufficient for many relays and other loads without needing a transistor.
A base resistor limits the current flowing into the base of the transistor to prevent it being damaged
but it must also allow sufficient base current to flow to ensure that the transistor is fully saturated
when switched on.
A transistor that is not fully saturated when switched on is likely to overheat and be destroyed,
especially if the transistor is switching a large current (> 100mA).
The next section explains how to choose a transistor and base resistor to ensure full saturation.
Switching a load with a different supply voltage
A transistor can be used to enable an IC connected to a low voltage supply (such as 5V)
to switch the current for a load with a separate DC supply (such as 12V).
The two power supplies must be linked. Usually their 0V connections are linked and an NPN transistor
is used on the IC output. However, if a PNP transistor is used on the IC output the positive (+) connections
of the supplies should be linked instead.
Choosing a transistor and base resistor for a digital IC output
Follow this step-by-step guide to choose a suitable transistor to connect to the on/off output
of a digital IC (logic gate, counter, PIC, microcontroller etc.) to switch a load such as a lamp, motor or relay.
1. Choose the right type of transistor, NPN or PNP
Do you want the load to switch on when the IC output is high? Or when it is or low?
To switch on when the IC output is high use an NPN transistor.
To switch on when the IC output is low use a PNP transistor.
NPN and PNP transistors are connected differently as shown in the diagrams below but the
calculations and properties required are the same for both types of transistor.
NPN transistor switch load switched on when IC output is high
PNP transistor switch load switched on when IC output is low
2. Find out the supply voltage(s) and load properties.
In order to work out the transistor properties required you need to know these values:
Vs = load supply voltage.
RL = load resistance (for example the coil resistance of a relay).
Ic = load current (= Vs / RL).
Maximum output current from IC - check the IC datasheet.
If you are unable to find this information assume a low value such as 5mA.
Vc = IC supply voltage (usually this is Vs but it will be different if the IC and load have separate supplies).
Note: avoid confusing IC (integrated circuit) with Ic (collector current).
3. Work out the transistor properties required
Most suppliers provide data for their transistors but there is a table showing some data on the
Choose a transistor of the right type (NPN or PNP from step 1) to meet these requirements:
The transistor's maximum collector current Ic(max) must be greater than the load current:
supply voltage Vs
load resistance RL
The transistor's minimum current gain hFE(min) must be at least 5
times the load current Ic divided by the maximum output current from the IC.
hFE(min) > 5 ×
load current Ic
max. IC current
4. Work out a value for the base resistor RB
The base resistor (RB) must allow sufficient current to flow to ensure the transistor is
fully saturated when switched on and it is good to make the base current (IB) about five times
the value which just saturates the transistor.
Use the formula below to find a suitable resistance for RB and choose the nearest standard value.
RB = 0.2 × RL × hFE (see note)
Note: Where the IC and load have different supply voltages, for example 5V for the IC
but 12V for the load use the formula below for RB:
Vc × hFE
where Vc is the IC supply voltage
5 × Ic
5. Check if you need a protection diode
If the load being switched on and off is a motor, relay or solenoid (or any other device with a coil) a
diode must be connected across the load to protect the transistor from the brief
high voltage produced when the load is switched off. Note that the diode is connected 'backwards' as shown
in the diagrams above.
The output from a 4000 series CMOS IC is required to operate a relay with a
100 coil, switching it on when the IC output is high.
The supply voltage is 6V for both the IC and load. The IC can supply a maximum current of 5mA.
An NPN transistor is required because the relay coil must be on when the IC output is high.
Load current = Vs/RL = 6/100 = 0.06A = 60mA, so the transistor must have Ic(max) > 60mA.
The maximum current from the IC is 5mA, so the transistor must have hFE(min) > 60
(5 × 60mA/5mA).
Choose general purpose low power transistor BC182 with Ic(max) = 100mA
and hFE(min) = 100.
The diagrams below show how to connect an LDR (light sensor) to a transistor to make
a light-sensitive circuit switch on an LED. There are two versions, one switches on in darkness, the other in bright light.
The variable resistor adjusts the sensitivity. Any general purpose low power transistor can be used to switch an LED.
If the transistor is switching a load with a coil (such as a motor or relay) instead of an LED you must include
a protection diode across the load.
If the variable resistor is between +Vs and the base you must add a fixed value resistor of at least
in the example below) to protect the transistor when the variable resistor is reduced to zero, otherwise excessive base
current will destroy the transistor .
LED lights when the LDR is dark
LED lights when the LDR is bright
Note that the switching action of these simple circuits is not particularly good because there will
be an intermediate brightness when the transistor will be partly on (not saturated).
In this state the transistor is in danger of overheating unless it is switching a small current.
There is no problem with the small LED current but the larger current for a lamp, motor or relay is likely to cause overheating.
Other sensors, such as a thermistor,
can be used with these circuits, but they may require a different variable resistor.
You can work out an approximate value for the variable resistor (Rv) by using a
multimeter to find the minimum and maximum values
of the sensor's resistance (Rmin and Rmax) and then using this formula:
For example an LDR: Rmin = 100,
Rmax = 1M,
so Rv = square root of (100 × 1M)
You can make a much better switching circuit with sensors connected to a suitable
IC (chip). The switching action will be much sharper with no partly on state.
A transistor inverter (NOT gate)
Inverters (NOT gates) are available on logic ICs but if you only require one inverter it may be better
to use this simple transistor circuit. The output signal (voltage) is the inverse of the input signal:
When the input is high (+Vs) the output is low (0V).
When the input is low (0V) the output is high (+Vs).
Any general purpose low power NPN transistor can be used. For general use suitable resistor values are
RB = 10k
and RC = 1k.
With these values the inverter output can be connected to a device with an input impedance (resistance)
of at least 10k such as a logic IC or a 555 timer
(trigger and reset inputs).
If you are connecting the inverter to a CMOS logic IC input (very high impedance)
you can increase RB to 100k
and RC to 10k, this will reduce the
current used by the inverter.
A Darlington pair is two transistors connected together so that the current amplified by the first is amplified
further by the second transistor.
The pair behaves like a single transistor with a very high current gain so that
only a tiny base current is required to make the pair switch on.
The Darlington pair current gain (hFE) is equal to the two individual gains
(hFE1 and hFE2) multiplied together - this gives the pair a very high current gain, such as 10000.
Darlington pair current gain: hFE = hFE1
Note that to turn on a Darlington pair there must be 0.7V across both the base-emitter junctions which are
connected in series so 1.4V is required to turn on.
Darlington pairs are available as a 'darlington transistor' package with three leads
(B, C and E)
equivalent to those of a standard transistor.
You can also make your own Darlington pair from two ordinary transistors.
TR1 can be a low power type but TR2 may need to be high power.
The maximum collector current Ic(max) for the pair is the same as Ic(max) for TR2.
A Darlington pair is sufficiently sensitive to respond to the small current passed by
your skin and it can be used to make a touch-switch as shown in the diagram.
For this circuit which just lights an LED the two transistors can be any general
purpose low power transistors.
resistor protects the transistors if the contacts are linked with a piece of wire.
Touch switch circuit
have kindly allowed me to use their images on this website and I am very grateful for their support.
They stock a wide range of components, tools and materials for electronics and I am happy to
recommend them as a supplier.
This website does not collect personal information.
If you send an email your email address and any personal information will be
used only to respond to your message, it will not be given to anyone else.
This website displays advertisements. If you click on
these the advertiser may know that you came from this site and I may be rewarded.
No personal information is passed to advertisers.
(including this one) as explained by Google.
To learn how to delete and control cookies from your browser please