Me vs. P-Channel MOSFET & LED | Led never turns off completely

Hi!
I'm struggeling with a simple p-Channel Mosfet - controlling an LED.
It's basically this circuit:
http://ruggedcircuits.com/html/circuit__28.html
The MOSFET im using is this:
http://www.fairchildsemi.com/ds/FQ/FQP27P06.pdf

!!!The MOSFET in the given circuit is N-Channel - i changed mine accordingly (put the LED on the source-side of the MOSFET).

The Arduino is powered by USB - but has a common ground with the circuit.
The circuits V+ is 3.3V.

The code to drive the MOSFET is the Blink-Demo from the Arduino examples.

And here is the Problem:
When the Arduino triggers the MOSFET the Led changes their intensity (alternating to the debug Led on the Arduino -> p-channel has switched logic) correctly, but it never turns off completely!
As i can see the circuit does the job - but the Led still lights a tiny bit when in should be turned off. If i change the voltage, the brightness in the Led-off-State changes, too.
I found this problem in one other related Post - but no solution was given...can you help me to turn off my evil Led?

Thanks!!!
OptimusPrime

You need one more n-channel mosfet or BJT transistor to drive p-channel mosfet:
http://ruggedcircuits.com/html/circuit__11.html
How much current your led's consume? Probably it would be easier to use just BJT or ULN2003 driver.

Magician:
You need one more n-channel mosfet or BJT transistor to drive p-channel mosfet:
http://ruggedcircuits.com/html/circuit__11.html
How much current your led's consume? Probably it would be easier to use just BJT or ULN2003 driver.

Additional N-channel mosfet is not needed! Just pulling the P-chan mosfets gate to the ground (ie the avr can send a digital low) should be sufficint to switch it on.
http://ruggedcircuits.com/html/circuit__16.html

You are right, it's sufficient to turn it on. But the problem is to turn it off...
When arduino send "high" - 5V, there would be still voltage between source-gate equal :
Vsg = Vleds - Vhigh
Circuit #16 is o'k till Vpower = 5V. If it goes up (12V or higher for a few leds) the would be an issue

Magician:
You are right, it's sufficient to turn it on. But the problem is to turn it off...
When arduino send "high" - 5V, there would be still voltage between source-gate equal :
Vsg = Vleds - Vhigh
Circuit #16 is o'k till Vpower = 5V. If it goes up (12V or higher for a few leds) the would be an issue

How about connecting the r3 resistor from the gate to the ground, instead of the current configuration in which it is connected to the positive. That way the p-chan is always on, but when the arduino send a digital high, it wil the gate will be pulled high and it will be switched off.

Source of the p-mosfet connected to +Vleds, and what making mosfet to conduct is difference between Vgate and Vsource.

Vsg = Vleds - Vhigh

Vhigh (max 5V, real 4.4V) , mosfet will be conductive if Vgs > 2 - 3 V(depends on type of mosfet), or if we turn it around when Vleds > 4.4 + 2 ... 3 V ~= 6.4 ... 7.4V

Hi again!
Thanks for your ideas!
I tried Circuit16 (the first one) but the result is the same - in fact it doesn't matter weather i pull the gate low or high :~

...and what making mosfet to conduct is difference between Vgate and Vsource.

Is it possible that my Led power consumption is to low to get the MOSFET triggering off again? Could you explain this difference-thing again? I read Wikipedia twice and watched some nice Video-Tuts - but i didn't get the point yet, i guess.

How much current your led's consume?

The Led needs about 3.3V and 20mA. The further plan is to set up an Led matrix, controlled by MOSFETS on each row and column to get each Led adressable.

Basically you are not using the correct circuit for a p-channel FET

I tried Circuit16 (the first one) but the result is the same

That will only work with a logic level FET, which you haven't got, and a 5V supply, which you haven't got.

You need this:-
http://ruggedcircuits.com/html/circuit__11.html
If you haven't got a FET for Q2 you can replace this with a normal transistor and remove R2.

Note the source is connected to the 12V supply and the drain to your load. The gate is connected to the +12V supply so normally it is off. When the gate is connected to ground the FET turns on. That is the job of the transistor. You can't connect the gate directly to the arduino pin because it will only supply 5V which is not enough to turn the FET off.

Is it possible that my Led power consumption is to low to get the MOSFET triggering off again

No that will make no difference.

I build it (with a transistor - as you described) as given in Circuit11 but it's still the same - the led just dims a little bit when it should be turned off. Im quite new to all this as you probably see :wink: - perhaps i'm just doing the same mistake over and over... =(
The alternating connection between GND/V++ and the Gate can be measured by a circuitanalyser - but the MOSFET does "anything??"...
I also understand why there is an transistor for triggering the MOSFET but i don't get it why the Led isn't turned off completely...

Thank you all for helping me!

OK forget the arduino and the transistor, just have the resistor between gate and 12V, with the source to 12V and led & resistor between drain and ground.
If the LED is still not off then you have blown up the FET and need to get another one.
Then dab a wire from the gate to ground. The LED should light up fully. If not again you have blown up the FET.

Alternatives to having blown up the FET are that you have miss identified the FET connectors or wired it up wrong.

...and to think... some folks insist FET's are simpler than BJT's.

I guess not based on the questions asked in this forum...

It's almost the point where every FET question needs to wait for GrumpMike's obligatory "that's not a logic level FET" comment.

Ok - i feel cheated by a little piece of silicon :astonished:
I tried grumpy_mikes "direct way" and NOTHING HAPPENS?! I tried it with 5 different MOSFETs of the same type....so blown up is nearly impossible. I checked the datasheet twice - it's quite hard to misunderstand the Gate-Drain-Source diagram...
Intelligent Power and Sensing Technologies | onsemi - perhaps sby can lift the secret of my weird MOSFET.

And the strangest thing at last - it DID some kind of triggering with the arduino! But none when it's connected directly?! I'm so confused...gnah - why it's always depressing when it starts to be interesting....

thanks for your effort!!!

"direct way" and NOTHING HAPPENS?

What sort of nothing?
No LED lit connected up? - that is right.
No LED lit when you dab the gate to ground? - not right.

However, often the problem is not actually where you are looking.
So sorry if you have already checked these but go over them again.

Data sheet and FET are the same thing?
Try measuring some voltages with your meter across the load.
LED the right way round?
Grounds connected?

why it's always depressing when it starts to be interesting

You have to show those little pieces of silicon who is the boss. :slight_smile:

Sry grumpy_mike for my highly unprecise answer!
I took 2 pictures of my circuit to make things easier! - Take a look at the attachment...
These show the wireing of the FET and the Led. The pictures were taken at 12V.

Interesting about this: It doesn't matter if the Gate (leftmost pin i suppose -> datasheet) is positive or gnd!

Datasheet and FET are the same! I checked this again...

I hope the pictures will help! I suppose it's exactly as you say...

often the problem is not actually where you are looking

The drain is the one that should be connected to the LED and the source connected to +12V, these seem to be swapped over in the photograph.

TO220 MOSFETs are G-D-S from left to right. The one in the picture is wired with drain and source swapped so that the integral diode is forward biased and taking the current. The gate cannot do anything about that!

Hey you all!
This was the solution!!! :blush: - and a fairly embarassing mistake of me :wink:
I also figured out that my MOSFET ist not working on logic level - so i will have to put a transistor before...

Thanks a lot to all the people giving a helping hand!