Control 12v LED strip from Arduino using a Mosfet
Vložit
- čas přidán 26. 08. 2014
- 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 - czcams.com/users/subscription_c... - Věda a technologie
You might prefer the simplicity of an Arduino relay board.. czcams.com/video/pAxveXF1W6U/video.html
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
which mosfet did you use? what resistance ?? can you share a diagram? is a IRF540N
@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
relays ew
@@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.
The amount of RedBull in this video is too damn high!
+ThatCoder I
+ThatCoder He'll be an insulin dependant diabetic by the time he is 30, if he's not already.
If he's not already 30, or if he's not already a diabetic?
holy moly just saw it :D
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
A genuine thank you from Sweden for this hands-on and effective explanation of the concept.
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.
Another Great tutorial, I cant believe its taken me 6 years to find it lol. Thanks John 👍😁
Simplicity rules the day! This is a fantastic tutorial and exactly what I needed. Thank you.
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! :)
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!!!
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.
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!
+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!
excellent video - finally found this after reading lots of technical stuff that assumed a lot of prior knowledge. you are a great teacher!
this video is so clear, simple and concise that i cant even not even,
good show, old chap
Simplicity is exactly what we need. Great video
Your expalanation about mosfet is the clearest. Thank you very much...
I want to thank you. You did great video without cuts and show that there is nothin else to do. greayt
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!!!
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!
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 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.
Thanks Roberto :)
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.
+Holoduke9 I'm glad you found a solution :D
Thanks for the explanation! May the force be with you!
Really nice video explaning the workings of a arduino pwm and a mostfet!
You are a legend mate. Very nice fellow connecting up the MOSFET
Simple, but effective. Nice job there.
Thank you very much just learning about these things and gave me a great grounding tutorial.
Well done. You made a big difference to me and my project. Made a complicated issue very easy. Thanks again. Its appreciated.
+Cathal Brennan I'm glad it helped! :)
It's Sheldon!!!
Thank you very much, great tutorial!
This worked perfectly with a BUZ11 N-Channel MOSFET
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?
Wow thanks, you made it very clear and simple.
Simple, basic, crystal clear... Also a fan of Manny..
Exactly what I was looking for. Thanks a bunch!
Thank you. A simple example of mosfet
thanks for your video, it is really nice for newbies like me to understand and i am now possible to try on my own
Encouraged to use mosfets now. Thanks.
Great explanation. I'm very new to this and you just helped me out tonnes! Cheers
Thanks, this video is exactly what I was looking for
Do you have a link for the exact MOSFET that you used?
Absolutely perfect for my project!! Thank you 👊🏻
Thanks buddy! :) straightforward - perfect.
Best tutorial out here :)
00:00 sheldon cooper
Btw, great video
that actually helped me a lot! thanks!
You have awesome videos mate, keep it up.
Thanks for the feedback :)
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.
+Srgjan XXI No problem :)
Nice one, brother. You just saved me from buying a relay ;)
great video, very clear and easy to follow, thanks!
I'm happy you found it useful :)
video was really helpful thanks
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 🤝
+Mohammed AlEnezi excellent, thanks !
Very well explained.. Thank you so much!
Great explaining, subscribing! Keep up!
great tutorial for newbies like me... thanks
Hello Sheldon Cooper.
The same thing I was thinking :D
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..
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.
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?
Thanks for posting this video!
Great explanation.. Great job man..
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 video, thanks for sharing!
wow, bro! nice shirt...Manny and amazing video tutorial.
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.
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).
Thanks for the video mate!
Thank you bro.. its very helpful tutorial...
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?
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.
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.
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.
Gadget Addict can those type of relay boards support PWM?
brdane Ah sorry, no they wont be any good for PWM.
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.
@@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.
THANKS FOR THE VIDEO, IT WAS OF GREAT HELP TO ME
BEST REGARDS
Simply Amazing. Thank you so much.
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.
Loved this, thank you
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!
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?
Great video! Thanks!
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)?
Good video.Good example. Don`t drink that poison from the window!
Well done kabayan!!! Cheers. ...
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?
Good video, thank you!!
This video is so useful for me. Firstly thank you. I just find a solution about my growth chamber. I made growth chamber which is contain 3 series 3 paralel 3W power white leds. I need to control light intensity with potentiometer. So I made a design with LM350 adjustable voltage regulator but it wasn't suitable. Because my leds run with approx. 2.1A so LM350 got warmer and also there was approx 4.5V drop-out voltage. So if I use mosfet and potentiometer system, is there high drop-out voltage ? I just curious about it Thanks
Hi Sheldon! !!
Well explained !!! Fianally
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,
You can do the same thing with your raspberrypi :) I've done something similar using servo motors and python on the Pi :)
Nice!, well thanks for the video man, it really helped.
Thanks for your video !!! :D
Hi! Does it work with 3.3V ESP8266 as well?
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
Thanks!it's help me a lot:)
great video thanks for that
Thank you so much!
Your voice is almost on ASMR level ;D
A few people have said that but I don't know much about ASMR.
Thanks for the vid., what mosfet model are you using.? Hoping for a feedback 👦🏼
nice video!
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.
This has been the most straightforward tutorial I've found for powering LEDs.
Do you think it's possible to run 4 of these LED strips with one Arduino Uno board ?
I'm working on a project where 4 motion sensors will set off individual LED strips.
Ryan Woodhall Thanks :) And yup it would definitely be possible. It doesn't take much for the arduino to switch the transistor on and off and you have more than enough pins on pretty much every arduino I know.
nice job keep it up
Hey I think that the + of the battery should be connected to the source, and drain to the + of the led. Is it the same thing?
hello, I like your video. Can I ask, what if the Arduino voltage is directly from the accu ?