This is a follow up-question for this question where I had troubles with a latch occuring at start-up. While solving the earlier issue I found another one which I had not been able to anticipate since this is the first time I'm playing with a P-channel MOSFET.

Have a look at this schematic, where I have stripped away everything that's not relevant to the actual problem:


Circuit explanation

The circuit is a part of a voltage monitor. Nominal input is Vcc = 5V, and if the voltage goes higher than 5.5V (feel free to read the above mentioned question for further details) the outgoing supply line (Vcc_OUT) is cut-off to prevent damage.

The opamp is configured as a comparator. It's unfortunately not rail-to-rail, so "high" is ~4.5V, "low" ~0.5V.

When the opamp output is "low", it means that the voltage tripping has not occured. The PNP (Q2) is therefore saturated and pulls the Gate to ground, making the MOSFET go wide open and Vcc_OUT is around Vcc. This is expected, and also works as expected.

When the opamp output is "high", it means that the voltage tripping has occured. The PNP is cut-off, and Gate is tied to Vcc effectively closing the MOSFET and cutting off the supply to Vcc_OUT. This also works as expected.

Background info about Vcc

Vcc comes from a linear regulated power supply. A 9V-transformer is rectified, fed and filtered into a 7805. Their design are beyond my reach. Sometimes error can occur and the Vcc gets raised slightly, and that's where my voltage monitor comes in.

Absolute worst case disaster scenario would be if the rectifier diodes and the 7805 all gets shorted, meaning Vcc will be 9VAC (RMS), around 13VAC. This will instantaneously kill everything.

The problem

The opamp controls the MOSFET as I expect, but when I played around earlier with my lab supply I increased Vcc to the level of the worst case scenario described above; 13V. At this voltage, the MOSFET conducted (or whatever the word, it was not "cut-off")! It should definately not conduct at this Vcc-level! My test-LED that's connected to Drain was very, very lit.

I turned my lab supply back to 5V, and the LED went dark. Increased to 6V, still dark. 7V, still dark. 8V: a tiny, tiny light can be seen in the LED. Increasing to about 10.5V made the Drain / Vcc_OUT have ~5V, and increasing to the disaster level 13V, Vcc_OUT was around 7V.

The guess

As stated earlier, this is my first try with a MOSFET so I'm unable to pin-point the error. My only hypothesis is that because Vcc is floating, and GND is not, the Vgs level is somehow affected at Vcc > 8V, making the MOSFET conduct (which it shouldn't).

The question

Using this setup, is there any way to keep the MOSFET cut-off at all times whenever opamp is "high", no matter what level Vcc has?

Datasheets: FDD6637, OPA2132

  • \$\begingroup\$ Its the OPA2132 power from VCC as well? or where is that being powered from??? \$\endgroup\$ – Kvegaoro Apr 20 '17 at 18:16
  • \$\begingroup\$ @kvegaoro: that is correct, everything is powered by Vcc. Even the opamp. \$\endgroup\$ – bos Apr 20 '17 at 18:19
  • \$\begingroup\$ You want to switch that MOSfet off fast if you want to kill an over-voltage quickly. That gate driver is slow, where the high-value 1k (R1) is discharging MOSfet's gate to Vcc. (This doesn't answer your present problem). \$\endgroup\$ – glen_geek Apr 20 '17 at 19:11

Maybe I'm missing something here, but surely the most sensible thing to do is swap the PNP for an NPN, and swap the opamp inputs? The 0.5V output of your opamp should be able to completely switch off the NPN, and if it doesnt you can just add a diode in series with the base to drop more voltage.


simulate this circuit – Schematic created using CircuitLab

Since the base of the NPN is referenced to ground, the VCC voltage doesn't matter (up to a point), so it will work for your entire range (assuming you choose an NPN that can handle it). I'll add a diagram later.

