Arduino with N channel mosfet and PNP transistor

Greetings,
i have a question...Is there a way, to control an IRF540N n channel mosfet with pa PNP transistor or something? So that when it would swith on, the IRF could get switched on with a 12 V power supply so that it properly opens the gate?

Thank you

E1 (N Channel) or F1 (P Channel) NPN transistor used.

You'd need an NPN transistor to level shift to 12V, then you could drive the IRF540N from that.

(E1 in the diagram. F1 is for a p-channel MOSFET, not applicable).

Or you could use a gate driver chip to drive it. Gate driver chips are intended for the purpose, powered
from 12V they take standard 5V or 3V logic inputs and drive a MOSFET gate strongly for rapid switching
There are many many versions, for instance the MIC4422.

In general in professional electronics the gate driver is used, its the right tool for the job.

So would a BC547 work for E1?

Should be okay.

This is wonderful thank you very much

But if you used a logic level mosfet, you could perhaps drive it directly with 5V at the gate. You would have a pulldown resistor on the gate, but wouldn't need the NPN.

I already have some BC547 transistors and IRF 540N mosfets so i was thinking of using the stuff at hand.

I understand, but I just have a problem with the E1 circuit having the gate pulled up to 12V. It seems if the 5V power isn't present, or the processor needs to be powered down, the mosfet is going to be on. Ideally, I think you would want the processor to be up and running before the mosfet could be turned on. With a logic level mosfet, you could have a gate pulldown resistor, and drive the gate directly from a high output of the processor. i just don't see a way to make E1 foolproof.

Edit: If you also have a little PNP transistor, I think the circuit below would work. The gate is pulled down, and the mosfet is off, unless the PNP is on, and the PNP can't be on unless the NPN is on, which can't happen unless D10 is high, which can only happen if the 5V rail is up and the processor is running. It seems pretty complicated, but I don't see a simpler way. Maybe somebody else will.

Edit2: I think it would also work if you eliminate the NPN's collector and base resistors in my alternate circuit, and insert an emitter resistor instead. You might try 47K for that resistor, and the same for the gate pulldown resistor. So then it would be the PNP, the NPN, the mosfet and two resistors. Not too bad.

This is probably overkill but the TC4427 would work. It takes whatever voltage you need for the mosfet and
uses a 5V logic control signal so you if you power it with 12V and drive it with an arduino digital output pin the driver output to the mosfet is 12V.

Just to clarify, I think this circuit would work ok. The resistors could be high value, depending on how noisy the neighborhood is. I would try 100K, but lower might be needed. And when the processor boots up, D10 will be a floating input for a time. If the mosfet flickers on at that point, you might also need a pulldown resistor on D10.

The NPN may also need a pull-down on the gate, to ensure it's held firmly off (just a little leakage is enough to switch on the PNP enough to switch on the MOSFET).

Alternative, with just the NPN, pull the base up to 5V to ensure the MOSFET remains off (or even to 12V with a larger value resistor if the 12V may be applied when the 5V is not present).

wow thank you all very much for the ideas and help..If i take closer look at the last sketch that ShermanP has given...If i were to use 75k resistors on the sketch, add a 10k resistor between D10 and NPN base to ground that should do the trick?

I think 75K on the D10 pulldown would be enough.

So 75k for all resistors should work without any problem?

In the circuit of #10: The NPN and its resistor should be swapped around, and there should be a resistor (10k should be fine) on the base of the NPN.

In that circuit you rely on the pull-down on the gate not only to keep the MOSFET off initially (in which case 75k or 100k is fine, even 1M does the job well), you also use it to switch off the MOSFET. For that reason I'd want a smaller value, not more than 10k. 4k7 would be fine, too. The smaller this value, the faster the off switching, but if too small the on switching becomes harder.

Then the resistor on the base of the PNP (leading towards the NPN), 2k2-10k sound good. 75k doesn't switch on the PNP as well, making the on switching slower.

Fast and slow in this context is in the tune of microseconds, depending on the gate charge of your specific MOSFET. Fast switching is important to limit the time the MOSFET is in partial-on state, which especially with heavy loads or PWM drive means excessive heat.

I understood what you meant except, could you make a quick sketch on how you mean the NPN to be swapped around..didn't fully understand that part.
Thank you

xcg584:
So 75k for all resistors should work without any problem?

I think so, but you'll have to test it to make sure it works.

xcg584:
I understood what you meant except, could you make a quick sketch on how you mean the NPN to be swapped around..didn't fully understand that part.
Thank you

It's in LarryD's post - E1 refers to the grid matrix location in the drawing.

Resistor goes between the base of the PNP and the collector of the NPN. Emitter of the NPN goes to GND.