simulate this circuit – Schematic created using CircuitLab

I have some 3.3V I/O on a PC Board.

When an output is switched on, I need to switch the 3.3V output voltage with a +24VDC and provide by a nice screw terminal with a 24V output.

On all of my previous PCB plans I have used an N-Type semiconductor and switched the ground - However due to the use case of this output, that isn't an option here.

I have drawn the above circuit based on things I've read - and, with simulations in CircuitLab, I believe it works.

The problem is, I'm not really sure how it works.

Could someone explain to me, what, why, and how, this is working - and suggest if there is a more desirable way to draw this circuit?


2 Answers 2


You have two switches here. Q1 and M1.

When your control signal is 0, Q1 is off. This means there is no current flowing through the collector of Q which means there is no current flowing through that entire branch (R3, and D1). This means that the voltage at the gate of M1 is the same voltage as your 24V rail. A PMOS switches when VGS < Vgs(threshold). For the IRF9530, it begins to turn on at -2V. So M1 is off since, Vgs = 0. (Gate is 24V, and Source is 24V).

When your control signal goes to 3.3V, it turns Q1 on, and now you have current flowing through R3 and D1. D1 being a zener, will clamp the voltage at the gate to 5.1V. So now you have your source voltage at 24V, and your gate voltage at 5.1. Vgs = 5.1 - 24 = -18.9V. This is enough to turn M1 on, now you have 24V passing through the mosfet and to your load.

The datasheet for M1 says that the absolute max voltage at the gate is +/-20V, so you are within spec, but awfully close. If you increase your zener, such that Vgs is not so near your lower threshold it will keep you away from being so close to the -20V limit. You need to be between -4V and -20, so maybe if you aim for -10 and -15 instead, it will put you into a safer region.

Some additional notes. The datasheet for the zener, looks to have a Izt of about 50mA. The current through the zener when Q1 switches is 4mA. I can't see what the zener knee current is, but this may not be enough for the zener, or it puts right at the boundary between zener breakdown and reverse bias. So you would need to decrease your resistor.

For 50mA, the resistance would be about 378ohms. This also means that the power dissipation through the resisor will be much greater, so you need at least a 1W resistor. Alternatively, you swap the position of the resistor and zener, so that is less heat generated from the resistor, and increase your zener voltage to compensate.

Or you can rearrange your circuit slightly like this


simulate this circuit – Schematic created using CircuitLab

Q1 is arranged as a voltage follower and now you have a constant current source.

$$ R = \frac{V_{control}-0.7}{I_{desired}} $$ Since we want 25mA, we plug that into I, and we get R being 104.

The power dissipation through the resistor is now

$$ P = I^2R = 65mW $$

Vgs when on, is about -14V.

  • \$\begingroup\$ I like this circuit better (protects the MOSFET) but you're definitely going to want a resistor in parallel with the Zener diode to pull the gate close to the source voltage smartly when the BJT turns off. \$\endgroup\$ May 6, 2015 at 11:06
  • \$\begingroup\$ @SpehroPefhany ah yes. Is there an optimum value, higher the better ? Anything above 10k ? Doesn't matter ? \$\endgroup\$
    – efox29
    May 6, 2015 at 11:14
  • \$\begingroup\$ For a DC switching application where you don't really need to care about gate capacitance & switch-off time, 10k is fine, even 100k. The only recommendation I'd made is a zener with a much lower Izt. \$\endgroup\$
    – Techydude
    May 6, 2015 at 11:27
  • \$\begingroup\$ @efox29 +1 Something like 4.7K would be what I'd use. You have plenty of turn-on current available. Your 10K is fine for low frequencies. \$\endgroup\$ May 6, 2015 at 12:14
  • \$\begingroup\$ I like the overall topology, but 25 mA in steady on state is excessive. The zener will dissipate 240 mW, and the transistor 285 mW continuously when on. Use a zener that only needs a mA or so and make R1 larger. Put a cap across R1 if you want to speed up turn on. Also, the output should have a reverse diode to ground to protect against turning off inductive loads. \$\endgroup\$ May 6, 2015 at 12:50

What about a voltage divider like the attached schematic?
It is only 0.5 mA plus 3 mA at the base of the BC337 transistor.

That way you don't need any zener diode, do you?

(Forget about MPPT on the diagram below, I am trying to control an old non-configurable inverter with the output of a new configurable MPPT.)


  • 1
    \$\begingroup\$ Please don't post a new question as an answer to an old question. \$\endgroup\$ Sep 8, 2019 at 13:08
  • \$\begingroup\$ I am answering also. About resistor divider instead a zener. Sorry, I thought that it may help as it is easier to have resistors \$\endgroup\$ Sep 8, 2019 at 14:34
  • \$\begingroup\$ @JuanRangel - I have removed the question part from your answer, as answers cannot also contain questions, and you should not try to promote your other question in any answer. I have also removed your comments about the downvotes from the answer. If you really want to talk about them (probably due to you including a question in your answer), then you can explain in a comment. But now I have removed your question from here, that reason for downvotes has been removed. If you want a reminder about the strictly different places for questions and for answers, see the tour and help center. Thanks. \$\endgroup\$
    – SamGibson
    Sep 8, 2019 at 15:45
  • \$\begingroup\$ @SamGibson thanks for the explanation. Sorry. \$\endgroup\$ Sep 8, 2019 at 15:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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