Edit: added diagram

  • \$\begingroup\$ You know what? It was just as simple as this. The two swaps (PNP->NPN, opamp inputs) solved everything. Thank you. \$\endgroup\$ – bos Apr 21 '17 at 11:07
  • \$\begingroup\$ -1 for (a) critisizing my idea of using a diode in series with the base, (b) suggesting it as a solution in your answer and (c), continuing to criticise my suggestion. You asked for this and you might consider lifting the downvote you misapplied to my answer. \$\endgroup\$ – Andy aka Apr 21 '17 at 20:10
  • \$\begingroup\$ @Andyaka That seems a bit harsh, but it's up to you. I think my answer is the correct one, as it's more reliable (who knows if an extra 0.7V will be enough when VCC gets higher). My use of the diode is (I think) more appropriate, as it's referenced to the ground rail instead of the variable VCC, and so the offset is much less likely to be more than 1.4V (0.7V diode + transistor). My comments on your answer were indeed mistaken, however I don't think they were made impolitely, and were a genuine error. \$\endgroup\$ – BeB00 Apr 21 '17 at 21:41
  • \$\begingroup\$ @Andyaka Your response to the comments were quite rude, and your downvoting of my answer seems unnecessary, but as I said, that's up to you. You have far more reputation than me, and clearly you care about it more. I think my downvote of your answer will stay, not because of your rudeness , but because of the inadequacy of your answer. It was both unclear, and unreliable. Next time you might want to put in a diagram, which helps with the former. \$\endgroup\$ – BeB00 Apr 21 '17 at 21:42
  • \$\begingroup\$ Get over it dude and stop being a bore. \$\endgroup\$ – Andy aka Apr 21 '17 at 23:38

First of all I would not use an op-amp as a comparator, they are not really designed to work that way.

Instead find a suitable open collector true comparator of equivalent performance and wire it this way.


simulate this circuit – Schematic created using CircuitLab

It may also be a prudent to add a little positive feedback to that circuit to add some hysteresis. Otherwise, when the trigger is hovering around the reference voltage that output is going to turn on and off very rapidly due to any ripple or noise that is in the circuit.


simulate this circuit


I would recommend changing the Q2 for a P-channel MOSFET with a logic level gate drive. What is most likely happening with your circuit is look in page 6 of the OPA2132 the drive to positive rail is typical the rail voltage minus 0.9V which will cause Q2 to be turned on because there will be a 0.9V across the emitter to base junction.
Provided the datasheet shows the 0.9V is the value when the device is power from +/-15 volts in the the rails. This is difference between output voltage and the power supply probably is increases as the power supply increases leading to the behavior you are seeing.


If you read the data sheet for the opamp, page 6 tells you that the output cannot get to within about a volt of the positive rail. This means that it can't really switch off the PNP BJT. I expect as the supply voltage rises, the problem gets worse until the LED you have connected starts to glow. I might consider adding a diode in series with the base or, a base emitter resistor of the same value as the one feeding the base. Maybe make both 2k2 in value.


For clarity, when I said base emitter resistor, I would employ a resistor from base to Vcc. Sorry for any confusion.

  • \$\begingroup\$ I dont think adding a diode to the base of the PNP will make it better able to turn off. Surely this will just decrease the base voltage, meaning that it turns off even less? \$\endgroup\$ – BeB00 Apr 20 '17 at 18:47
  • \$\begingroup\$ @BWalker it will reduce the voltage to the base-emitter by about 0.5 volts and that would be enough to turn it off normally but, as I indicated, my preferred solution is to use a resistor potential divider. \$\endgroup\$ – Andy aka Apr 20 '17 at 18:50
  • \$\begingroup\$ I'm a bit confused. When you said diode in series with the base, did you mean a diode between the opamp output and the PNP base? If so, what will happen is that instead of 4.5V and 0.5V, the base min/max voltages will be about 4V and 0V. This will make the base-emitter voltage larger, which will prevent the transistor from turning off. If that's not what you meant, what did you mean? \$\endgroup\$ – BeB00 Apr 21 '17 at 15:14
  • \$\begingroup\$ @BWalker yes in series with the base means in series with the base. If you are struggling to analyse it, look at the accepted answer and try and work out what it means when it suggests the same (NPN transistor might be easier to analyse). Hold on that's your answer so you must be totally wasting my time. \$\endgroup\$ – Andy aka Apr 21 '17 at 18:21
  • \$\begingroup\$ Apologies, I was thinking about the diode in the wrong orientation. Nevertheless, I'm fairly sure you're wrong (although not as wrong as I originally thought). The trouble that the poster was having was that they couldnt turn off the PNP transistor for high VCC. Example: max opamp output 4.5V, VCC=10V. In this case, the transistor will turn on, when it should be off. Adding a diode in series will increase the base voltage by maybe 0.7V, so it's now 5.2V, and the transistor is still on, and not off. You would have to add a string of diodes, the number of which depends on VCC. \$\endgroup\$ – BeB00 Apr 21 '17 at 18:44

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.