Searching \ for '[EE]: Simple transistor question' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/index.htm?key=simple+transistor
Search entire site for: 'Simple transistor question'.

Exact match. Not showing close matches.
PICList Thread
'[EE]: Simple transistor question'
2001\02\11@095841 by Byron A Jeff

face picon face
I've found that lately that using transistors for interfacing is critical.
In the past I've used optoisolators and open collector IC's for higher
voltage interfaces. But it's clear that understanding how plain old NPN
transistors do their work is important.

So today's question is how to use an NPN transistor to switch 24V
(arbitrarily picked) with a PIC output pin. From what I've read if you
do the standard:

       +24
        |
      Load
        |
        C
       /
PIC-R--B
       \
        E
        |
       GND

Then the transisor won't be saturated because the 5V output from the PIC
isn't high enough relative to the collector voltage.

Now there are several alternatives:

1) Stick an OC buffer between the PIC and the resistor and add a pullup
resistor between +24 and B. Then the PIC can pull the base low and the
pullup will pull the base to +24, causing saturation.

2) Do the same with an optoisolator.

3) Replace the NPN with a logic level power MOSFET. The MOSFET is completely
on with an input of 4V. And it has such a high impeadence that essentially
the PIC is isolated from the output circuit.

4) Use a relay, but most times that's what I trying to drive with this circuit
as it is. I have cascaded a 5V relay with a higher voltage one in a pinch.

Now Bob Blick has an HBridge motor drive that uses a darlington configuration
with no pullup between the high voltage and the base of the drive transistor.
Here's the schematic:

http://www.saber.net/~bblick/bob/projects/hbridge/hb01sch.gif

What I don't understand is why the drive transistor in any quadrant would
completely saturate. From what I've been reading transistors are current
devices. So maybe the switch transistors provide enough current to get
the drive transistors to saturation, without having to go all the way up
to the drive transisor's collector voltage.

Would anyone care to explain? And let me simplify this to an example. What
happens if I extend the example above:


                 +24
                  |
                Load
                  |
                  C
                 /
        +-------B
        |        \
        C         E
       /          |
PIC-R--B         GND
       \
        E
        |
       GND

Now it looks to me like this won't work because there's no mechanism to
provide positive voltage to the cascaded base so the second transisor will
never conduct.

Would it be sufficient to pull the second base up to +24 with a pullup
resistor? While the first transisistor won't saturate, the second one will.
Right?

I need this circuit to drive a high voltage relay. I already have the
second transistor in place and I was driving it with a RS-232 output which
goes to +12. I want to replace it with a PIC output.

This is an instance where I'm a computer guy trying to understand some simple
EE principals.

Any suggestions?

BAJ

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\02\11@111424 by David VanHorn

flavicon
face
>
>Then the transisor won't be saturated because the 5V output from the PIC
>isn't high enough relative to the collector voltage.

Nooo. Saturating the transistor is all about how much base current you can
deliver.
The transistor has a gain figure (beta) Collector current = Base current *
Beta, at least in this simple example.


>3) Replace the NPN with a logic level power MOSFET. The MOSFET is completely
>on with an input of 4V. And it has such a high impeadence that essentially
>the PIC is isolated from the output circuit.

Right, because it's a field effect device. (Metal Oxide Silicon Field
Effect Transistor)
However, it still needs current to charge it's gate capacitance.
While that is charging, the fet is partially on, and will heat significantly.
If you don't take too long to get there, and you don't do it too often,
then it's not a problem.



{Quote hidden}

If both transistors are NPN, then yes, it dosen't go.
If the second is a PNP, with the C and E reversed, then you have a Zaiklai
pair.
You'll want a resistor from base to 24V to assure that the PNP shuts off
completely though, and
a resistor from Q1 C to Q2B to limit the base current to something reasonable.


>This is an instance where I'm a computer guy trying to understand some simple
>EE principals.
>
>Any suggestions?

Grab a copy of Horowitz and Hill :)
It's well worth it!


--
Dave's Engineering Page: http://www.dvanhorn.org
Where's dave? http://www.findu.com/cgi-bin/find.cgi?kc6ete-9

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\02\11@112044 by Byron A Jeff

face picon face
After I wrote the first message I ran a quick experiment adding the pullup I
alluded to in the previous message. It looks like this:

>
>
>          +--------+24
>          |         |
>          |       Load
>          Rc        |
>          |         C
>          |        /
>          +--Rb2--B
>          |        \
>          C         E
>         /          |
> PIC-Rb-B         GND
>         \
>          E
>          |
>         GND

It worked as expected. Rc causes the load transistor to conduct. When the
input is pulled to +5, the switch transistor conducts pulling the base of
the load transistor low causing the load transistor to turn off.

