PNP & NPN transistor resistor setup

Thread Starter

strantom

Joined Jan 21, 2025
8
I'm trying to trigger 24volts 1AMP output with a PNP that should be off normally and get turned on with 3.3v output that turns on a NPN. I'm having a hard time trying to figure out resistor placement and value. Any help would be apricated.
 

Attachments

BobTPH

Joined Jun 5, 2013
11,516
You need to study the basic operation of transistor switching circuits. Your circuit is not even fixable without starting over again.
 

panic mode

Joined Oct 10, 2011
4,990
nothing to size - there is no base resistor for Q9. nice way to kill your circuit...

to calculate base resistor (such as R60) you need to determine voltage and current across that resistor. in this case you have
24V = Vbe(Q11)+V(R60)+Vce(Q12)
Vbe = 0.7V
Vce=0.1V
so V(R60)=23.2V
to allow 1A through Q11 you would need base current sufficiently high (this depends on transistor gain which you can lookup in datasheet). Normally you want to drive that transistor hard so that it works as a switch. so base current would typically be around 1/10 to 1/20 of Ic which is 1A. Suppose you picked 1/20, then base current is 1A/20=50mA.
now that we know the voltage (23.2V) and current (50mA) we can calculate base resistor R60 as 23.2V/50mA=0.464k or 470 Ohm.

similarly, to calculate R62 you would determine the voltage (3.3V-0.7V=2.6V), needed current (50mA/20 = 2.5mA) and calculate 2.6V/2.5mA=1k

but since you are inexperienced, if you need 24V sourcing outputs, you probably want to stick to ready made high side switches like UDN2981 or study how they work.

also you have two output stages that are connected to same GPIO and same output.

1750253368208.png
 
Last edited:

Thread Starter

strantom

Joined Jan 21, 2025
8
nothing to size - there is no base resistor for Q9. nice way to kill your circuit...

to calculate base resistor (such as R60) you need to determine voltage and current across that resistor. in this case you have
24V = Vbe(Q11)+V(R60)+Vce(Q12)
Vbe = 0.7V
Vce=0.1V
so V(R60)=23.2V
to allow 1A through Q11 you would need base current sufficiently high (this depends on transistor gain which you can lookup in datasheet). Normally you want to drive that transistor hard so that it works as a switch. so base current would typically be around 1/10 to 1/20 of Ic which is 1A. Suppose you picked 1/20, then base current is 1A/20=50mA.
now that we know the voltage (23.2V) and current (50mA) we can calculate base resistor R60 as 23.2V/50mA=0.464k or 470 Ohm.

similarly, to calculate R62 you would determine the voltage (3.3V-0.7V=2.6V), needed current (50mA/20 = 2.5mA) and calculate 2.6V/2.5mA=1k

but since you are inexperienced, if you need 24V sourcing outputs, you probably want to stick to ready made high side switches like UDN2981 or study how they work.

also you have two output stages that are connected to same GPIO and same output.

View attachment 351323

so if i change r60 and r62 will it work?
 

panic mode

Joined Oct 10, 2011
4,990
you asked how to calculate resistors and i obliged.
i did not read the datasheets. you should. so that you use correct values.

and do not forget to have some safety margin on every design parameter.

for example,
do not assume that transistor rated for 1A and 30V can operate at 24V while load current is 1A.
because it can do 1A but.. at some low voltage (say 9V).
and it can do 30V but ... at some low current (say 200mA).
and it also needs clear way of switching between those two states without reaching or exceeding power limit.
Point Q must stay away from power boundary.

1750257901249.png
 

Thread Starter

strantom

Joined Jan 21, 2025
8
you asked how to calculate resistors and i obliged.
i did not read the datasheets. you should. so that you use correct values.

and do not forget to have some safety margin on every design parameter.

for example,
do not assume that transistor rated for 1A and 30V can operate at 24V while load current is 1A.
because it can do 1A but.. at some low voltage (say 9V).
and it can do 30V but ... at some low current (say 200mA).
and it also needs clear way of switching between those two states without reaching or exceeding power limit.
Point Q must stay away from power boundary.

View attachment 351405
Thank you this helps. if the load draws less than 1 amp does that change the calculation of the resistors?
I want the circuit to work under any load up to 1 amp
 

panic mode

Joined Oct 10, 2011
4,990
load is always going to be something else... there are no two loads that are exactly the same. circuits are designed to handle range of parameters. you are not going to redesign and change component values because next load is a bit different.
typical specs include min and max values on any parameters. one of your parameters is output current. so design it wor max current you need and you don't need to worry about load currents that are less than that.
 

sarahMCML

