6
\$\begingroup\$

I would like to create a high-side PNP switch. The usual example of the circuit design is active high (on the IO node in my schematic). I figured to invert this, I'd simply use the NPN inverter/not gate to drive the PNP (bottom right quadrant of my schematic below).

But, I wondered, is it possible to achieve this with less than 3 transistors, or have I done it the correct way? If the answer is yes (you normally use 3 transistors), then is there a way to reduce the part count or simplify the design?

I'm aware that an alternative approach is to use FETs. My question is specific to BJTs.

schematic

simulate this circuit – Schematic created using CircuitLab

Edit: IO voltage is \$3.3\:\text{V}\$, and the IO IC can source \$170\:\mu\text{A}\$ (but can sink \$25\:\text{mA}\$). Part is PCF8574.

\$\endgroup\$
9
  • \$\begingroup\$ What is your I/O voltage? I can't tell from what I see. I do gather that your high side to the load is 5 V, though. \$\endgroup\$
    – jonk
    Commented Nov 7, 2022 at 18:53
  • \$\begingroup\$ You can do it with one PNP if your I/O voltage is the same as the load source voltage. \$\endgroup\$
    – vir
    Commented Nov 7, 2022 at 18:53
  • \$\begingroup\$ @jonk 3.3 V, updated question. \$\endgroup\$ Commented Nov 7, 2022 at 18:55
  • \$\begingroup\$ @NickBolton So you can sink a lot of current but cannot source much? \$\endgroup\$
    – jonk
    Commented Nov 7, 2022 at 18:57
  • 1
    \$\begingroup\$ @NickBolton That's fine. Just wanted to be sure. Then it's pretty easy to do. \$\endgroup\$
    – jonk
    Commented Nov 7, 2022 at 18:58

3 Answers 3

18
\$\begingroup\$

Original answer

Okay. I gather you can sink a lot of current with your I/O pin: about \$25\:\text{mA}\$. But you can source only: about \$170\:\mu\text{A}\$. I don't really care that much about sourcing. But your indication about sinking tells me that it can easily be done.

(Note: I received an important comment to this answer. I'd been focused on the \$25\:\text{mA}\$ figure when I should have been focused on an output current that was an order of magnitude higher. Thanks jp314 for the added comment!)

schematic

simulate this circuit – Schematic created using CircuitLab

The idea here is to just nail the base of \$Q_2\$ to your lower rail. When your I/O pin pulls down on its emitter through \$R_1\$, it generates an emitter current that must be passed along to its collector, which then supplies the base current to \$Q_1\$.

Here, your I/O pin will only be asked to sink about \$10\:\text{mA}\$, which should be fine.

I think you can easily also see that when the I/O pin is high then \$Q_2\$ is off and your weak sourcing capability also isn't an issue since the \$Q_2\$ emitter can only source current, not sink it.

You can make \$R_1\$ a little higher or a little lower in value. But I suspect you'll be fine with the indicated value, too.

Hmm. Now that I look at it, all of your examples used more parts. This is actually the absolute lowest-part-count example as well as using only 2 BJTs.


Added for cases where a 2-quadrant output might be needed

In the circuit above, it may be helpful to add a resistor to pull off stored charge in the PNP when it is turning off:

schematic

simulate this circuit

You could also consider bypassing \$R_1\$ with a speed-up capacitor (\$2.2\:\text{nF}\$ as an example.)

You didn't ask for this, but suppose you needed a two-quadrant output drive, instead. For example, driving a speaker with PWM? You can extend this idea and add another BJT so that the output can both sink and source.

schematic

simulate this circuit

Again, that's the bare minimum. There's nothing to limit the output current other than the load itself. You may want to consider adding emitter resistors in the two output BJTs as a simple way of helping handle direct shorts at the output. (Better still would be to add two more BJTs along with those emitter resistors.) And once you get going on improvements, the circuit does start getting a little more complex-looking, admitted.

Unfortunately \$R_3\$ doesn't meet your I/O's sourcing compliance.

Just offering this, mostly, to illustrate how the earlier idea shown before can be expanded with just the addition of a resistor and a BJT.

\$\endgroup\$
9
  • 1
    \$\begingroup\$ Oh, it's beautiful! So, like common gate on FETs... Didn't know you could do that with NPNs but it makes sense now, thanks! \$\endgroup\$ Commented Nov 7, 2022 at 19:16
  • 1
    \$\begingroup\$ @NickBolton It is pretty! Agreed. Since you were asking for BJT-only, I think this is perhaps the best way. Other techniques exist, of course, when using other types of transistors. \$\endgroup\$
    – jonk
    Commented Nov 7, 2022 at 19:20
  • 1
    \$\begingroup\$ @NickBolton Perhaps so. It's a technique that I learned a very long time ago and it's always in mind when the circumstances warrant it. I will add an example of a 2-quadrant driver you can apply to your circumstance, should you need one. \$\endgroup\$
    – jonk
    Commented Nov 7, 2022 at 19:24
  • 1
    \$\begingroup\$ add ~ 100k between base and emitter of the upper PNP. That helps it turn off faster and also means that leakage on the NPN won't cause it to leak. You can also ground the 1.5k and drive the base of the NPN directly with the IO (no need for a resistor. \$\endgroup\$
    – jp314
    Commented Nov 7, 2022 at 19:44
  • 1
    \$\begingroup\$ Beta for that PNP at high currents is 60 or lower. To ensure saturation you should probably have a forced beta of 30 or lower. Therefore the 1base current should be (5V/20ohm/30_beta) = 8 mA ==> the 1.5k should be (3.3-0.7)/8m= 270 ohm for margin. The I/O may not be able to drive 8 mA strongly, so perhaps better to drive the base as in the comment above. \$\endgroup\$
    – jp314
    Commented Nov 7, 2022 at 19:49
5
\$\begingroup\$

A couple of options.

  1. Use 74HCT1G125. 3 state line driver. Works with 3.3V input logic levels, works with 5V supply and drives out 5V logic levels. Just connect a resistor from output to PNP base.

  2. Use a dual bias resistor transistor, as an example MUN531. It contains PNP and NPN BJTs with base resistors built in. Sometimes single devices are called digital transistors because they need no external resistors. The MUN531 works up to 100mA so you need to find another component.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Also known as "pre-biased". Handy when you need more than a few, and wasting all that space on resistors would be ridiculous! \$\endgroup\$ Commented Nov 7, 2022 at 22:05
5
\$\begingroup\$

Jonk beat me to the punch, with the circuit I was going to offer. Here is another. This one sinks less than 60 uA into your uC GPIO pin, but requires more components, and is imho somewhat less robust design, making use of the specific voltages involved.

schematic

simulate this circuit – Schematic created using CircuitLab

enter image description here

enter image description here

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.