I'm still interested if the switching transitior in the arrangement above
is saturated or if it's conducting in the linear region. But since it
works, I'm going to roll with it.

The Rb2 was already in place from the original circuit. It didn't seem to
have any adverse effect.

BAJ

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\02\11@113124 by David VanHorn

flavicon
face
{Quote hidden}

The answer is yes. :)  It all depends on the value of the resistors.

>The Rb2 was already in place from the original circuit. It didn't seem to
>have any adverse effect.

In this circuit, it dosen't do much. Rc limits the collector current of Q1
when it is on, and the base current into Q2, when Q1 is off.

Beware though, As designed, Q2 is not guaranteed to be off, when Q1 is on.
If the C-E voltage is high enough on Q1, Q2 will get some base current, and
off you go.
A series diode in place of that second resistor, with a resistor from Q2
base to ground, would fix that.


--
Dave's Engineering Page: http://www.dvanhorn.org
Where's dave? http://www.findu.com/cgi-bin/find.cgi?kc6ete-9

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\02\11@120254 by Bob Blick

face
flavicon
face
>        +24
>         |
>       Load
>         |
>         C
>        /
>PIC-R--B
>        \
>         E
>         |
>        GND
>
>Then the transisor won't be saturated because the 5V output from the PIC
>isn't high enough relative to the collector voltage.

Actually this is the best way to do it. From base to emitter there's a
diode junction(0.6 volt) and as long as you have current flowing through
it, the transistor will conduct collector-emitter.


>Now Bob Blick has an HBridge motor drive that uses a darlington configuration
>with no pullup between the high voltage and the base of the drive transistor.

Look at the lead-in page to the schematic, I've shown the internal
schematic of the darlington transistors I used. They have built-in
pinch-off resistors and also collector-emitter diodes, saves external parts.

Cheers,

Bob

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\02\11@123232 by Byron A Jeff

face picon face
{Quote hidden}

Which translates to the amount of current available at the base. These
are generic NPN switching transistors from RatShack. No data available on the
beta. The only value listed is Hfe = 200.

{Quote hidden}

I think I see what you're saying. The load is a relay coil and when the input
is +5, the relay isn't on. Is it still possible that Q2 is conducting but
just not enough to trigger the relay?

BAJ

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\02\11@124522 by Byron A Jeff

face picon face
>
> >        +24
> >         |
> >       Load
> >         |
> >         C
> >        /
> >PIC-R--B
> >        \
> >         E
> >         |
> >        GND
> >
> >Then the transisor won't be saturated because the 5V output from the PIC
> >isn't high enough relative to the collector voltage.
>
> Actually this is the best way to do it. From base to emitter there's a
> diode junction(0.6 volt) and as long as you have current flowing through
> it, the transistor will conduct collector-emitter.

Well this would be ideal simply because it takes the least amount of
components.

I guess the question I'm still trying to resolve is how to figure out
how much current must I provide the base in order for the transisor to
saturate. Specifically I have a 1K resistor for R which was providing
12 ma of base current in the original RS-232 config. If I drop the voltage
to 5V it'll be 5ma (or thereabouts because of the 0.6V BE diode drop).
What determines if that's enough current to cause saturation. And unfortunately
I don't have time to study Horowitz and Hill ;-)

>
>
> >Now Bob Blick has an HBridge motor drive that uses a darlington configuration
> >with no pullup between the high voltage and the base of the drive transistor.
>
> Look at the lead-in page to the schematic, I've shown the internal
> schematic of the darlington transistors I used. They have built-in
> pinch-off resistors and also collector-emitter diodes, saves external parts.

I see how the integrated parts help. Maybe I'll start using those TIP parts.

BAJ

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\02\11@125554 by Spehro Pefhany

picon face
At 12:33 PM 2/11/01 -0500, you wrote:
o ground, would fix that.
>
>I think I see what you're saying. The load is a relay coil

You need a diode or a zener (reverse biased) across the coil, in that case.
The zener should have a lower breakdown voltage than Vceo for the transistor,
at the relay operating current.

> and when the input
>is +5, the relay isn't on. Is it still possible that Q2 is conducting but
>just not enough to trigger the relay?

It isn't supposed to be on, it's supposed to be *off*. For saturated
operation,
keep Ic/Ib in around the range 10-20, as a rule of thumb. Pick the resistors
to assure that. There's no problem about the Q2 turning on if you keep Q1
saturated when it's on, the Vce(sat) will be maybe 100mV if you pick the
resistors reasonably.

