Це відео не доступне.
Перепрошуємо.
N-Channel MOSFET as a Switch. Turn ON a 12V Motor with Arduino. (Step-By-Step Guide)
Вставка
- Опубліковано 16 сер 2024
- This is a tutorial about using an N-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.
Full connection diagram: circuitjournal...
I am using a 30N06L, but you can use some other logic level N-Channel Enchantment Type MOSFET.
Buy from AliExpress.com:
30N06L: s.click.aliexpr...
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 UA-cam library.
3yrs later...Just wanted to say thanks for this. Very concise and to the point. I used a IRL Z44N mosfet and it worked just as you instructed. Using it to control a 12v relay. Thanks!
ive been googling videos that will give me a simple ang clear explination about this.. until i found your video. im subbing. thanks man
I just saw you're video of the 3D Printed car and then I looked to you're other video's and you're channel is awesome!!! I like it really much!
Thanks a lot for the feedback!
Thank you sooo much for this huge help
You don't know how much you helped me , it saved my project from ruining
Thanks a lot 👍
You are most welcome
You should have 1 million subscribers
Very , very clear and to-the-point explanation and demonstration of the issue. Chapeau, my friend! It's just what I needed, in my preffered style!
You are welcome!
i really like how you explain things! good videos and really informative! more success to you sir!
One of the best ones I've seen, thank you for your hard work, loved the graphics too
It's a really good explaining!! :)
Hey creatice electronics, please watch this video call...
ua-cam.com/video/Y9sNFx7enFQ/v-deo.html
I explained how mosfet work as switch
Thank you very much, for explaining things effectively but briefly.
You are a excellent teacher! Thank you for the explanation.
thank you so much you deserve million subscribers!!!!!!!
best video explaining mosfets! thanks!
Thank you to help me with my problem. After hours of troubleshoting it finaly works
Crisp and clear explanation
Thanks!
best explanation on youtube
10k label. that is the coolest thing I've seen :) I will use it...
The best possible way to explain
Thanks!
Thank you for this great video! Do we need to use a series current-limiting resistor between the gate and the Arduino pin?
So why don't we connect a 10k pull down resistor between gate and the arduino instead of two different resitors in two different spots?
Yeah I wish they would have started with this application when I first learned about MOSFETs in circuits class.
I would use a 470R gate resistor to reduce the inrush current as the MOSFET gate capacitance is charge up.
thanks, needed this, works like magic.
12V won't fry my ESP32 controller if I connect it to the same ground?
Legend! Thank you! Can you do multiple motors simultaneously like this?
Yes, since Arduino only turns the motor on and off. The power for the motor comes directly from the power source and as long the power supply is strong enough you can run both.
How to use MOSFET as a normaly close Switch?
Very easy explained. Thanks.
I am glad it was helpful. Thank you for the feedback!
I cannot get my motor to work at all. I have a fairly strong, slow geared motor which I connect power to the direct, it spins. I have tried 2 different H bridge motor shields and now a IRL540N MOSFET and at most, I hear a PWM whining sound inside the motor, but the motor refuses to work. I am at the end of my tether. It's only a 3.7v 1.2amp motor which ran off A tiny board the size of a postage stamp when I bought it. No caps, no nothing. I'm seriously perturbed by the mystery of it not wanting to work no matter what voltage I through through the Fet.
Hello! Thanks for your video. I am using a 3-6V water pump and a MOSFET IRFZ44E. Everything works as you said, until I connect the Gate to the D5 pin of my ESP32 dev Kit. I put the VDD source on 5V. Nothing happens. Any idea?
I'm not clear which pins the flyback diode is connected to. It's not possible to tell from the video. Please explain.
The diode is connected across the motor. The cathode end of the diode(the one with the white band) is connected to +12 V. Look at schematic around 2:15. Hope that helps.
great tutorial, many thanks for this
Hi, Can i use this circuit to power on one arduino through the vin pin from another arduino gpio ?
thanks got what i needed you er better than most
i owe you my life
why must we add 10k resistances there?
If we use the aurdino then what is use 12v battery
Hey, great explanation and very clear instructions! If I wanted to burn a nichrome wire as the ignition of a model rocket instead of the motor, would this work??
Loved it. You got urself a subscriber.
Thanks!
Huge help, thank you so much!!
Any help appreciated please. Brain absolute in bits. mosfets, like reading alien. Total noob. just using a 9v battery. Switches on a solenoid (12v) that many mosfets out there. just needing to know what be suffice. using with arduino. Thanks#
Thank you very much for this informative tutorial....appreciated.
Hey! Thank you for the feedback!
perfect explanation thank you
Thanks I want ask you can I use it as in bike to turn on and off bike
Hello, this is the best MOSFET video I have seen so far. Could you help me a bit with its expansion?
I am using this MOSFET: N-Channel 33A - IRF540N to control lights, but it gets way too hot, even with a heatsink and a fan. What is the proper way to connect multiple MOSFETs to reduce the load at each one, using the same port from Arduino?
The guys selling them told me to use a 1k resistor from the digital pin of arduino to the Gate. Is this right?
Should I use every time 1k resistor from Arduino to Gate and the 10k resistor G to S on each MOSFET?
So this can replace a relay if you a big enough heat sink for your project?
Anyone knows the diode size?
Hi Inderek, Thanks for the very clear explanation on how mosfets work. I'm trying to use a Raspberry Pi Pico instead of Arduino, which has I/O pins at 3.3v. Would the 30N06L turn on with "only" 3.3v at the gate? (is this true for all logic level n channel mosfet?) Or is there a special case of 3.3v logic level mosfet that I need to look for?
I'm a bit late, but here's the answer: It will turn on, but not fully. Check the datasheet, specifically the Gate-Source Voltage vs Drain Current graph. Looking at it, 3.3V will allow to push around 5A through, where 5V would allow around 50A. I'd recommend the very common IRL540N if you want to drive it with Raspberry.
thanks for this tutorial , i need to use this mosfet for switching load 12 V 1 A @ 5 MHZ is that possible
Hi Indrek, thank you for the amazing explanation. You are a great teacher. I have been looking for a way to control a 12V EL panel with an arduino, including dimming/intensity but I can’t find any tutorials. Do you know if it can be done? Thank you!
Yes you can easily control a 12v EL panel and in order to control the light intensity you need to provide PWM signal to the gate.
Is there a way to switch the positive side with a mosfet or similar? I need to PWM a 12vdc signal, but I can't switch the GND
Do you mean like this with a P-Channel mosfet:
ua-cam.com/video/ek8HBjonXdA/v-deo.html
Nice description and video. Now, I want to control the speed of the motor using the MOSFET - can I do it ?
Hey! Yes, you can use the PWM output.
Thank you for the video. Just wondering why you use conventional current in your explanation instead of electric current.
Do you mean that why I didn't do the illustration with the negative electron flow?
The symbol for the diode is an arrow that points to the direction of positive current flow. If I had used electron flow then the schematic would have been confusing. Electrons will flow in the opposite direction of the diode arrow.
Excellent. Thank you.
I notice other people put a resistor at gate of MOSFET (in addition to the pull down resistor between there are ground). You don't. If I understand right, MOSFETs are purely voltage controlled - so are people doing this purely to produce a certain voltage at the gate or something?
I just wish I could see more clearly.
how can i thank you ? i have no word to thank you,you helped me a lot......
May Allah guide you to the right path
Glad I could help!
End Time Revealed- There is no need to invoke supernatural nonsense, magic and/or bronze age deities into this video. Indrek is doing just fine on his own using his thinking brain. Keep banging your head against the ground.
@@MJ-em2ixI'm an atheist myself but being an arrogant insulting dorkhead may not be the best strategy to make people embrace your opinion.
good video
Hello, can I use IRF1404 40V 202A for Motor 24V 10A?
Thanks, good video. Is Flyback diode necesserally for heater?
Nah. A heater is a resistive load. You only need the flyback diode for inductive loads. The heater doesn't hold any magnetic energy so there's nothing to dissipate.
Would this still work with a 220-ohm resistor between the Arduino pin and the Gate terminal of the MOSFET, instead of a 100-ohm resistor?
Yes
Can I use bt136 instaed of 30N0CL
It would be easier to observe the rotational speed of the motor if a cello tape is stuck onto the its shaft.
Hey! Good idea! I will try to keep it in mind in the future.
1:51 sudden jump with extra wires in the breadboard which aren't explained.... what does the diode attach to exactly? This is not clear at all
Cathode end (stripe) towards the positive voltage source, anode towards the drain (the wire he's adding) it's literally in the diagram next to it.
@@etherealrose2139 Yeah I figured it out, thanks.
0:16 enchantment type mosfet lol..im dead
Hello, Congratulations of the Project. What is the Power of the motor? Why did you choose this MOSFET?
Hey! If I remember correctly the 12V motor consumed about 1Amp.
It is a logic level MOSFET - the Gate-Source voltage is below 5V to fully turn it on/off.
It is rated for 32A, 60V, which is enough for me since I only required 12V and 1A
@@IndrekL Ok, Thank you very much for the answer. :)
hello ! really useful video . I have a question. My motor operates just like yours(12vdc with 0.5A) but i have a IRF830 mosfet and a IRF510 . Which one should i choose? and should i use the same ammount of resistor (10kΩ) or another?
Hey! Both of those should work. Both of them seem to have the threshold voltage of 4V. It means that the 5V signal from Arduino will turn it fully on. Yes, you can use a 10k pull-down resistor.
You may have figured it out already but both MOSFETs you mentioned are not "logic level"-MOSFETs, i.e. 5V is presumably NOT enough to drive the transistors into saturation. They will conduct, but produce a significant amount of heat.
Ma olen Eestlane Australiaa's. Kui ma kuulsin sinu hääl ma teanud et sa oled estlane ka. Suur aitäh video eest
Tere! Jah, Eesti aktsent on üsna ära tuntuav. Mulle on varem ka maintud, et on aru saada, et olen Eestlane. Tänud tagasiside eest!
Can we use IRF3205?
merci, danke sehr
bro what will happen if I do same connections as you , only rather than connecting dc motor I would connect ac load?
I am not sure. The datasheet for 30N06L says that it can be used for AC motor control. So it might work (You need to have a seprate DC power supply for your Arduino). The 30N06L is rated for 60V, so you can't use the 220 or 110V with it.
make a video ixtn660n04t4 test
Hi, it's possible use mosfet or igbt as a switch on/off with arduino?
I want use Mos or igbt for cut 12v to coil spark motorcycle when I push the switch or when arduino work .... model mosfet I use
P channel o another type?
Thank you
Hey! If I understand you correctly that you want to switch on/off a 12V load then it should be exactly as I describe in this video.
It is easier to do with N-Channel mosfet since then you can use shared ground.
Hi.. I plan to use this in out capstone project... Pls tell me specifically what diode did you use... I've been searching for a flyback diode on online shops but I haven't been so lucky.... Thanks in advance
Hey! I used a 1N4007
How come in many other videos of N-Channel MOSFET's, they didn't use a resistor across the gate and source?
Hey! This resistor is necessary to give the MOSFET a default state while your Arduino is OFF.
Otherwise the state of the Gate would be floating while Arduino is not actively controlling it with HIHG and LOW value of the digital output.
Hello I need your help
I am making a coilgun
I need something to switch 500v dc from the capacitors to the coil
Please tell me what can I use to switch 500v dc
Hey! I really don't know. I don't do stuff with that high voltages. Maybe you could use a relay instead of a mosfet?
How hot does the MOSFET get? Wouldnt it have to dissipate a lot of heat?
Hey! With 12V and around 1A it didn't heat up. If you wan't to switch higher loads then you might need a heatsink.
Thanks!
And what if i want the mosfet "normally on" and set it off when i want to?? Maybe pull up resistor??I want the voltage keeps flowing if something goes wrong with the rest of the circuit
Enhancement-Type MOSFET is normally on. If you want normally off then you should use a Depletion-Type MOSFET.
Actually it's the other way around: enhancement-mode MOSFET is normally off and depletion-mode MOSFET is normally on. Like with other things regarding MOSFETs, the terminology is unfortunate.
‘Lossy clever’ = logic level
how would you do it if you would want the motor to spin in the other way?
Hey! For that it would be easeier for you to just buy a motor controller board that has an H-bridge on it: www.banggood.com/custlink/mKDDTDhcM8
With that you can control your motor's diction with digital output pins.
@@IndrekL thank so much for the reply, i really apreciate it, god bless
Hey there, why don't you use op amp and mosfet driver? And no inductor on the circuit. Could you explain to me? Because it will appear shaking spike current on oscilator.
Hey! You are right, that it is probably a good idea to add a 100 to 1k ohm resistor between the gate and the Arduino output PIN.
Here I am doing very low frequency switching which makes it less of a problem.
I wanted the schema to be as simple as possible.
@@IndrekL I think the pull down resistor (10k) function is only to define the ultimately LOW which atmega store to it. As same as push on button. So there is no leakage current on it when it's defined as a LOW state. As same as using mosfet as switch without the micro controller. That's why on every mainstream product related power supply or something that need the switching by voltage, needs mosfet driver, op amp as logic reference, and inductor to reduce the rest of shaking spike. Correct me if I'm wrong, master.
The pull-down resistor in the schematic is needed because otherwise, the MOSFET's gate would be floating in a random state while the Arduino is not powered ON. It makes sure that the MOSFET stays OFF while Arduino is OFF. After power-up, it takes a couple of seconds until the Arduino IO pin is defined as output and starts to actively drive the Gate pin of the MOSFET.
It will still work if you remove the 10k pull-down resistor after Arduino has started to run. Arduino digital output LOW will be equal to GND. And GND is directly connected to the source pin of the MOSFET. This makes the Gate-Source voltage to be 0 and the MOSFET is "OFF"
The Gate-Source voltage of the MOSFET 30N06L needs to be about 4 Volts to fully turn it "ON". Arduino's digital output is 5V compare to GND. So if Arduino Output is active there is 5V between the Gate and the Source pins of the MOSFET.
Hello, great work! I'm approaching the electronic hobby but I have many many questions. One is: I have a MOSFET with two thin wires that let the current flow through the MOSFET if connected togheter. I read from those wires the same voltage as the battery from which they draw power (from 7.4v to 11.1v, depending on the battery). In your video the voltage is 12v, so even higher. I am afraid tough that connecting those two wires to the Arduino will burn it as the voltage they operate is much higher than 5v. Can you please explain how this work?
Do I understand correctly that you wan to use the 7.4V..11.1V battery to power your Arduino.
You can do it if you connect it to Arduino's VIN pin. VIN pin has a voltage regulator that can take 6V to 12V power input.
@@IndrekL Thank you, but it wasn't the answer I was looking for, I'll try to explain better. I want to drive a MOSFET connected to a battery which voltage is greater than 5v (like the power supply (12v) you are using I think). For the little I know about, I know that connecting a voltage greater than 5v to a digital pin will burn it, but in your video this doesn't happen. So, can you explain to me why? Or what I'm getting wrong?
@@AriesBreath The Arduino digital output pin is connected to the Gate terminal of the MOSFET. Gate is the input for the MOSFET that turns it ON or OFF, and there is no current flowing through it.
With N-Channel MOSFETs, you can connect your Arduino GND to the Source pin of the MOSFET and an output pin to the Gate. The current that you are switching ON and OFF will flow through Drain and Source, but not through Gate.
@@IndrekL oh, I got it, thank you very much
Can i use 1K resistor ?
Hey! Yes, it should work.
How did you determine your resistor size
Hey! 10k is pretty much the default for pull-up or pull-down resistors. If there isn't a good reason to use anything else then I will use a 10k resistor.
@@IndrekL thanks for the tip I'm basically going to be using that same setup but with a 300 amp mosfet to make a battery terminal spot welder
Hi, I tried to run this tutorial with an IRL540N mosfet but the engine is always on and I can't turn it off and on according to what is written in the Arduino code. Why? Wrong MOSFET?
Hey! I see now reason why it shouldn't work with IRL540N. Does it work if you try it without the Arduino by manually connecting the gate to the positive lead of the power source? Like i do at 2:18
@@IndrekL It works but the mosfet heats up a lot. The moment I go to connect it to Arduino with the MOSFET ... it always stays on ... as if the mosfet remains in HIGH perpetually
It heats up if the Gate is not clearly above or below the threshold. For me, it started to heat up if the Gate was floating. How high is the voltage that you are switching? Can you take a picture of your connections?
Indrek the pump is a 12V with 80mA of power.
Re-check all the wiring. Maybe some wires do not have a good connection?
anazing video
Enchantment type MOSFET 😁
You’re not exposing anything and plugging in stuff to a breadboard doesn’t explain much.
never do this! a generic mosfet requires at least 10 volts for the gate, 5 volts is not enough it will overheat and wast a lot of power.
Hey!
The 30N06L I am using in this video is a Logic Level MOSFET. It's Gate threshold voltage Vgs(th) is 4V.
Datasheet: datasheetspdf.com/pdf-file/817129/UTC/30N06L/1
@@IndrekL yes but that has it's conditions. the conditions are that Vds=Vgs and Id= 250uAmps and at room temperature of 25 C. which in your case is not true.
just read the next row. Static Drain-Source On-State Resistance = 40 milliohms, Vgs=10 volts and Id = 15Amps, at this setup you will get the least internal resistance and the mosfet wont overheat or wast power.
@@IndrekL this type of setup is only good for learning not for any practical application. you should have mentioned it in your video.
@@Ahmadnaweed786 I really appreciate your feedback!
I do the electronics stuff as a hobby (mainly I am a programmer)
I understand that the optimal conditions are at Vgs=10V
I found this other datasheet that specifically brings out Rds(on) for Vgs=5V
cdn.sparkfun.com/datasheets/Components/General/FQP30N06L.pdf
According to this spec, in the case of Vgs = 10V, the resistance is up to 35 milliOhm
And if Vgs = 5V then it is a little higher up to 45 milliOhm.
In practice, the MOSFET didn't get hot at all when I did my experiments. It didn't even get warm.
It did get hot though if I accidentally let the gate floating - I assume that then the Vgs floated somewhere below 4V.
I read that Logic-level MOSFETs are specifically designed to be usable at lower voltages.
Your hard to understand and don't explain enough
Nice information. Will the mosfet drop some voltage at the motor?
i.e instead of 12v it will be getting 10.5 or 11volts.