Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

npn or pnp to drive a relay ?

1,097 views
Skip to first unread message

Koen Velle

unread,
Jul 13, 1999, 3:00:00 AM7/13/99
to
Hi all,

is there any reason why I should use either a npn or pnp transistor to drive
a relay ?
In most of the circuits I have seen, a pnp is used. Is there a reason for
that ?


Cheers,

Koen.

leon...@village.uunet.be
place dot after leo if you want to mail me.

Terry Harris

unread,
Jul 13, 1999, 3:00:00 AM7/13/99
to
"Koen Velle" <leon...@village.uunet.be> wrote:

>Hi all,
>
>is there any reason why I should use either a npn or pnp transistor to drive
>a relay ?
>In most of the circuits I have seen, a pnp is used. Is there a reason for
>that ?

Strange because it is generally easier to drive things with NPN
transistors based on the assumption that the rest of the circuit is
referenced to 0v so the base drive for a transistor referenced to 0v
is usually simpler.

Industrial systems more often use PNP output drives (probably required
by some safety regualtions now). The reasoning for that is you are
more likely short wiring to ground than +ve supply and the relay won't
turn on which is presumed to be safer.


Cheers Terry...

change mechship to mechshop to reply

unread,
Jul 13, 1999, 3:00:00 AM7/13/99
to
No problem either way, I happen to use NPN as it is easier to remember
to drive active high, turns on relay, when specifiying software.

On Tue, 13 Jul 1999 19:18:12 +0200, "Koen Velle"
<leon...@village.uunet.be> wrote:

>Hi all,
>
>is there any reason why I should use either a npn or pnp transistor to drive
>a relay ?
>In most of the circuits I have seen, a pnp is used. Is there a reason for
>that ?
>
>

Tom Bowns

unread,
Jul 13, 1999, 3:00:00 AM7/13/99
to
Koen -

You want to set up a relay-driving transistor such that the Emitter is at
ground, and the relay connects between the collector and VCC. So, if you have a
negative ground system, use an NPN transistor. If you have a positive-ground
system, use a PNP transistor.

You don't generally want to drive the relay between the emitter and ground,
because this might affect the performance and life of the transistor as the base
will have to be raised to a higher voltage than the emitter, and once the
transistor conducts this voltage will drop thereby causing a higher base current
and possibly damaging the transistor.

-TBB

Todd K. Moyer

unread,
Jul 13, 1999, 3:00:00 AM7/13/99
to
Well, this depends on so many things that it is impossible to give a general
answer. But I could offer a couple possible reasons why a PNP would be
preferred in a given application:

- The base of the transistor requires significant current (on the order of
1 - 10 mA, perhaps), in general, to drive a moderate sized relay. Many
digital output devices can sink current much better than they can source it,
therefore they are better suited to driving a PNP transistor base without
using any buffering.

- The logic sense of the application may require an active-low signal to
drive the relay, and a transistor switch turns on with a logic low drive
signal if the transistor is PNP.

Todd

Koen Velle <leon...@village.uunet.be> wrote in message
news:7mfshk$91h$1...@nickel.uunet.be...

Tom MacIntyre

unread,
Jul 13, 1999, 3:00:00 AM7/13/99
to
"Koen Velle" <leon...@village.uunet.be> wrote:

>Hi all,
>
>is there any reason why I should use either a npn or pnp transistor to drive
>a relay ?
>In most of the circuits I have seen, a pnp is used. Is there a reason for
>that ?
>
>
>Cheers,
>
>Koen.
>
>leon...@village.uunet.be
>place dot after leo if you want to mail me.
>
>

Most, if not all, TV relay startup circuits I've seen use an NPN, with
the transistor bringing the low side of the relay to ground when
switched on.

Tom

Robert

unread,
Jul 13, 1999, 3:00:00 AM7/13/99
to
In addition to all the other good reasons for using PNP, when the relay is
external to the circuit, the only signals that need be routed off the board is
the PNP collector. The relay ground can be tied to any reasonable ground for the
Vcc power supply.

Terry Harris wrote:

> "Koen Velle" <leon...@village.uunet.be> wrote:
>
> >Hi all,
> >
> >is there any reason why I should use either a npn or pnp transistor to drive
> >a relay ?
> >In most of the circuits I have seen, a pnp is used. Is there a reason for
> >that ?
>

