Control 12v LED strip from Arduino using a Mosfet
Ғылым және технология
A simple guide to controlling 12 volt LED strips from your Arduino using an N Channel Mosfet.
In my example I'm using PWM to fade the 12v LED strip, but you could just as easily turn the LED strip on and off instead of fading it. Also it doesn't have to be an LED strip and it doesn't have to be 12v!
If you're going to drive a motor or a relay (or any inductive load) using this setup, you should add a diode across the positive and negative input of the motor/relay to avoid any back voltage.
I've over simplified things in terms of my description and the circuit, but it should be enough to get you up and running and to give you a basic understanding of how an N-Channel Mosfet works.
Pretty much any N Channel Mosfet will be fine, but ideally you want to go for an L series, because the gate can be reliably driven at lower voltages, such as the 5 volt from the Arduino.
If you're curious, a MOSFET is a metal-oxide-semiconductor field-effect transistor. The benefit of a MOSFET over the traditional relay is that it can turn on and off extremely quickly, meaning it's suitable for PWM, compared to the old coil relay which can't turn on and off so quickly. Of course a modern solid state relay can compare against a mosfet or transistor.
SUPPORT ME: If you enjoyed this video, please remember to give a LIKE and click here to subscribe to my channel - kzread.info_c...
Пікірлер: 434
You might prefer the simplicity of an Arduino relay board.. kzread.info/dash/bejne/onWs2MeRdpS9Zrg.html
@Lot10Games
6 жыл бұрын
Not when need low consumption in Arduino. Take my case, I am powering nano from sun(as a battery controller and house automatization), relay module uses 30mAh each, and my project without relay on consumes
@AlejandroCastiblanco171
6 жыл бұрын
which mosfet did you use? what resistance ?? can you share a diagram? is a IRF540N
@gg-gn3re
5 жыл бұрын
@Alejandro did you eve read the IRF540N? What are you trying to power, an entire building? Holy shit that is a big mosfet. That can barely even be driven by the low voltage of arduino LOL
@BillyNoodles
4 жыл бұрын
relays ew
@mangalaabewardana197
2 жыл бұрын
@@gg-gn3re pls help me give me example for n channel L series mosfet
Clear. Intelligent. Nothing superfluous. No annoying music. What a joy And how wonderful that is the missing part of my project.
Really impressively paced, clear, logical, explanatory and complete. I'm relieved to have found your video so early in my search - to dim about 9m / 7.5A of LED ribbon using an Arduino instructed by the circuit dimming function provided by my house's Dynalite automation system. That second bit is the next challenge - I suspect by analogue sampling. I look forward to exploring the rest of your videos.
A genuine thank you from Sweden for this hands-on and effective explanation of the concept.
The amount of RedBull in this video is too damn high!
@GadgetAddict
8 жыл бұрын
+ThatCoder I
@chillzwinter
8 жыл бұрын
+ThatCoder He'll be an insulin dependant diabetic by the time he is 30, if he's not already.
@aidanmeyer7825
8 жыл бұрын
If he's not already 30, or if he's not already a diabetic?
@loukask.9111
7 жыл бұрын
holy moly just saw it :D
@vitpodstavka7103
5 жыл бұрын
Depends on the time in which he drank them. If it took him 3 months he is probably fine, if it took him 3 days it is a diffrent story
GREAT video! So well thought-out, and wonderfully presented. Top marks. I am building a 4-bank led controller right now, and I think that the Mosfets and pots(inputs) will do the trick nicely.
Simplicity rules the day! This is a fantastic tutorial and exactly what I needed. Thank you.
Another Great tutorial, I cant believe its taken me 6 years to find it lol. Thanks John 👍😁
Really easy to understand. Perfect inspiration for beginners to get a handle on how to do this. I like how you keep the detail for later follow up. My electronics knowledge is quite lapsed and I needed a quick guide how to drive an Ikea Ledberg strip. Thank you for the excellent posts! :)
Watched over 10 video's nether of them let me understand how a mosfet works. This one is just great! I directly understood it and how I can take use of it! Thank you so much! You earned the like!
@GadgetAddict
8 жыл бұрын
+FrozoWolf I'm glad it helped you! It took me awhile to wrap my head around the topic so I figured I'd try make an easier to understand video!
I love this video. It's one of the simplest and most effective explanations I have ever seen. That was amazing. Thank you for what you do!!!
Simplicity is exactly what we need. Great video
excellent video - finally found this after reading lots of technical stuff that assumed a lot of prior knowledge. you are a great teacher!
Thank you so much for your great video, I was stucked in my project with N Channel Mosfet and you light me about the need to bridge my ground to esp8266 and 12v source, thank you so much, I appreciate that... You have one more subscriber!!!
this video is so clear, simple and concise that i cant even not even, good show, old chap
Your expalanation about mosfet is the clearest. Thank you very much...
Excellent! Like you said, I was able to find a lot of videos that just explained the physics behind the mosfet, and I get it, but they all left me unable to figure out how exactly to control some LEDs from my arduino. As soon as you pointed out that the ground of the arduino needed to connect to the ground of the power supply, my problem was solved. I was really concerned about how the gate would be controlled without a ground connection in the first place. Thank you!
@GadgetAddict
9 жыл бұрын
I'm glad it helped you out. Once I finally got it working, I realised that it's really very simple. I'd watched so many videos and tried to follow along without any luck. So once I finally understood it, I wanted to create a video that explains it as simply as possible, so other people can get up and running without too much bother.
You did a good job. You explained everything well and did a pretty good job on the production too.
I want to thank you. You did great video without cuts and show that there is nothin else to do. greayt
Thanks mate, i researched some days without a solution. I try to manage high voltage motors with mosfet. At min 3 when you explain the problem of connection between ground of power supplies i got the solution to my problem. Thanks for publishing.
@GadgetAddict
8 жыл бұрын
+Holoduke9 I'm glad you found a solution :D
You are a legend mate. Very nice fellow connecting up the MOSFET
I found your video very helpful, clear and easy to understand. Thank you!
Great lesson, clear simply and communicative! You are the Sheldon Cooper of the Electronic science, but more pleasant, Thaks for publishing. Roberto.
@GadgetAddict
7 жыл бұрын
Thanks Roberto :)
Thanks for the explanation! May the force be with you!
Really nice video explaning the workings of a arduino pwm and a mostfet!
Simple, basic, crystal clear... Also a fan of Manny..
Exactly what I was looking for. Thanks a bunch!
Well done. You made a big difference to me and my project. Made a complicated issue very easy. Thanks again. Its appreciated.
@GadgetAddict
8 жыл бұрын
+Cathal Brennan I'm glad it helped! :)
Simple, but effective. Nice job there.
Wow thanks, you made it very clear and simple.
Thank you. A simple example of mosfet
Great explanation. I'm very new to this and you just helped me out tonnes! Cheers
Thanks buddy! :) straightforward - perfect.
Encouraged to use mosfets now. Thanks.
Thank you very much just learning about these things and gave me a great grounding tutorial.
Thanks, this video is exactly what I was looking for
Thank you very much, great tutorial! This worked perfectly with a BUZ11 N-Channel MOSFET
@MrMegamok
2 жыл бұрын
I'm using a buz11 transistor as well. However, the LED's are significantly dimmer compared to when I connect them directly to the power source (With %100 duty cycle). Is this something you have encountered or do you know why this happens?
Absolutely perfect for my project!! Thank you 👊🏻
thanks for your video, it is really nice for newbies like me to understand and i am now possible to try on my own
It's Sheldon!!!
Best tutorial out here :)
Do you have a link for the exact MOSFET that you used?
that actually helped me a lot! thanks!
You have awesome videos mate, keep it up.
@GadgetAddict
9 жыл бұрын
Thanks for the feedback :)
video was really helpful thanks
great video, very clear and easy to follow, thanks!
@GadgetAddict
7 жыл бұрын
I'm happy you found it useful :)
you're amazing! thanks this really cleared things up!
I don't give like that easy but, you really deserve it Excellent explanation 👍🏻 And I subscribed 🤝
@GadgetAddict
7 жыл бұрын
+Mohammed AlEnezi excellent, thanks !
Very well explained.. Thank you so much!
Thanks for posting this video!
Thanks for the video mate!
Great video, thanks for sharing!
Great explaining, subscribing! Keep up!
Thank you so much!! this video helped a ton! i love you
Going to use this to control the lighting I've added in the interior of my truck by the stock OEM dimmer so it will dim with the backlighting.
Great explanation.. Great job man..
Thanks, clearest tutorial online, and it works! But my N Channel MOSFET quickly overheats while idle (ie the gate is closed), so i think anyone reading this needs to order a 'Logic' N Channel MOSFET..
@Estudio322
5 жыл бұрын
Yes, always look the datasheet for the Threshold Voltage, that is when the MOSFET is fully turned on in the Saturation Region. Or you could simply make a proper voltage polarization circuit for the gate of the MOSFET with just a general purpose BJT transistor and some resistors.
Nice one, brother. You just saved me from buying a relay ;)
great tutorial for newbies like me... thanks
Simply Amazing. Thank you so much.
wow, bro! nice shirt...Manny and amazing video tutorial.
Thank you very much for making this video. I'm currently working on designing a prop FX package around an Adafruit "Pro Trinket" mini Arduino board, and needed a way for the 3v Trinket to control a muzzle flash LED running on a much higher voltage. I was wondering if I could use a MOSFET to do it, and not only did your video confirm my theory, it showed me exactly how to set it up. Again, thanks.
Thank you bro.. its very helpful tutorial...
Loved this, thank you
Great video! Thanks!
Thank you for the video! It helps a lot! I am trying to program an LED light strip to chase the lights with the Ardunio Fleather board. Will the Mofset work for this?
Nice video! Do you reckon that this kind of approach could work to attach high current drawing stepper motors like NEMA34 to low current stepper drivers (like grbl shield)? Would the mosfet be fast enough for CNC accuracy? Cheers!
THANKS FOR THE VIDEO, IT WAS OF GREAT HELP TO ME BEST REGARDS
00:00 sheldon cooper Btw, great video
Great video! it really helped me to understand the work of mosfets in combination with arduino. I have a question though: Sometimes I read on the internet that the mosfet doesn't need a connection to ground. You hook up the ground of the arduino to the negative (ground) of the powersource, is that really necessary?
Superb and easy to follow guide. Worked great thanks :) I had a issue when applying it when the pin has code where the light needs to be completely off i.e. When power is applied, the LED strip comes on instantly before going to it's lowest dim level. But I need it to not light up when power is applied until my code tells it to. I'm assuming this is a MOSFAT issue circuit issue as it happens with any code I use, as the code works when I use single LED(S).
Good video, thank you!!
In other videos but with RGB strip they also use a resistor between the arduino and the transistor. The light is more bright without it, so is it safe not to use one (1kresistor)?
Thnx a lot for this great video. I have a couple of questions. Since LED illuminance is driven with current, how do you calculate min and max current supplied? Also, if my led strip requires 1.5 Amps, what should the power supply be and which mossfet should i use? Thnx a lot.
My god, i have tried for bloody 8 months to understand mosfets. Problem was i had gotten a bad batch, nearly none where working. the Mosfets just didnt do what they where supposed to. Got a new batch and FINALLY they are working. I thought i was going MAD.
Thank you! very simple, but i tried this with led spotlight and it's flickering when the analog value of the arduino under 100, any suggestions?
Thank you for the tutorial bud. This really opens some doors for programming 12v leds with the arduino. You could basically make your own animated light show and sync it with music tracks or live. It's like DMX lights but cheaper and you get the same effects, if you know how to code it right.
@GadgetAddict
9 жыл бұрын
brdane Yep! Although for big light shows you might want to buy a cheap 8-relay arduino compatible board. That's what I did for my halloween light show (its on my channel). Be sure to buy the solid state relay board because I found the standard mechanical relays would become 'sticky' if you ran them too fast.
@brdane
9 жыл бұрын
Gadget Addict can those type of relay boards support PWM?
@GadgetAddict
9 жыл бұрын
brdane Ah sorry, no they wont be any good for PWM.
@brdane
9 жыл бұрын
Gadget Addict gotcha gotcha. I think just mosfets by themselves should do the job. I'm not doing really long light shows, it's just for live bands, pre-programmed to go synced up to the band.
@deadlykiller27
5 ай бұрын
@@GadgetAddict Your entire channel is now dedicated to traffic stops?!?? And for some reason they have a lot more views than videos like this? What is going on.
Well explained !!! Fianally
ive been asking how to use external power source with arduino for a year, finnaly i got simple answer in 5 minutes, the mosfet shit..... just ordered online.. thanks.
@GadgetAddict
8 жыл бұрын
+Srgjan XXI No problem :)
Thanks for your video !!! :D
great video thanks for that
nice video!
nice job keep it up
Hallo, your video' helped me a lot, so thanks man! I have a quick question though, What if im gonna use 2 Led tape? can i just add the LED To a PWM arduino pin, or should i add another power supply first?
Hello, can I know the exact number of MOSFET you used for tutorial???
So please tell me for example to N type MOSFET. I can buy. I m beginner to electronics so i need help me.
Hello Sheldon Cooper.
@BrutalGames2013
5 жыл бұрын
The same thing I was thinking :D
Is it possible to provide signals to both the anode and cathode from a microcontroller, and then obtain a 15 amp output from the MOSFET? Can the MOSFET accommodate giving an anode signal to the drain pin?
I did exactly as you said. II'm using an IRF 540 MOSFET. The LED strip lights up but does not blink while the onboard arduino blinks. Any guesses what is wrong
Well done kabayan!!! Cheers. ...
Thanks my attraction to using a mosfet is that it's smaller and more efficient than using a relay. I want to turn on and off a GPS. Does it matter if I connect positive in stead of negative via the source and drain? Can you give us a link to the "fade sketch"? Thanks again!
Hi, many compliments for Your video. Just a info: i need to make a counter up/down to realize a volleyball scoreboard. I want to use a LED strips (35 led for digit for a total of 4 digits). Do You think is it possible using mosfet instead rele? How about to use a PC power supplier? Thaks a lot, Umberto.
I want to fix my led Controller. There is one mosfet defect. I would like to build not the same one but a larger one. How do I find out which mosfet I need.
+Gadget Addict where can i buy an N channel Mosfet suitable for controllings something 3V? It draws 250mA so i need to power it separately.
Good video.Good example. Don`t drink that poison from the window!
I use a 12v power supply for the arduino. Can i use the Vin pin instead of a separate 12v battery, to power the ledstrip?
Hi, nice video! Can you please put the links to the harware you've used? Moset nad led strip. Just to check the specs and be sure that I'm buying the right things. thanks
Few questions here.. Which MOSFET are you using in the circuit? Don't we need a pull down resistor connected at gate of the MOSFET? In case to avoid misreadings at the gate due to capacitive discharge and turn ON the gate/LED when we actually need it turn OFF. Also, does MOSFET's Vds respond to PWM in the same way as the PWM at Vgs? That's really cool if it does. I thought MOSFET could just be used to turn off and/or on.
I've been reading a lot about this type of stuff recently, while just trying to get a couple of 12v LED's to light. I should be able to give this a try in a week or so since my LEDs will finally come in. I've a Raspberry Pi though not an arduino,
@GadgetAddict
9 жыл бұрын
You can do the same thing with your raspberrypi :) I've done something similar using servo motors and python on the Pi :)
@bradleybauer7874
9 жыл бұрын
Nice!, well thanks for the video man, it really helped.
Thank you so much!