# Mosfet gate driving circuit by microcontroller [closed]

IRF540 will suitable for switching positive supply..?

"will It work under 5voltage to gate"?*

This question have been asked too many times , i will try to guide you to on what to search for :

1. first point is logic level (aka drive by micro-controller 5v) this is a special type of mosfet that have a reasonable RDSon at 5v Vgs. you should look at this curve in the datasheet.

1. Second point is switching posistive supply , this is another issue with N channel mosfet whether they are driven by 5v or 12v . this circuit is called HIGH side drive .

It poses a challenge since you need to create 5v or 12v on Vgs not with respect to ground which can means the gate to ground voltagge is higher than supply voltage .

Solutions for this problem

a-you either use a P-channel mosfet

b-use some kind of high side driver ( isolated /floating supply , transformer coupled drive, bootstrap , charge pump ) , there is literally thousands of articles on the internet regarding this subject and too many ICs and solutions.

IRF540 will suitable for switching positive supply

Not effectively unless you use a much larger gate voltage or a P channel device such as the IRF9540. If you can switch the negative end of the load then it's much easier. Read on. If you look in the IRF540 data sheet you will find this graph: -

I've highlighted in red the characteristic of drain current versus DS voltage when the gate voltage is 5 volts. In blue I've chosen a drain current of 10 amps (approximately) and, as you can see, the resulting DS volt drop could be around 1 volt. This will dissipate 10 watts.

We don't know, from your question, what load you are considering but, when you do decide, the graph above will tell you how much wasted power you will get.

Make sure you don't exceed the voltage ratings for the device too and if you are switching an inductive load, you will likely need a flyback diode.

Here's the general idea when using a P channel MOSFET but be aware you can ONLY use this when the supply voltage (12 volt in the below example) does not get above 19 volts because the gate voltage specification could be exceeded: -

• the load will be 1A filament type bulb – steve Dec 9 '16 at 10:39
• ...and beware of typical data. Bad luck is always next corner. – carloc Dec 9 '16 at 10:42
• @steve so, what volt drop could you expect do you think? The graph will tell you if you can imagine the red line being extended off the graph - do you see what I'm trying to say? Let's here your answer to see if you "get it". Yes, and what Carloc says is true - the graph above is "typical". – Andy aka Dec 9 '16 at 10:42
• @Andyaka , wow you were faster than me in the answer :) , but did you notice what he said about switching positive supply , i think he wants to say high side switching like automotive lamp drivers .. they language is very vague :( – ElectronS Dec 9 '16 at 10:44
• @ElectronS yes I have just noticed - originally the question didn't state this do'h! – Andy aka Dec 9 '16 at 10:45