Robert

unread,
Jul 13, 1999, 3:00:00 AM7/13/99
to
Not true. I know you'll find this hard to believe but if the higher coil
voltage power supply is floated relative to the TTL ground- then he can
still activate the relay with his TTL driven PNP. The common of the relay
power supply is attached to the coil return and positive side of the supply
is connected to the TTL Vcc.

Terry Harris wrote:

> notj...@worldnet.att.net (James Meyer) wrote:
>
> >>Strange because it is generally easier to drive things with NPN
> >>transistors based on the assumption that the rest of the circuit is
> >>referenced to 0v so the base drive for a transistor referenced to 0v
> >>is usually simpler.
> >

> > If the circuit providing the low level signal for the
> >transistor is TTL based, then a PNP with its emitter referenced to the
> >Vcc supply is a better choice because TTL outputs can sink current
> >better than they can source it.
>
> But that also means the relay supply voltage can not exceed the the
> PNP transistor base driver working voltage - 5v for most TTL.
>
> Cheers Terry...

James Meyer

unread,
Jul 14, 1999, 3:00:00 AM7/14/99
to
On Tue, 13 Jul 1999 17:59:04 GMT, terry....@iname.com (Terry
Harris) wrote:

>"Koen Velle" <leon...@village.uunet.be> wrote:
>
>>In most of the circuits I have seen, a pnp is used. Is there a reason for
>>that ?
>

>Strange because it is generally easier to drive things with NPN
>transistors based on the assumption that the rest of the circuit is
>referenced to 0v so the base drive for a transistor referenced to 0v
>is usually simpler.

If the circuit providing the low level signal for the
transistor is TTL based, then a PNP with its emitter referenced to the
Vcc supply is a better choice because TTL outputs can sink current
better than they can source it.

Jim


Terry Harris

unread,
Jul 14, 1999, 3:00:00 AM7/14/99
to
notj...@worldnet.att.net (James Meyer) wrote:

>>Strange because it is generally easier to drive things with NPN
>>transistors based on the assumption that the rest of the circuit is
>>referenced to 0v so the base drive for a transistor referenced to 0v
>>is usually simpler.
>
> If the circuit providing the low level signal for the
>transistor is TTL based, then a PNP with its emitter referenced to the
>Vcc supply is a better choice because TTL outputs can sink current
>better than they can source it.

But that also means the relay supply voltage can not exceed the the

James Meyer

unread,
Jul 14, 1999, 3:00:00 AM7/14/99
to
On Wed, 14 Jul 1999 01:31:58 GMT, terry....@iname.com (Terry
Harris) wrote:

>notj...@worldnet.att.net (James Meyer) wrote:
>
>> If the circuit providing the low level signal for the
>>transistor is TTL based, then a PNP with its emitter referenced to the
>>Vcc supply is a better choice because TTL outputs can sink current
>>better than they can source it.
>
>But that also means the relay supply voltage can not exceed the the
>PNP transistor base driver working voltage - 5v for most TTL.
>
>Cheers Terry...

Not too big a deal. There are many 5 volt relays available.
And if a relay with a higher voltage coil were the only one available,
then a second supply could be added. A negative voltage supply.

Jim


James Meyer

unread,
Jul 14, 1999, 3:00:00 AM7/14/99
to
On Tue, 13 Jul 1999 22:07:17 -0400, Robert <rom...@earthlink.net>
wrote:

>Not true. I know you'll find this hard to believe but if the higher coil
>voltage power supply is floated relative to the TTL ground- then he can
>still activate the relay with his TTL driven PNP. The common of the relay
>power supply is attached to the coil return and positive side of the supply
>is connected to the TTL Vcc.

Or connected to ground. It makes little difference as long
the coil current is less than the TTL circuit's operating current.
Plus, if it's connected to ground, you get an extra 5 volts for the
relay for free.

Jim


Terry Harris

unread,
Jul 14, 1999, 3:00:00 AM7/14/99
to
Robert <rom...@earthlink.net> wrote:

>Not true. I know you'll find this hard to believe but if the higher coil
>voltage power supply is floated relative to the TTL ground- then he can
>still activate the relay with his TTL driven PNP. The common of the relay
>power supply is attached to the coil return and positive side of the supply
>is connected to the TTL Vcc.

