You are on page 1of 4

Microcontroller Interfacing Part 12

Using PNP Transistors to Switch Higher Voltage Loads

The easiest way to switch a higher power load than a microcontroller can handle is to use an NPN transistor as
explained in Part 7. Part 8 showed how to use a PNP transistor allowing the load to be at ground potential, as is
sometimes necessary. One limitation with the circuit described in Part 8 is that the load cant run on a voltage
higher than the microcontrollers supply voltage. This chapter shows how to drive a higher voltage load that must
be at ground.
High Side Switching
The circuits described in Parts 7 and 8 are pretty simple and if the application allows, are a good way to go.
Unfortunately your application may have requirements that those circuits wont meet. Automotive applications for
example usually require driving a grounded load with 12V. Figure 12-1 shows one way to accomplish this. In this
circuit microcontroller port pin P0 turns NPN transistor Q1 on and off. Q1 in turn handles the higher voltage and
currents that the micro cant handle to turn PNP transistor Q2 on and off. Q2 acts as the switch that supplies
power to the load.
Lets suppose the load is a 12V lamp that runs at .5 A. The first step is to select the transistor that switches the
load. A search though our parts bin produces a TIP32C transistor in a TO-22 case. That looks beefy. Will it
work? Table 1 shows some key specs. Note that the specs for the TIP32 have negative numbers. This is
backwards than specs for NPN transistors. This is because current directions are in the opposite directions with
the two transistor types. Base current flows into an NPN transistor, but flows out of a PNP transistor. We can
ignore the polarity when we do the calculations.

Figure 12-1

Vceo is -100V. That is well above the 12V that drives the load. It can handle 3A of
collector current which is well above the load current, so it looks like a good
candidate. The next step is to determine what it will take to drive a TIP32.

TIP32C Key Specs









HFE (I c =3 A)


2N222A Key Specs






.3 V



HFE (Ic = 150ma) 50

Table 1

Since 198 ohms is not a standard resistor value we will use a 220 ohm resistor. I might

Vr1 = Vp0 Vbe = 5 1.2 = 3.8V.

By Ohms law
R = V/I = 3.8/.001 = 3800 or 3.8K ohms.
These values will give 1ma of base current though Q1. That is probably enough, but we can increase it quite a bit
and give more margin for out of spec parts and other real world issues by using a lower value resistor. Lets pick a
2.2K resistor. Plugging that in,
Ib1 = V/R =3.8/2200 = .0017A
This would give us a collector current of
Ib * HFE = .0017 X 50 = .086A
This is more than the .050A required to drive Q2 into saturation. Just to be sure this value will not cause problems
we see that the maximum base current for a TIP32C, Ibmax is 3A, and Ic for Q1 is .6A. This is not even close to the
limits of our transistors.

We now only need to figure the values of a few more

components. The first is R3. When we want the load turned
off, the base off Q2 must be at a voltage near or higher than
its emitter. R3 will supply that voltage. The only thing we need
to be concerned with is if the value is too low, and Q1 is turned
on, current will flow through R3 and through R2 and Q1. If the
value of R3 is too low, there will be more current through R2,
which will raise the voltage of the base of Q2. This could
prevent Q2 from fully turning on.

A good rule of thumb would be to make R3 at least 10 times the value of R2. This will not increase the current
through Q1 and R2 much. We already checked to see that we are not near the maximum collector current for Q1, so
a bit more wont harm anything.
The final resistor is R4. When the system is turned on, there might be a some transient currents though P0 which
could turn on Q1 and ultimately the load. If the load is a motor or other device that could cause damage if the load is
turned on until the micro is in full control, R4 would help prevent (but not guarantee) Q1 from being turned on. If the
load is an LED or other device where a brief flash would not cause problems, R4 can be left off. A rule of thumb of
around 10X the value of R1 will be a good starting point for this resistor.
Finally, there is D1. As explained in earlier sections, we want to put the diode in the circuit if the load is inductive to
protect the switching transistors. Motors, solenoids, and relays are all inductive loads. If the load is purely resistive,
D1 can be skipped.
Sometimes the design requirements require more than a single transistor when the load requires more voltage
and/or current than the micro is capable of handling. Using an NPN transistor to drive a PNP transistor will allow
driving a grounded load with higher voltages and currents.

Gotcha List
1. Be sure both transistors can handle the voltage
supplying the load.
2. Ensure the PNP transistor can handle the current
required by the load.
3. Pick a PNP transistor with good gain to minimize
base current requirements and excessive power
4. Protect the transistor with a snubbing diode if the
load is a relay, solenoid, motor or otherwise

Microcontroller Interfacing Table of Contents

Microcontroller Interfacing Part 11
Microcontroller Interfacing Part 13
Back to Electronics Main Page