P Channel Mosfet not switching at higher voltage. - Page 1
Forum section: electronics / beginners

author: PoDuck
author_rank: Regular Contributor
timestamp: September 11, 2020, 03:54:19 pm
content: I happened across some P channel mosfets, and I was trying to get them to work, but no matter what I do, I can't get it to shut off voltage to the load.I have attached schematics of both ways I have attempted to get this working. I don't see any activity on the LED until I bring the input voltage (Where it says +12V) down to around 5 volts. I can't get it to drop to where the LED seems like it might be completely off until around 3.3 volts, which is the lowest my power supply will go.Here is the datasheet for the mosfet:https://www.vishay.com/docs/91076/sihf9530.pdfWhat am I doing wrong?To clarify what I am attempting, I want the LED to be off until a high signal is applied to the gate. Ultimately I want to control the mosfet with a microcontroller at 5 volts.

author: IDEngineer
author_rank: Super Contributor
timestamp: September 11, 2020, 04:35:23 pm
content: You have two basic problems.First, if you "want the LED to be off until a high signal is applied to the gate", you need to use an NFET, not a PFET. Your PFET's turn on when the gate goes negative relative to the source. This is why the spec sheet's Product Summary gives a value for its on resistance (RDSon) when the gate-to-source voltage (Vgs) is at -10V (note the negative polarity, meaning the gate is at alowervoltage than the source).The traditional way to turn off a switching FET is to bring its gate to the same voltage as its source. In your case, with the PFET's source connected to +12V, that would mean the gate would be at +12 too. Then, when you want the PFET to start conducting, you bring its gate to a lower voltage. How much lower? The spec sheet uses -10V in their product summary, which is a pretty strong clue! That would mean the gate would be pulled down to at least +12 - 10 =) 2V above ground in your circuit. And since the spec sheet also says the gate is good for +/-20V, you'd be just fine pulling it all the way down to ground which the gate would perceive as -12V relative to the source.However, all of this means the LED would be off until a LOW signal is applied to the gate - the opposite of what you've stated as your goal. Helpfully, an NFET's gate polarity is just the opposite: It turns off when its gate ispositiverelative to its source. Hence why you really want an NFET to achieve the polarity you seek.Your second problem, however, is an issue regardless of which type of FET you use. You say you "want to control the mosfet with a microcontroller at 5 volts", but you're running the FET from a 12V rail. To turn the FET fully on, or fully off, you need to swing its gate as far as possible (to ground, or to its source voltage). This means you need 1) a FET that specifically has a logic-level gate threshold voltage, or 2) a gate driver transistor to isolate your MCU's pin from the +12V that the gate resistor will expose it to, or 3) to drive the LED from the 5V rail used by your MCU.

author: MarkF
author_rank: Super Contributor
timestamp: September 11, 2020, 05:22:35 pm
content: Your schematic is a mix of both N-Channel and P-Channel.For one, you want to use a P-Channel MOSFET but show a N-Channel.Here are both configurations:For the N-Channel case, you need a logic level MOSFET for the 'high' logic level to turn it 'on'.For the P-Channel case, you need the logic to switch between 'low' and 'high impedance' which depends on the pull-up resistor to turn 'off' the MOSFET. The input needs to go to 12V to turn 'off' the MOSFET. (i.e. Slow turn 'off')

author: PoDuck
author_rank: Regular Contributor
timestamp: September 11, 2020, 06:05:10 pm
content: It appears I posted the same picture twice. I attached a second picture here, where I am using an NPN to change the gate voltage.I am using a pfet because ultimately I want to control lights in a car, where the lights will be grounded to the chassis remotely from the circuit, which means I need a high side switch. I tried nmos transistors for this in a high side switch configuration, but the circuit could not be powered without sending power down the line while the capacitor charged up, which is a bad thing for my purposes.Anyway, it appears that what I am doing should still work, at least with the transistor. The problem is, it is not working. No matter if the gate is pulled to ground or to 12 volts, some voltage still gets through to turn on the LED. This happens even when I control that directly. Why would that happen?

author: PoDuck
author_rank: Regular Contributor
timestamp: September 11, 2020, 06:07:28 pm
content: MarkF, I didn't notice that. I guess I used the wrong symbol. I'll fix that in my schematic, but the problem still remains.Anyway, I'm going to fiddle with it after a bit and see what else I can learn about what is going on.Thanks.

author: MarkF
author_rank: Super Contributor
timestamp: September 11, 2020, 06:20:07 pm
content: From your schematic, it appears that your source and drain are reversed.The source needs to connect to 12V and the drain to the LED.