Not hard to believe, but hanging a higher voltage relay supply line
off TLL VCC? how many hoops do you wan't to jump through in order to
use a PNP drive? Probably rather use an N channel MOSFET anyway.

Say it was automotive with a 12v relay, would you really sit your
control logic 0v at +7v so you could use PNP drivers? Well possibly
but for most applications it would cause far too many other problems
with input signal referencing and power supply regulator isolation
etc.

Cheers Terry...

Robert

unread,
Jul 14, 1999, 3:00:00 AM7/14/99
to
Not true again- just establish the 12V line as your reference and consider the
TTL running off 0 to -5V..

Robert

unread,
Jul 14, 1999, 3:00:00 AM7/14/99
to
You have to keep the current direction from emitter to collector in the PNP so
the positive of the coil supply must be connected to the TTL Vcc.

James Meyer wrote:

> On Tue, 13 Jul 1999 22:07:17 -0400, Robert <rom...@earthlink.net>


> wrote:
>
> >Not true. I know you'll find this hard to believe but if the higher coil
> >voltage power supply is floated relative to the TTL ground- then he can
> >still activate the relay with his TTL driven PNP. The common of the relay
> >power supply is attached to the coil return and positive side of the supply
> >is connected to the TTL Vcc.
>

James Meyer

unread,
Jul 14, 1999, 3:00:00 AM7/14/99
to
On Wed, 14 Jul 1999 12:12:00 -0400, Robert <rom...@earthlink.net>
wrote:

>You have to keep the current direction from emitter to collector in the PNP so
>the positive of the coil supply must be connected to the TTL Vcc.

If the positive of the coil supply is connected to the TTL
logic ground, then the voltage from the emitter to the negative of the
coil supply will be the sum of the +5 volts and the coil supply. The
polarity and current direction *will* be correct.

For example, if a 12 volt relay were used, you would only need
to add a supply with 12 - 5 or 7 volts if you returned the coil supply
to ground. Returning it to the +5 volt rail would require a 12 volt
added supply.

Make a little sketch and trace the currents and voltages. I
think you'll eventually see that the return for the coil supply does
not *have* to be the +5 rail.

Jim


John Neale Baraclough

unread,
Jul 14, 1999, 3:00:00 AM7/14/99
to
The message <378dad35...@netnews.worldnet.att.net>
from notj...@worldnet.att.net (James Meyer) contains these words:

> If the circuit providing the low level signal for the
> transistor is TTL based, then a PNP with its emitter referenced to the

> Vcc supply is a better choice .....


Not so. The high level output of TTL is only guaranteed to be 2.4
volts. It is usually higher but not always. This means that when the
PNP transistor should be off it will still have 2.6 volts between
base and emitter, easily sufficient to turn it on, if only partly. In
designs where I have used PNP output drives it was because the device
being driven required a higher supply voltage than +5v and I always
put an NPN transistor in front of the PNP to ensure that the latter
really turned off.

John
--
janet.a...@zetnet.co.uk

James Meyer

unread,
Jul 15, 1999, 3:00:00 AM7/15/99
to

Yes so, John.

The output voltage representing a high level on TTL devices is
specified so that it is guaranteed to be at least 2.4 volts. The high
level output voltage of an *un-loaded* TTL will never be 5 volts.

However, that does not mean that a TTL high voltage will be a
rock solid 3.0 volts (to pick a number). The seemingly low level of a
TTL high output results from the output stage's inability to actually
*drive* the voltage any higher. Note that that does *not* mean that
it *can't* go any higher.

The output can be pulled higher with a resistor connected
between the +5 volt rail and the output. The resistor can be a very
large value and the output will still go up to 5 volts. That's
because the output stage is not biased to allow current to flow into
the output when it is at a high logic state.

Breadboard a TTL device, set its inputs for a high level
output, put a 100K Ohm pull-up resistor between the output and the +5
supply, and measure the output voltage with a digital multimeter. Or
you can do the same thing without the pull-up resistor and put a
microamp meter between the output and the +5 supply. You will quickly
see that a TTL output won't pull a PNP transistor's base down. In
fact a PNP transistor will pull the output *up*.

It's a "rule of thumb" to use a lot of bypass capacitors in
digital circuits. It's also a rule of thumb to use base-emitter
resistors to eliminate problems with leakage currents. If you use
even a 100K Ohm B-E resistor on your PNP transistor, you will have no
problems driving it from a TTL output.

