Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

basic question on PNP as switch

Status
Not open for further replies.

banh

Advanced Member level 1
Joined
Dec 16, 2004
Messages
458
Helped
17
Reputation
34
Reaction score
5
Trophy points
1,298
Activity points
3,935
the transistor i'm using is pnp :
**broken link removed**

from the circuit i expect:
- when the MCU output is 0V -> the led is turned on.
- when the MCU output is 5V -> the led is off.

however, the led is always on...

is there any possible reason for this?
 

The output from the MCU can be "High" but this doesn't mean 5V (assuming that Vs=+5V) ..
Try to onnect a pull-up resistor, for example 1kΩ, between the base of PNP and +5V ..
Regards,
IanP
 

Vs is 12V.

the MCU output is exactly 5V as i measured.

you mean "pull-up" because the MCU output may not reach 5V?
 

If Vs is +12V, then you are in trouble because the circuit will try to pull up the MCU output to over 11V and possibly destroy it. The series resistor may save it, or maybe not.
 

I have just edited my previous post by adding : assuming Vs=5V ..

If the Vs voltage is 12V you will need to connect this 1kΩ resistor between the base and +12V and increase the value of 3.9kΩ to ≈12kΩ or, if you want to leave 3.9kΩ connect a zener diode (5.6V - 6.2V) in series with the 3.9kΩ ..

Regards,
IanP
 

now, when i lower down Vs to 5V, the problem is still the same. what's the cause here?
 

Assuming Vs=5V and that you have a pull-up (anyting between 1kΩ and 10kΩ) in place, disconnect 3.9kΩ --> LED should go OFF. If it doesn't, you have faulty PNP, if it does, PNP is OK ..
Double check if the MCU pin still have both stages: L (close to 0V) and H(close to 5V) ..
Regards,
IanP
 

still the problem.
what do you mean by disconnect 3.9K? is it equivalent to when MCU output pin = 5V?


my problem is that iit seems the transistor is always on no matter what the MCU output pin value is (0 or 5V).
 

Assuming Vs=5V and that you have a pull-up (anyting between 1kΩ and 10kΩ) in place, disconnect 3.9kΩ --> LED should go OFF. If it doesn't, you have faulty PNP, if it does, PNP is OK ..
This is to test the PNP transistor .. disconnect (for a while) 3.9kΩ resistor or shorten (for a while) the B(ase) with the E(mitter) --> LED should go OFF !!! ..

Regards,
IanP

BTW: have you connected a pull-up between the B and E?
 

yuh, the transistor is working well. by shorting B,E -> LED go off.

now, what should i do to correct by circuit?
i'm still not very clear what's wrong here..

basically what i expect is driving the led from MCU_OUTPUT.

besides the circuit is already fixed onto PCB.. so troublesome.
 

Then, if you say that the voltage at the MCU pin is 5V, there is NO way the PNP can be open and the LED --> ON ..
This voltage has to be below 4.3V, and therefore you have to add 1kΩ rersistor between B and E !!!
Regards,
IanP
 

    banh

    Points: 2
    Helpful Answer Positive Rating
Great, thanks IanP!

it works now.

i have to admit that i don't really know how this PNP works actually and why connecting B,E with a resistor will do..

maybe i have to read on more about this.
at the beginning i just think PNP is just a reverse of NPN. just simply reverse the NPN circuit to get a PNP circuit.
 

now the circuit is:
R57 is still 3k9.

across E and B there is 330 Ω.

when MCU pin is 0V : current flowing into mcu pin= \[ \frac{12-0.75}{3K9}=2.8mA\]


when MCU pin is 5V: current flowing into mcu pin = \[ \frac{12-0.75-5}{3K9}=1.6mA\]

from the spec, mcu pin is still ok sinking these current

the mcu is driving around 20 pnp like this.

. but sometimes mcu misbehave.. i think due to these current sinking problems..

is there any way to reduce the current sinkings?

Added after 15 minutes:

well i think increasing R57 to around 10K while across B and E is 1K might reduce a bit..
 
Last edited by a moderator:

banh said:
now the circuit is:
R57 is still 3k9.

across E and B there is 330 Ω.

when MCU pin is 0V : current flowing into mcu pin= \[ \frac{12-0.75}{3K9}=2.8mA\]


when MCU pin is 5V: current flowing into mcu pin = \[ \frac{12-0.75-5}{3K9}=1.6mA\]

from the spec, mcu pin is still ok sinking these current

the mcu is driving around 20 pnp like this.

. but sometimes mcu misbehave.. i think due to these current sinking problems..

is there any way to reduce the current sinkings?

Added after 15 minutes:

well i think increasing R57 to around 10K while across B and E is 1K might reduce a bit..

Hi Banh,
It is never a good idea to supply outputs with overvoltage, even at a small current. If you use an extra 6k8 resistor over the output to GND in addition to the 10k and 1k, the output will not be put into overvoltage. You will then see ~4.5V at the output point with just the resistors. When activated the PNP will have Ib=1.14mA, as before.

TOK ;)
 
Last edited by a moderator:

    banh

    Points: 2
    Helpful Answer Positive Rating
u're right Gorgon, thanks a lot.

fortunately my MCU has not been killed yet.

what a mistake i made!

actually there are only \[I_{OL}\] and \[I_{OH}\] . There is no such spec on current sinking when the output is high!
 
Last edited by a moderator:

let me add something... refer the datasheet, Vbe = 4V

this is the voltage to turn ON the PNP....

let make something simple as not to confuse on negative number...

Vbe state there is 4V tht means tht the voltage diff between the base n the emitter atleast 4V to turn on(say it another way, is tht more than 4V diff is required to turn the PNP off)

