Hello
I tried using the IRF520 Mosfet as a switch. But when I connected my circuit as in the diagram above, the Arduino started working even though I didn't press the button. So my IRF520 Mosfet switches through without activation. Can someone please help me?
Sincerely, Huwi6
If you are trying to control the Arduino power, that circuit is incorrect in several different ways.
Use a "high side switch" with a P-channel MOSFET. This forum post might be helpful.
Why is this circuit wrong?
There are so many things wrong that it isn't actually clear what you are trying to do. However, for that particular MOSFET, the power supply is backwards, source is connected to Arduino GND, etc.
The reason your circuit is always on is that current is flowing out of the Arduino GND, and through the MOSFET body diode to battery negative, regardless of the switch setting.
Here is a typical low side switch, suitable for motor control. However, you must use a logic level MOSFET with an Arduino output, and the IRF520 is not a logic level MOSFET.
To switch Arduino circuit power, I recommend the Pololu Power Switch.
This is a common circuit used for reverse polarity protection. For others, an N Fet is used due to being more rugged and lower cost.
I believe your issue is the 47K is much to high.
And for those of us old folks you should draw the IRF520 in the ground path of the battery. By that I mean the drawing should have the Fet below the battery (with the exact connections.
Okay thank you for your answers. I will inform myself in more detail about mosfets, because I'm still quite a beginner in the topic of mosfet. For now I'll replace the mosfet in my circuit with a relay.
It is not a good idea to switch Arduino power in the ground lead.
I won't do that either. I only made the circuit like this because I only have IRF520 N-channel mosfets at home so far.
In general I agree, however if the inputs are "protected" then there is no issue.
Sorry, I have no idea what you mean by "inputs are protected". In any case, inputs are not the only possible problem.
It is an extremely bad idea for a beginner to put a switch in the ground lead of an Arduino, especially for one powered by 12V through Vin.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.