Help, P-Channel Mosfet Always On

Hi folks I have a basic simple circuit using a p-channel mosfet. The mosfet gate is pulled up with a 2k2 resistor to the 8.4V +ve rail and a 2N2222 transistor is pulling the gate low when a signal from a microcontroller is applied to its base. The drain of the mosfet is directly on the +ve rail and the source runs to the device being powered and then to ground.

It works fine in the simulator, but the problem is in reality, when I apply the power to the circuit, the device is always on regardless of the state of the signal from the microcontroller. When I test the voltage at the gate of the mosfet when the microcontroller signal is low, it is 4V ?? Surely that isn't right, it should be 8.4V shouldn't it? No wonder the mosfet is on all the time when the gate is less than half the voltage it should be. Can anyone explain what's going on?

https://www.circuitlab.com/circuit/5knavg/helpme/

Many thanks,

by MD68
November 25, 2013

The sim shows what should be happening right enough.

3 possibilites come to mind:

1) Blown 2N2222.

What is does the collector of the 2N2222 go to when the uC output goes high?

If it does go lower than about 0.25V then either your 2N2222 is dud or your uC output high is not getting much above the 0.7V to 1V range.

2) What is the uC output low voltage?

If it is above about 0.3V to 0.4V then you may be turning the 2N2222 on enough that it is pulling the collector voltage down even with the uC output a logic low.

3) Your code is unintentionally toggling the uC output on and off.

If it's doing that fast enough then that if you're using a meter, you'll most likely see the mean DC level rather than individual high or low levels.

Can you look with an oscilloscope or maybe a logic analyser?

by signality
November 25, 2013

signality you are a hero. The actual problem was my blithering stupidity that I only realized while testing for a blown 2N2222 as you suggested, the readings I got didn't make sense. I'm not actually using a 2N2222 it's an equivalent I got from e-bay, but the damn legs are arranged differently, so I was wiring it up C B E when the legs on my "equivalent" are E C B. Sorry to waste your time there dude, but I probably wouldn't have noticed the mistake for a while without following what you suggested.

Many thanks, Marc.

by MD68
November 25, 2013

Sorry to double post. Following on from this, a local guy recommended I ammend my circuit to this https://www.circuitlab.com/circuit/98m686/unknown/

I just don't understand what the extra bits are for. Namely R8, R9 and D2. Sorry to spam with so many question, I'm pretty new at this and struggling to understand a lot of stuff. I can only make a guess at what they do, R9 is maybe to keep the transistor's base low if the microcontroller is removed somehow? R8 is baffling, the only thing I could imagine is if it's not a good idea to run a mosfet with infinite load, and that just protects it in case the device is removed? D2, god knows, perhaps some kind of reverse polarity thing?

by MD68
November 25, 2013

R6 and R9 attenuate the input votage from the uC in case the logic low level is not very close to 0V (my point (2) above).

D2 would protect the MOSFET against the back emf of an inductive load such as a motor or a relay coil but if you are driving say a LED and series resistor or an incandescent lamp load then the diode serves no purpose and is not required.

Try replacing the 3.7R resistor with an inductor and run a Time Domain simulation to see the effect of the diode. For simplicity, remove R9.

It is not clear what R8 is for. It serves no purpose other than to drain about 840uA when the MOSFET is on.

If you were driving a capacitive load then R9 might serve the purpose of belleding the capacitor current to ground when the MOSFET is turned off but the value of R( would be highly dependent on the sixe of the capacitance and the time you require it to be discharged below a given voltage.

Try replacing the 3.7R resistor with a cap and run a Time Domain simulation to see theof R9. The diode will have no effect.

You may have to rename the voltage source and the battery to something like V1 and V2 and the 3.7R resistor to something like Rload (circuit elements must have a suitable prefix in CL).

You will also have to set up the input voltage source as a squarewave or pulse source.

by signality
November 26, 2013

The 3.7 Ohm resistor is actually a heating coil (seven or so linear turns of 32AWG Kanthal A1 wire 2mm in diameter around a non conductor). I can't see that having much inductance but probably best to have the diode in just in case.

Thanks for the lucid explanations and for taking the time to help me out. I'm slowly beginning to grasp it.

by MD68
November 26, 2013

Post a Reply

Please sign in or create an account to comment.