to turn OFF:

emitter voltage - base voltage = ????

12V - 5V = 7V ... still ON
12V - 6V = 6V ... still ON
12V - 7V = 5V ... still ON
12V - 8V = 4V ... OK OK just enuff to turn it OFF!!!

the easiest way to turn on the PNP is to cascade another NPN..

regards,
sp
 

one more thing: my MCU output can be configured as open-drain output.

so Gorgon, if i'm using open-drain output, i wont need your extra 6K8 any more rite? and i wont be worried about the high voltage 11.25V any more.

Added after 17 minutes:

so this is my latest circuit
 

banh said:
one more thing: my MCU output can be configured as open-drain output.

so Gorgon, if i'm using open-drain output, i wont need your extra 6K8 any more rite? and i wont be worried about the high voltage 11.25V any more.

Added after 17 minutes:

so this is my latest circuit

Hi Banh,
Even if you disconnect the pullup driver in the output config, the hardware itself is not physically removed and you will still reverse feed the output. All I/O pins on a MCU is protected against overvoltage and you will (over)load this. The voltage level is too high and may cause damage on your output, if not now maybe later in the lifecycle of your product.

You create a weak spot in your hardware, susceptible to spikes and ESD in the future. Beside that it is a bad design habit if you are in the process of learning to design circuits. And, last this design will only support a limited load current.

Below is how I would have done this, as an example.

Hi SP,
Just for the record, the Vbe is absolute MAX 4V, and this only for a high level load. This creates a lot of heat in the transistor, not healthy for a long time. Vbe sat is only 0.75V for small loads.


TOK ;)
 

sp, you wrote:
sp said:
... refer the datasheet, Vbe = 4V

this is the voltage to turn ON the PNP....

let make something simple as not to confuse on negative number...

Vbe state there is 4V tht means tht the voltage diff between the base n the emitter atleast 4V to turn on(say it another way, is tht more than 4V diff is required to turn the PNP off)

to turn OFF:

emitter voltage - base voltage = ????

12V - 5V = 7V ... still ON
12V - 6V = 6V ... still ON
12V - 7V = 5V ... still ON
12V - 8V = 4V ... OK OK just enuff to turn it OFF!!!

the easiest way to turn on the PNP is to cascade another NPN..

regards,
sp

I'm sorry but the above is a TOTAL BLUNDER!
Vbe=4V this is the voltage to turn ON the PNP....
...
12V - 7V = 5V ... still ON
12V - 8V = 4V ... OK OK just enuff to turn it OFF!!!
...
do you really mean it?

The (silicon) transistor is FULLY open at about 0.75V applied between base and emitter (forward biased, of course, ie. emitter is positive with respect to base for pnp)! For the transistor to be switched off the voltage between B-E close to 0V is satisfying. Say, less than 0.3V (still forward biased) should be enough, breakdown voltage mustn't be exceeded when reverse biased (see below), which is, however, not the case here.
If such a voltage like 4V were applied on B-E in forward direction I can guarantee that the junction would act as a fuse... (even @ a lower voltage)!

btw.:
The voltage Veb0 = 4V in the datasheet (maximum ratings) means a REVERSE! voltage with respect to the junction B-E.
The breakdown voltage V(br)eb0=4V of the B-E junction (holds for the mentioned transistor) corresponds to 100uA emitter reverse current. A higher reverse voltage applied would steeply increase this current and break down the B-E junction.

Eric

Continuing on the basic topic I haven't given any advice yet, so here you are:

a)
Provided Vs must be +12V from any reason, I would use the circuit shown in fig. "Vs=12V.gif" (common collector).

The Zener voltage of ZD is given as follows:

Vs - V_OH < Vzd < Vs - (V_LED + Vbe + V_OL),

so Vzd=8.2V is OK in this case.
The value of R1 can be calculated this way:

R1 = (Vs - Vzd - V_LED - Vbe - V_OL) / I_LED

so, e.g. for a red LED (V_LED=1.65V) and I_LED=15mA (optional):

R1 = (12V - 8.2V - 1.65V - 0.75V - 0.1V) / 15mA = 0.087kOhm ~ 82 Ohm (first approx., depends on real voltage drops across particular junctions).

b)
Suppose Vs = Vcc = +5V, then the circuit shown in fig. "Vs=5V.gif" (common collector again) is simplest in my opinion.

R1 value in this case:

R1 = (Vcc - V_LED - Vbe - V_OL) / I_LED

so, e.g. for a red LED (V_LED=1.65V) and I_LED=15mA again, it gives:

R1 = (5V - 1.65V - 0.75V - 0.1V) / 15mA = 0.167kOhm ~ 150 Ohm

Note that no base resistor is needed!

Note 1:
In both cases (almost) NO current flows from MCU port pin while its output voltage is V_OH (LED is OFF).
When the MCU port output voltage is V_OL (LED is ON), then this pin sinks:

Ipin ~ I_LED / (beta +1), where beta stands for the common emitter dc current gain (Ic/Ib).

(Presume beta=99 ;-), I_LED=15mA, then Ipin=150uA)

Note 2:
Banh, you wrote:
...now it becomes troublesome to use such PNP.
Using NPN in the first place will help avoid all these things...

Using (one) NPN (common emitter) in the original circuit instead of PNP is also possible but it would "slightly" change the function of the original circuit - V_OH will turn the LED on, so the used MCU port pin must be complemented in software to preserve the same functionality.

Best Regards
Eric
 

thanks all for replying.

now it becomes troublesome to use such PNP.

Using NPN in the first place will help avoid all these things.

good lesson for me to learn.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top