P-channel mosfet

Hey i have this P channel mosfet http://www.zeus-electronics.com/datasheet/IRF9540N.PDF but for some reason I cannot get it to turn off. I have tried to make a simple setup like this:

The drain is connected to 9 V. the source is connected to an LED that goes to ground. The gate is connected to 9V. but the mosfet is on no matter what the gate is connected to.

so if anybody know what the problem is please right. I have trite it with more than one mosfet but they all give the same result.

You've got Source and Drain reversed. On a P Channel MOSFET, the Source connects to the positive, Drain to negative/ground side.

With it connected backwards, the internal body diode is forward biased.

I notice you did not mention a resistor in that circuit. The picture is too small for me to make out if you have one or not. There should be a current limiting resistor. Without it, you are just loading the 9V battery down, drawing the max current it can put out. So if you ever put, say, a 9V 1A power supply in there, bam! No more LED.

A 470 Ohm resistor will limit current to just under 20mA.

polymorph: You've got Source and Drain reversed. On a P Channel MOSFET, the Source connects to the positive, Drain to negative/ground side.

With it connected backwards, the internal body diode is forward biased.

I notice you did not mention a resistor in that circuit. The picture is too small for me to make out if you have one or not. There should be a current limiting resistor. Without it, you are just loading the 9V battery down, drawing the max current it can put out. So if you ever put, say, a 9V 1A power supply in there, bam! No more LED.

A 470 Ohm resistor will limit current to just under 20mA.

That looks very much like a resistor between tracks 13 and 16 to me... Can't make out the value, but it's there alright...

An N channel requires a pull down resistor....

So i presume this P channel could do with a pull up 10k ? To your positive rail via the gate (that should make it turn off)

Strange, when I viewed this thread before, it only showed me a tiny thumbnail. Yes, I can see the resistor. There is still the problem of source and drain being reversed. Change that, and it will work.

Connect a pull-up resistor from the gate to the +9V rail, and it should turn off as soon as you disconnect the gate from ground/common.

You've got Source and Drain reversed. On a P Channel MOSFET, the Source connects to the positive, Drain to negative/ground side.

Oh thanks alot that work. don't know why i didn't think of that.