Oh, and don't forget the current limiting resistor between the
base and the TTL output either.

Jim


Reticient1

unread,
Jul 22, 1999, 3:00:00 AM7/22/99
to
>is there any reason why I should use either a npn or pnp transistor to drive
>a relay ?
>In most of the circuits I have seen, a pnp is used. Is there a reason for
>that ?
>

Nope. Either can be used with similiar efficiency. With a npn, your switching
the ground connection to your relay....with a pnp, your switching the
+DCvoltage to your relay.

Good luck

Steve

unread,
Jul 22, 1999, 3:00:00 AM7/22/99
to Reticient1
------------------------------
One thing you might wish to note is that NPN's are used as sinking
switches, turned on by a higher base voltage/current, but that the PNP's
are used a sourcing switches and turned on by a lower base
voltage/sinked current:

NPN PNP
O O
| |
LOAD B |/v E
| LO=ON o---\/\/\/-----|
| |\ C
B |/ C |
HI=ON o---\/\/\/---| |
|\v E LOAD
| |
_|_ _|_
- -
You don't want to use the NPN as a source because the base voltage
required to turn-on will grow as the ON process brings up the load
voltage, and the ON process can oscillate. Likewise with the PNP,
you want to avoid using it for a sink, because the base can be pulled
below ground (the emitter!) by saturation.
-Steve
--
-Steve Walz rst...@armory.com ftp://ftp.armory.com:/pub/user/rstevew
-Electronics Site!! 1000 Files/50 Dirs!! http://www.armory.com/~rstevew
Europe Naples Italy: http://ftp.unina.it/pub/electronics/ftp.armory.com

Robert D. Mantell

unread,
Jul 27, 1999, 3:00:00 AM7/27/99
to Koen Velle
Either works just as well as the other. What determines which is the drive
applied to
the base of the transistor. If your drive signal is active-high, use an NPN;
low, use
a pnp. The relay coil is of course connected from the collector to the proper
supply
rail.and should have a spike absorbing diode connected across it. The base drive

must be current limited to 2 or 3 ma for low power transistors. A 2k2 value is
good
for a 5 volt supply and 6k2 should work with a 12 volt rail.
Bob - W3TGG

Koen Velle wrote:

> Hi all,
>


> is there any reason why I should use either a npn or pnp transistor to drive
> a relay ?
> In most of the circuits I have seen, a pnp is used. Is there a reason for
> that ?
>

Steve

unread,
Jul 27, 1999, 3:00:00 AM7/27/99
to Robert D. Mantell
Robert D. Mantell wrote:
>
> Either works just as well as the other. What determines which is the drive
> applied to
> the base of the transistor. If your drive signal is active-high, use an NPN;
> low, use
> a pnp. The relay coil is of course connected from the collector to the proper
> supply
> rail.
----------------------
AND on the PNP the emitter, that is!
-Steve

>and should have a spike absorbing diode connected across it. The base drive
>
> must be current limited to 2 or 3 ma for low power transistors. A 2k2 value is
> good
> for a 5 volt supply and 6k2 should work with a 12 volt rail.
> Bob - W3TGG
>
> Koen Velle wrote:
>
> > Hi all,
> >
> > is there any reason why I should use either a npn or pnp transistor to drive
> > a relay ?
> > In most of the circuits I have seen, a pnp is used. Is there a reason for
> > that ?
> >
> > Cheers,
> >
> > Koen.
> >
> > leon...@village.uunet.be
> > place dot after leo if you want to mail me.

--

John Fields

unread,
Aug 8, 1999, 3:00:00 AM8/8/99
to

Steve wrote:

> AND on the PNP the emitter, that is!
> -Steve

---

I don't think so.

For the common emitter configuration the coil always goes between the collector and
a supply rail. Positive for the NPN and negative for the PNP.

The emitter of the NPN goes to the negative rail, the emitter of the PNP goes to the
positive rail, and either transistor is turned on by driving the base toward the
rail supplying the collector.

But you already knew that...

Must've been a typo?

---

John Fields Austin Instruments, Inc.
El Presidente Austin, Republic of Texas
"I speak for the company" http://www.austininstruments.com

0 new messages