Joined May 11, 2019
697
The BCX51 has a maximum current of 1 Amp, so I'd pick something with more current capability if definitely trying to drive a 1A load. Alternatively, I'd use use a P-Channel enhancement MOSFET in a circuit such as below. To limit the Gate voltage, add a resistor between the NPN transistor and RC, and make the value such that the voltage between V+ and the gate is less than the maximum VGS, but more than the VGS(th). For example, a suitable one would be an AO3401, with 2k2 for RC, and 4k7 for the collector resistor.
Your NPN resistors will be fine!

BiMOSSwch2.jpg
 

panic mode

Joined Oct 10, 2011
4,990
almost...

read the comment, do not just use the circuit as shown. gate to source maximum is usually 20V and in case of AO3401 that maximum is only 12V. so without further consideration, 24VDC would kill any mosfet in that circuit. you really want to split the RC into two resistors to form a voltage divider. personally i would add a zener as well. such circuit can work with wider supply voltage, has lower losses and all parts are tiny.

1750262337125.png

or as mentioned before, for minimum number of parts use small SSR. you just need to add single resistor. that's it. and the small DC SSRs are size of a optocoupler. and like optocoupler, they give you another benefit - galvanic isolation which is awesome to have.
1750264433658.png
 
Last edited:

BobTPH

Joined Jun 5, 2013
11,516
The BCX51 has a maximum current of 1 Amp, so I'd pick something with more current capability if definitely trying to drive a 1A load. Alternatively, I'd use use a P-Channel enhancement MOSFET in a circuit such as below. To limit the Gate voltage, add a resistor between the NPN transistor and RC, and make the value such that the voltage between V+ and the gate is less than the maximum VGS, but more than the VGS(th). For example, a suitable one would be an AO3401, with 2k2 for RC, and 4k7 for the collector resistor.
Your NPN resistors will be fine!

View attachment 351414
Now that is more like it. I could make no sense of the OP’s circuit. There was no load and no input, there was a totally extraneous diode, and something a 3.3V output, also not shown.

Hopefully, he was asking for what you answered.
 

panic mode

Joined Oct 10, 2011
4,990
really? there are only four connections - ground and three global labels. two of them are obviously power (GND and 24V). the remaining two are easy to "decipher" since one of them can only be an input and the other one can only be an output.

24VDC is THE standard supply for industrial automation all over the world. so interfacing to any of millions of devices out there requires 24V I/O while MCU is clearly operating at 3.3V. so this circuit is just a level shifter that can drive some load (or input) of some other device.

since many such loads may be inductive (relay coils, solenoid valves, fans, buzzers/horns,...), every output of every device should have own reverse biased diode - just in case.

so here GPIO of the MCU would connect to O1. and terminal block that allows connecting to external circuits would have connection to DO1b. this is only part of the circuit, other details are elsewhere as suggested by global links.

1750281229104.png

granted, young jedi did not yet gain a habit of drawing circuit so that signals flow in one direction (left to right)
so instead of zig-zagging circuit would be easier to follow in conventional form, something like this
1750282541835.png
 
Last edited:

sarahMCML

Joined May 11, 2019
697
Now that is more like it. I could make no sense of the OP’s circuit. There was no load and no input, there was a totally extraneous diode, and something a 3.3V output, also not shown.

Hopefully, he was asking for what you answered.
Thanks, although that schematic was just a stock one I had to hand, and I really must get around to modifying some of them to avoid having to add additional text mods. Thankfully, panic mode basically did just that in post #11, with his own additions.
 

Ian0

Joined Aug 7, 2020
13,132
almost...

read the comment, do not just use the circuit as shown. gate to source maximum is usually 20V and in case of AO3401 that maximum is only 12V. so without further consideration, 24VDC would kill any mosfet in that circuit. you really want to split the RC into two resistors to form a voltage divider. personally i would add a zener as well. such circuit can work with wider supply voltage, has lower losses and all parts are tiny.
1A for 100uS might be pushing your luck on a 1N4148.
 

panic mode

Joined Oct 10, 2011
4,990
totally agree... even though 0.1ms is brief and datasheet states that absolute maximum for this product is 1A for 1 second (non repetitive)
 

WBahn

Joined Mar 31, 2012
32,852
I was going from the Vishay datasheet which says 2A for 1us. Is that better or worse than 1A for 1second?
Largely impossible to say -- it depends on a number of factors. The consideration that sets one limit (such as thermal heating of the die causing dopant migration) may be completely different than the consideration that sets the other (such as fusing current for the bond wires). Even if the limits are both due to the same consideration, one might be "worse" in one package and the other might be worse in another package.
 
Top