This is a tutorial about using a P-Channel Enchantment Type MOSFET as a switch to turn ON and OFF a 12V Motor.
UPDATE:
You should also add a 100-ohm resistor between the Arduino pin and the Gate terminal of the MOSFET. The MOSFET has a small capacitance that starts to charge/discharge when you switch the Arduino pin. This creates a short current spike that can be bad for the Arduino pin. Especially if you plan to do high-frequency switching.
Diagrams and code:
circuitjournal...
I am using an IRF9540N, but you can use some other logic level P-Channel Enchantment Type MOSFET.
Buy from AliExpress.com:
IRF9540N: s.click.aliexp...
Disclosure: Bear in mind that some of the links in this post are affiliate links and if you go through them to make a purchase I will earn a commission. Keep in mind that I link these companies and their products because of their quality and not because of the commission I receive from your purchases. The decision is yours, and whether or not you decide to buy something is completely up to you.
Music from RU-vid library.
30 сен 2024