author: Gyro
author_rank: Super Contributor
timestamp: September 11, 2020, 06:21:37 pm
content: The circuit, as you show should work as shown (aside from the mosfet symbol being wrong as already mentioned - [EDIT: and that you haven't got the Source and Drain connections reversed as MarkF says]). I suspect finger trouble - most likely accidental connection of the 10k pullup resistor to the 5V rail rather than the 12V one.Just a note if you are planning to use this configuration in an automotive situation. The Absolute Maximum Vgs of the IRF9530 (and most other mosfets) is +/- 20V. This will be very easily exceeded by transients on the 12V supply. You will need to add a protective Zener between the +12V and mosfet gate and add a series current limiting resistor between the gate and the collector of the 2N3904.Edit: Noise.

author: MarkF
author_rank: Super Contributor
timestamp: September 11, 2020, 06:40:11 pm
content: Quote from: Gyro on September 11, 2020, 06:21:37 pmThe drain and source are definitely reversed for the P-Channel MOSFET.The IRF9530 is a P-Channel. Not the N-Channel symbol he shows.

author: Gyro
author_rank: Super Contributor
timestamp: September 11, 2020, 06:50:05 pm
content: Maybe, it depends whether he actually wired the package pins as shown. I'm just surprised that it would work at all that way - at best the LED state would be the opposite of what is expected for the logic output.Edit: Noise.

author: IDEngineer
author_rank: Super Contributor
timestamp: September 11, 2020, 06:50:58 pm
content: Quote from: Gyro on September 11, 2020, 06:21:37 pmThis is 100% true but I didn't mention it in my original response because I didn't want to add further complexity to his situation until he gets the basic circuit working.I've fried driver transistors due to the inrush current charging/discharging the gate capacitance of power MOSFET's. Even WITH a gate resistor. And depending upon how that transistor fails, it can take out the MOSFET if the latter is then held in its "linear" range. The value of the gate resistor on a power MOSFET is not just some rule-of-thumb value, it needs careful consideration including actual scope analysis of what the gate voltage and drain current are actually doing with the intended load. There are all sorts of tradeoffs to be made in terms of turnon/turnoff speed, heat dissipation, specs on the driver transistor(s), etc.

author: MarkF
author_rank: Super Contributor
timestamp: September 11, 2020, 07:10:32 pm
content: Quote from: Gyro on September 11, 2020, 06:50:05 pmHe says the LED stays 'on' all the time.(i.e. The body diode always conducts when the source and drain voltage is reversed.)

author: Mechatrommer
author_rank: Super Contributor
timestamp: September 11, 2020, 07:57:00 pm
content: basic 101get that one right first so my magic ball stop spinning eratically.

author: IDEngineer
author_rank: Super Contributor
timestamp: September 11, 2020, 08:04:26 pm
content: Quote from: MarkF on September 11, 2020, 07:10:32 pmBingo. He needs to insure his basic wiring is correct first. Nothing will work at all until he starts there. THEN we can start worrying about input polarity, high vs. low side, etc.

author: PoDuck
author_rank: Regular Contributor
timestamp: September 11, 2020, 08:48:56 pm
content: Okay everyone, for some reason I got the drain and source mixed up. That fixed the problem. Thanks.

author: IDEngineer
author_rank: Super Contributor
timestamp: September 11, 2020, 09:07:33 pm
content: Excellent.Now, go back and read everyone's comments. You've gotten some good advice in this thread. Just because it appears to work with an LED doesn't mean you're done. For example, the LED draws current in the milliamps but if you intend to drive headlights there will be a lot more current flowing. If you don't insure that you're turning that FET onhard, into its minimum RDSon area, you have a strong likelihood of burning up the FET. This is why at least two of us mentioned that you either need a logic-level gate FET or a gate driver FET, because your 5V MCU cannot itself drive 12V and if you use a pullup to 12V you'll likely kill the MCU itself.

author: Mechatrommer
author_rank: Super Contributor
timestamp: September 11, 2020, 09:23:38 pm
content: he already got it at a silver plate from MarkF..

author: PoDuck
author_rank: Regular Contributor
timestamp: September 11, 2020, 10:05:09 pm
content: Quote from: IDEngineer on September 11, 2020, 09:07:33 pmThat is correct. I will be driving as much as a 1 amp bulb with this. The FET should handle it, but I did intend on going through a driver transistor. The one I had easily at hand was a pn2222a, so I popped one in there, and something similar happens. The LED stays lit until I lower the voltage to around 8 volts. When that didn't work, I pulled out a KSC2073, and it seems to work fine. I always used the pn2222a with 5 volts, and it always worked. Never tried 12 volts with it. Apparently it doesn't like my application.Anyway, what should I be looking for on a spec sheet to know what transistor will work given a logic level gate voltage and a 12V collector voltage? I am pretty sure the KSC2073 is more transistor than I need, as I shouldn't be pulling much current keeping the FET driven.

author: MarkF
author_rank: Super Contributor
timestamp: September 11, 2020, 10:50:21 pm
content: The max emitter-base voltage for the pn2222a is 6V.If you drove the base voltage to 8V and higher, the pn2222a is probably dead.If you tie the base to GND, the LED should be 'off'.At 5V on the base, the LED should be 'on'. You may need to adjust the values of the two 10K resistors to get the correct voltage on the MOSFET gate.

author: Mechatrommer
author_rank: Super Contributor
timestamp: September 11, 2020, 11:23:25 pm
content: Quote from: MarkF on September 11, 2020, 10:50:21 pmi think that means reversed biased. minimum of Vbe is -6V.. imo its advisable to increase base resistance to like 1Kohm so even if driven from 12V, the 12mA Ib (0.3V Vbe drop in common emitter setup) will not exceed the maximum Ibe which is not shown in the maximum rating table...

author: IDEngineer
author_rank: Super Contributor
timestamp: September 12, 2020, 12:17:26 am
content: Quote from: MarkF on September 11, 2020, 10:50:21 pmI would put a resistor in series with the gate and remove the "lower" 10K resistor (e.g. make its value zero). That way the gate would swing the entire Gnd-Vdd voltage range, insuring the FET is either fully off or fully on. Then tune those resistor values for desired turnon/turnoff behavior. The series gate resistor will protect the driver transistor from outrush current as the gate capacitance is discharged.

author: Mechatrommer
author_rank: Super Contributor
timestamp: September 12, 2020, 03:45:40 am
content: Quote from: IDEngineer on September 12, 2020, 12:17:26 amno need tuning, just look at the mosfet datasheet at what Vgs it will maxed out and use voltage divider formula to figure out reistance value. if you put 0 ohm, be aware some mosfet Vgs cant swing as large as its Vds, some of them maxed to half Vds, you miss that, you burn a mosfet.

author: MarkF
author_rank: Super Contributor
timestamp: September 12, 2020, 08:11:08 am
content: Quote from: IDEngineer on September 12, 2020, 12:17:26 amEdit: Schematic updated

author: IDEngineer
author_rank: Super Contributor
timestamp: September 12, 2020, 01:09:00 pm
content: R2 does not have to be as high as 10K. For small FET's with low gate capacitance 10R can work fine. But having that "lower" resistor creates a voltage divider that prevents the gate voltage from ever reaching zero (and in this circuit you'll already suffer the drop across the NPN). If turnon vs. turnoff speeds are an issue you can always use one, or two, cheap small signal diodes to control each individually.

author: MarkF
author_rank: Super Contributor
timestamp: September 12, 2020, 02:03:44 pm
content: Quote from: IDEngineer on September 12, 2020, 01:09:00 pmFor a P-Channel MOSFET, it does NOT matter if the gate voltage reaches zero.But the difference between 12V and the gate voltage.The MOSFET will be fully 'on' long before the gate voltage reaches zero.

author: IDEngineer
author_rank: Super Contributor
timestamp: September 12, 2020, 02:22:35 pm
content: Within gate voltage specs, the more negative you can pull the gate the lower the RDSon. There is no reason not to pull the gate as far negative as possible. YMMV.

author: Gyro
author_rank: Super Contributor
timestamp: September 12, 2020, 04:13:20 pm
content: As I mentioned previously, in the OP's intended application, he can't afford the gate voltage to go to zero. There needs to be a protective resistor in series with the collector of Q1/Q2 to limit the spike currents from the 12V supply, through the gate protection Zener (to be added), and gate capacitance.This means that the mosfet gate is always going to have to be driven by a resistive divider - the only remaining argument is the resistor values.

author: IDEngineer
author_rank: Super Contributor
timestamp: September 12, 2020, 06:25:06 pm
content: I got the impression the OP was a bit flexible as to component selection, at least with respect to the gate transistor. That would permit more optimized gate voltage range and thus minimized dissipation in the PFET. His choice.

author: Gyro
author_rank: Super Contributor
timestamp: September 12, 2020, 07:24:29 pm
content: Regardless, he's not going to find a mosfet with greater than +/-20V Gate-Source breakdown. For his automotive application, he's going to need that Gate-Source protection Zener, so you can't just connect the gate directly to the driver transistor collector - you must limit the otherwise high energy current spikes with a resistor in between, otherwise the Zener will just shunt all of the spikes straight into the driver transistor. With the needed Gate-Source resistor too, you inevitably end up with a voltage divider driving the Gate.

author: IDEngineer
author_rank: Super Contributor
timestamp: September 12, 2020, 07:41:00 pm
content: Almost everything I do at the moment is for some automotive application. Our solution is to protect the +12V rail itself. Then you don't have to duplicate individual protection components everywhere such as the gate in question. I guess if you're willing to expose everything else to raw automotive power then what you're describing for the gate circuit is fine. Personally, I seek to swing the gate to the rails for the reasons I stated earlier, and in a properly conditioned 12V system a gate with +/-20V rating works well and reliably.

author: Mechatrommer
author_rank: Super Contributor
timestamp: September 12, 2020, 08:01:24 pm
content: Quote from: MarkF on September 12, 2020, 08:11:08 amrechecking again... both badas both p-fet in reversed polarity, i'm not expert as to what will happen this way but i'm certain body diode will either burn or in always forward conduction (turned on) the other point is valid...

author: MarkF
author_rank: Super Contributor
timestamp: September 12, 2020, 09:19:34 pm
content: Quote from: Mechatrommer on September 12, 2020, 08:01:24 pmGood catch.I had to redraw the schematics and forgot to flip the MOSFETs.(Post corrected)