If you want it to be *on* when the input is on, use a PNP Q2 transistor to
drive
the relay (emitter to +24, series base resistor to collector of Q1, and a base
to emitter resistor of about the same value. The relay goes to ground, as does
one end of the paralleled diode.

Hope this helps..

Best regards,

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Spehro Pefhany --"it's the network..."            "The Journey is the reward"
spam_OUTspeffTakeThisOuTspaminterlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
Contributions invited->The AVR-gcc FAQ is at: http://www.bluecollarlinux.com
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\02\11@130423 by Spehro Pefhany

picon face
At 12:58 PM 2/11/01 -0500, you wrote:

>
>You need a diode or a zener (reverse biased) across the coil, in that case.
>The zener should have a lower breakdown voltage than Vceo for the transistor,
>at the relay operating current.

Oops, I gave the correct voltage rating for a zener if it is across the
*transistor*. If it's across the *relay coil* it has to have a regular
diode in series and it has to be rated at less than Vceo - Vsupply - 0.6.

If it's across the transistor, it has to have a breakdown voltage of
< Vsupply, which should be obvious.

Best regards


=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Spehro Pefhany --"it's the network..."            "The Journey is the reward"
.....speffKILLspamspam@spam@interlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
Contributions invited->The AVR-gcc FAQ is at: http://www.bluecollarlinux.com
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\02\11@131241 by Olin Lathrop

face picon face
>         +24
>          |
>        Load
>          |
>          C
>         /
> PIC-R--B
>         \
>          E
>          |
>         GND
>
> Then the transisor won't be saturated because the 5V output from the PIC
> isn't high enough relative to the collector voltage.

It seems several of your questions come from a confusion about saturation.

This description is a bit over simplistic, but here is the general concept.
For any particular base current, there is a maximum collector current the
transistor will pass.  This is limited by the gain of the transistor.
Saturation occurs when the load on the collector does not allow that much
current.  This also means that the collector is allowed to go to its minimum
voltage (for NPN as shown above).  In fact, the C-E voltage is less than the
B-E voltage for a saturated NPN transistor.  The B-E voltage is that of a
forward biased diode, around 600mV.  The C-E voltage of a saturated silicon
transistor can get below 500mV.


*****************************************************************
Olin Lathrop, embedded systems consultant in Devens Massachusetts
(978) 772-3129, olinspamKILLspamembedinc.com, http://www.embedinc.com

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\02\11@132316 by David VanHorn

flavicon
face
>The only value listed is Hfe = 200.

Beta of 200 then.  (I'd design to 100, if I was you :)


>I think I see what you're saying. The load is a relay coil and when the input
>is +5, the relay isn't on. Is it still possible that Q2 is conducting but
>just not enough to trigger the relay?

In this circuit, with two NPNs, it takes a low at the input to turn on the
relay.
Low in turns off Q1, then the current through Rc has nowhere to go except
through Q2's base.
If Rc isn't small enough, then Q2 may not conduct enough current to pull in
the relay.

Don't forget that protection diode across the relay!

--
Dave's Engineering Page: http://www.dvanhorn.org
Where's dave? http://www.findu.com/cgi-bin/find.cgi?kc6ete-9

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\02\11@134638 by Dwayne Reid

flavicon
face
At 09:58 AM 2/11/01 -0500, Byron A Jeff wrote:
{Quote hidden}

Nope - circuit is OK, text under the circuit is wrong.

Here is an easy way to look at the circuit above.  You have to consider the
voltage between the Base and Emitter terminals of the transistor.  The
emitter - base junction looks like a diode, with anode at B and cathode at
E.  In order to make the transistor conduct, you have to feed CURRENT into
the B-E junction.  If the applied voltage is less than 1 diode drop
(0.65V), no base current flows and the transistor is OFF.  As the applied
voltage is increased, the voltage at the B-E junction is clamped at 1 diode
drop and base current is determined by (voltage at PIC pin) - (voltage at
B-E junction) all divided by the value of the series base resistor.

Lets pick some real world numbers.  Vbe is ~0.65Vdc.  Vpic_pin is
5V.  Resistor is 1k.  Base current is (5-0.65) / 1000 or about 4.35 mA.

The MAXIMUM collector current that can flow through the Collector is the
base current X Hfe.  If the actual collector current being sunk by the
transistor above is LESS than the maximum possible current, the transistor
is saturated.  Note that Hfe varies as Ic varies - if you want to saturate
a transistor with a fairly high collector current, you really have to look
at the Hfe curves for that transistor to determine the minimum gain at that
current and work backwards to find the minimum required base current.  But
for small transistors like the 2n4401 and 2n4403, you can assume Hfe is
greater than 100 when Ic is less than 100 mA with no problems.  If you want
to ensure that the transistor is well into saturation, aim for a base
current of 2X the minimum calculated base current.

So - the above circuit driving a 100 mA load with a base current of 4.35 mA
is well saturated.  You could increase the base resistor to 2k2 and still
be in saturation.

dwayne



Dwayne Reid   <.....dwaynerKILLspamspam.....planet.eon.net>
Trinity Electronics Systems Ltd    Edmonton, AB, CANADA
(780) 489-3199 voice          (780) 487-6397 fax

Celebrating 17 years of Engineering Innovation (1984 - 2001)

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Do NOT send unsolicited commercial email to this email address.
This message neither grants consent to receive unsolicited
commercial email nor is intended to solicit commercial email.

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\02\11@135305 by Bob Ammerman

picon face
> So today's question is how to use an NPN transistor to switch 24V
> (arbitrarily picked) with a PIC output pin. From what I've read if you
> do the standard:
>
>         +24
>          |
>        Load
>          |
>          C
>         /
> PIC-R--B
>         \
>          E
>          |
>         GND
>
> Then the transisor won't be saturated because the 5V output from the PIC
> isn't high enough relative to the collector voltage.

If I read this ascii schematic correctly, you have a resistor in series with
the base to a PIC pin, the emitter is grounded and the collector is
connected thru' the load to +24v.

This is a simple 'open collector' output and works very well, as long as the
transistor can be taken into saturation.

Since the base of the transistor will only be Vbe above ground (a few tenths
of a volt), the 5V PIC output is more than enough to saturate the transistor
(as long as the beta is high enough and the R is low enough and the PIC
output can source the required current).

Bob Ammerman
RAm Systems
(contract development of high performance, high function, low-level
software)

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\02\11@151001 by David P. Harris

picon face
Hi-
Thanks for this clear and informative summary of how a transistor works!
Even I could understand it, specially the practical example :-)
David

Dwayne Reid wrote:

{Quote hidden}

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\02\11@161358 by Byron A Jeff

face picon face
>
> >The only value listed is Hfe = 200.
>
> Beta of 200 then.  (I'd design to 100, if I was you :)

From the explanations I've seen it's not a problem.

>
>
> >I think I see what you're saying. The load is a relay coil and when the input
> >is +5, the relay isn't on. Is it still possible that Q2 is conducting but
> >just not enough to trigger the relay?
>
> In this circuit, with two NPNs, it takes a low at the input to turn on the
> relay.

Right. I thought you were saying that there's a situation where Q2 wouldn't
turn off.

> Low in turns off Q1, then the current through Rc has nowhere to go except
> through Q2's base.

Correct, this turns on Q2 and activates the relay. Again I thought you
were talking about Q1 activated and Q2 maybe not going off.


> If Rc isn't small enough, then Q2 may not conduct enough current to pull in
> the relay.

It did no problem. And everything turns off when Q1 is active.

But after reading Bob's suggestion I pulled out Q1 and drove Q2 directly.
It worked fine.

>
> Don't forget that protection diode across the relay!

Of course.

BAJ

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\02\11@162638 by David VanHorn

flavicon
face
>
>Right. I thought you were saying that there's a situation where Q2
>wouldn't turn off.

"might not".  If Q1 in the on state isn't fully saturated, then you may get
base current through Q2. That's where the diode between CQ1 and BQ2 comes in.


>Correct, this turns on Q2 and activates the relay. Again I thought you
>were talking about Q1 activated and Q2 maybe not going off.

Yes.


>It did no problem. And everything turns off when Q1 is active.

Well, you have to check that carefully, you could be just off the edge, or
well in. Measuring the base current, and the voltage on Q1C would be a good
step.



--
Dave's Engineering Page: http://www.dvanhorn.org
Where's dave? http://www.findu.com/cgi-bin/find.cgi?kc6ete-9

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\02\11@175029 by Bill Westfield

face picon face
   > >        +24
   > >         |
   > >       Load
   > >         |
   > >         C
   > >        /
   > >PIC-R--B
   > >        \
   > >         E
   > >         |
   > >        GND

   I guess the question I'm still trying to resolve is how to figure out
   how much current must I provide the base in order for the transisor to
   saturate. Specifically I have a 1K resistor for R which was providing
   12 ma of base current in the original RS-232 config. If I drop the voltage
   to 5V it'll be 5ma (or thereabouts because of the 0.6V BE diode drop).
   What determines if that's enough current to cause saturation.

I(b) * beta should be much greater than I(c)

So if your load current is a 30mA relay coil, and you have 5mA of base
current, you need a transistor with a beta (current gain) of significantly
more than 6 (which is pretty easy.)  You do need to know I(c) to tell
whether you're going to hit saturation; since I(c) has a maximum value for
the transistor, you can calculate the minimum I(b) you'll need to maintain
saturation over the whole operational range, but you really only need to
care about the actual current you'll be using.

Note that beta is not a tightly controlled parameter on transistors; that's
one of the reasons for the "much greater" qualifier...

BillW

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


More... (looser matching)
- Last day of these posts
- In 2001 , 2002 only
- Today
- New search...