# PNP high-side transistor switching with microcontroller [duplicate]

Up to this date I was working with NPN transistor with micro controller and it was working fine. But here I need a PNP transistor.

Does any one can tell me is that the above configuration is correct and that the circuit can be used safely ?

## marked as duplicate by Olin Lathrop microcontroller StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Jul 30 '16 at 15:51

• For an NPN what voltage do you need on the base emitter in order for the transistor be on ? What voltage do you need for the base emitter for the transistor to be off ? For the PNP, the same voltages are needed but instead its emitter base. Do you see a problem ? – efox29 Jul 30 '16 at 13:42
• Ic=Ib * hfe, right? 10k will do the job – Siddhartha Sadhukhan Jul 30 '16 at 13:42
• here is the datasheet: bucek.name/pdf/tip115-7.pdf ; can any one give me a correct design with nearly 1.5 amp collector current – Siddhartha Sadhukhan Jul 30 '16 at 13:48
• No it's not correct, and it has the potential, as it were, to damage the micro. Search for high-side switch. You need another (NPN) transistor in addition to the PNP for this to work. – Spehro Pefhany Jul 30 '16 at 13:50
• – Olin Lathrop Jul 30 '16 at 15:52

You are trying to create a high-side switch.

simulate this circuit – Schematic created using CircuitLab

Figure 1. (a) NPN open collector switch. (b) A failed attempt to make a PNP version.

Does any one can tell me is that the above configuration is correct and circuit can be use safely?

I can tell you that the above configuration is not correct and can not be used safely.

The low side switch is very simple as shown in Figure 1a. The low-voltage logic just has to feed sufficient current into the NPN transistor to turn it fully on.

There is a temptation to think that we could do the same trick with an PNP transistor as shown in Figure 1b. The problem is that the emitter-base junction is always forward biased. This will apply the 12 V to the chip output and destroy it or, if there are protection diodes on the output, the current will flow through the protection diodes into the micro-controller supply (shown as 5 V in this case). The effect of this current flow is to turn on Q3 and the load can not be switched off.

simulate this circuit

Figure 2. A high-side switch.

• We want to drive Q2 hard-on. Given the gain of 350 in your comment 2 mA would be about right so if we set R2 to 1k we'll get 9 mA and that will be sure to work.
• R3 just has to pull the Q2 base high when Q1 is off to prevent it turning on with any leakage through Q1. 10k will be fine. 100k would probably work too.
• Q1 only has to switch about 10 mA so we can ensure that it's turned hard-on with a 1 mA base current. I've shown a 1k but 4k7 would be fine.
• without go for buffer can I drive a NPN transistor using microcontroller and then drive PNP transistor using that NPN transistor. !Like this . is yes then what would be the value of r1,r2 and r3 . suppose hfe=350 for both the transistors and I want 600ma at the LOAD. please describe the math – Siddhartha Sadhukhan Jul 30 '16 at 15:15
• Yes, that will work. – Transistor Jul 30 '16 at 15:24
• I know basic about transistor like Ic= Ib * hfe. but I am getting confuse on the collector side of NPN transistor with r2 and r3. I just cant figuring out the base current of PNP transistor. please describe the schematic and math for resistances where I want 600ma on the LOAD considering hfe=350 for both the transistors. – Siddhartha Sadhukhan Jul 30 '16 at 15:33
• See the update. – Transistor Jul 30 '16 at 15:43
• Just a note to Siddhartha Sadhukhan: The 2N3906 isn't spec'd for 600mA continuous. It's absolute max spec is 200mA and that is an absolute specification, not a recommended one. You need to look for a medium power PNP BJT that is specified near 600mA. The BC636 might be able to do okay. But you'd have to look over the details here, too. (There's no escaping 'the details.') – jonk Jul 30 '16 at 23:50