Control 12v LED strip from Arduino using a Mosfet

Sdílet
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

Komentáře • 435

  • @GadgetAddict
    @GadgetAddict  Před 7 lety +7

    You might prefer the simplicity of an Arduino relay board.. czcams.com/video/pAxveXF1W6U/video.html

    • @Lot10Games
      @Lot10Games Před 6 lety

      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
      @AlejandroCastiblanco171 Před 6 lety

      which mosfet did you use? what resistance ?? can you share a diagram? is a IRF540N

    • @gg-gn3re
      @gg-gn3re Před 6 lety

      @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
      @BillyNoodles Před 4 lety

      relays ew

    • @mangalaabewardana197
      @mangalaabewardana197 Před 2 lety

      @@gg-gn3re pls help me give me example for n channel L series mosfet

  • @CraigMansfield
    @CraigMansfield Před 2 lety +2

    Clear. Intelligent. Nothing superfluous. No annoying music.
    What a joy
    And how wonderful that is the missing part of my project.

  • @SmartLifeEnthusiast
    @SmartLifeEnthusiast Před 8 lety +129

    The amount of RedBull in this video is too damn high!

    • @GadgetAddict
      @GadgetAddict  Před 8 lety +2

      +ThatCoder I

    • @chillzwinter
      @chillzwinter Před 8 lety +4

      +ThatCoder He'll be an insulin dependant diabetic by the time he is 30, if he's not already.

    • @aidanmeyer7825
      @aidanmeyer7825 Před 8 lety +1

      If he's not already 30, or if he's not already a diabetic?

    • @loukask.9111
      @loukask.9111 Před 7 lety

      holy moly just saw it :D

    • @vitpodstavka7103
      @vitpodstavka7103 Před 5 lety

      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

  • @christianeriksson4733
    @christianeriksson4733 Před 4 lety

    A genuine thank you from Sweden for this hands-on and effective explanation of the concept.

  • @jonathanm9436
    @jonathanm9436 Před 8 lety +10

    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.

  • @johnberry5339
    @johnberry5339 Před 4 lety +1

    Another Great tutorial, I cant believe its taken me 6 years to find it lol. Thanks John 👍😁

  • @dogsborodave
    @dogsborodave Před 6 lety +1

    Simplicity rules the day! This is a fantastic tutorial and exactly what I needed. Thank you.

  • @RallyGeek12
    @RallyGeek12 Před 8 lety

    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! :)

  • @mcbbcn
    @mcbbcn Před 2 lety +1

    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!!!

  • @JSROOKS
    @JSROOKS Před 7 lety +2

    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.

  • @FrozoWolf
    @FrozoWolf Před 8 lety

    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
      @GadgetAddict  Před 8 lety

      +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!

  • @MrRobertpn
    @MrRobertpn Před 9 lety

    excellent video - finally found this after reading lots of technical stuff that assumed a lot of prior knowledge. you are a great teacher!

  • @josephke20
    @josephke20 Před 6 lety

    this video is so clear, simple and concise that i cant even not even,
    good show, old chap

  • @kwisatzhaderach1458
    @kwisatzhaderach1458 Před 5 lety +1

    Simplicity is exactly what we need. Great video

  • @ekopurnomo325
    @ekopurnomo325 Před 7 lety

    Your expalanation about mosfet is the clearest. Thank you very much...

  • @matron_gaming
    @matron_gaming Před 6 lety

    I want to thank you. You did great video without cuts and show that there is nothin else to do. greayt

  • @alcidesmarcano
    @alcidesmarcano Před 4 lety +1

    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!!!

  • @jasonorozco1587
    @jasonorozco1587 Před 10 lety +1

    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
      @GadgetAddict  Před 10 lety +2

      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.

  • @seditiousmonkeyart
    @seditiousmonkeyart Před 2 lety

    You did a good job. You explained everything well and did a pretty good job on the production too.

  • @Mrtfrimet
    @Mrtfrimet Před 9 lety

    I found your video very helpful, clear and easy to understand. Thank you!

  • @MillaeGiuliano
    @MillaeGiuliano Před 7 lety

    Great lesson, clear simply and communicative!
    You are the Sheldon Cooper of the Electronic science, but more pleasant,
    Thaks for publishing.
    Roberto.

  • @Holoduke9
    @Holoduke9 Před 8 lety

    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
      @GadgetAddict  Před 8 lety

      +Holoduke9 I'm glad you found a solution :D

  • @ofekpearl
    @ofekpearl Před 7 lety

    Thanks for the explanation! May the force be with you!

  • @yoramswiers
    @yoramswiers Před 3 lety

    Really nice video explaning the workings of a arduino pwm and a mostfet!

  • @electrichorror6642
    @electrichorror6642 Před 6 lety

    You are a legend mate. Very nice fellow connecting up the MOSFET

  • @Nastaliss
    @Nastaliss Před 9 lety

    Simple, but effective. Nice job there.

  • @robertgrain7368
    @robertgrain7368 Před 9 lety +1

    Thank you very much just learning about these things and gave me a great grounding tutorial.

  • @cathalbr1
    @cathalbr1 Před 8 lety

    Well done. You made a big difference to me and my project. Made a complicated issue very easy. Thanks again. Its appreciated.

  • @WhoWantsToKnow81
    @WhoWantsToKnow81 Před 9 lety +51

    It's Sheldon!!!

  • @SK-cp5eh
    @SK-cp5eh Před 7 lety

    Thank you very much, great tutorial!
    This worked perfectly with a BUZ11 N-Channel MOSFET

    • @MrMegamok
      @MrMegamok Před 2 lety

      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?

  • @sized4spills
    @sized4spills Před 8 lety +1

    Wow thanks, you made it very clear and simple.

  • @karlgerardmiclat2137
    @karlgerardmiclat2137 Před 3 lety

    Simple, basic, crystal clear... Also a fan of Manny..

  • @trinathon36
    @trinathon36 Před 9 lety

    Exactly what I was looking for. Thanks a bunch!

  • @KraKaKrwa
    @KraKaKrwa Před 5 lety

    Thank you. A simple example of mosfet

  • @summa8435
    @summa8435 Před 7 lety

    thanks for your video, it is really nice for newbies like me to understand and i am now possible to try on my own

  • @makerjason1034
    @makerjason1034 Před 8 lety

    Encouraged to use mosfets now. Thanks.

  • @michaelurwin2526
    @michaelurwin2526 Před 4 lety

    Great explanation. I'm very new to this and you just helped me out tonnes! Cheers

  • @Slozkins
    @Slozkins Před 7 lety

    Thanks, this video is exactly what I was looking for

  • @nasirillasarie3664
    @nasirillasarie3664 Před 8 lety +34

    Do you have a link for the exact MOSFET that you used?

  • @CraigMansfield
    @CraigMansfield Před 2 lety

    Absolutely perfect for my project!! Thank you 👊🏻

  • @ChipHirn
    @ChipHirn Před 9 lety +1

    Thanks buddy! :) straightforward - perfect.

  • @PirateGamINC
    @PirateGamINC Před 8 lety +2

    Best tutorial out here :)

  • @ernestosastre7555
    @ernestosastre7555 Před 8 lety +10

    00:00 sheldon cooper
    Btw, great video

  • @julinaut
    @julinaut Před 6 lety +1

    that actually helped me a lot! thanks!

  • @ninety85
    @ninety85 Před 10 lety +1

    You have awesome videos mate, keep it up.

  • @SrgjanLDTeam
    @SrgjanLDTeam Před 8 lety +10

    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.

  • @raskjaerbo
    @raskjaerbo Před 8 lety

    Nice one, brother. You just saved me from buying a relay ;)

  • @richardhalling4398
    @richardhalling4398 Před 7 lety

    great video, very clear and easy to follow, thanks!

  • @mohammadibrahimkhan5754
    @mohammadibrahimkhan5754 Před 9 lety +2

    video was really helpful thanks

  • @electricrainbowness
    @electricrainbowness Před 9 lety

    you're amazing! thanks this really cleared things up!

  • @mohammedalenezi3807
    @mohammedalenezi3807 Před 7 lety

    I don't give like that easy but, you really deserve it
    Excellent explanation 👍🏻
    And I subscribed 🤝

  • @star_dax
    @star_dax Před 6 lety

    Very well explained.. Thank you so much!

  • @BlitzHopB
    @BlitzHopB Před 5 lety

    Great explaining, subscribing! Keep up!

  • @edisonmecaj769
    @edisonmecaj769 Před 8 lety

    great tutorial for newbies like me... thanks

  • @meowman8958
    @meowman8958 Před 9 lety +26

    Hello Sheldon Cooper.

  • @JethroGillgren77
    @JethroGillgren77 Před 5 lety

    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
      @Estudio322 Před 5 lety

      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.

  • @senne8556
    @senne8556 Před 8 lety

    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?

  • @carlylea
    @carlylea Před 8 lety

    Thanks for posting this video!

  • @KevinBritain
    @KevinBritain Před 8 lety

    Great explanation.. Great job man..

  • @anonymouse7290
    @anonymouse7290 Před 7 lety

    Thank you so much!! this video helped a ton! i love you

  • @wolfpack4128
    @wolfpack4128 Před 6 lety

    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.

  • @markcurd8899
    @markcurd8899 Před 7 lety

    Great video, thanks for sharing!

  • @melbournepangilinan4836

    wow, bro! nice shirt...Manny and amazing video tutorial.

  • @Inesophet
    @Inesophet Před 7 lety

    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.

  • @CaptainsDrydock
    @CaptainsDrydock Před 6 lety

    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).

  • @guidopiotrowski7900
    @guidopiotrowski7900 Před 7 lety

    Thanks for the video mate!

  • @arichitkumarpatha8514
    @arichitkumarpatha8514 Před 5 lety

    Thank you bro.. its very helpful tutorial...

  • @barryward1698
    @barryward1698 Před 6 lety

    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?

  • @Mr_ToR
    @Mr_ToR Před 7 lety

    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.

  • @brdane
    @brdane Před 9 lety +5

    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
      @GadgetAddict  Před 9 lety

      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
      @brdane Před 9 lety

      Gadget Addict can those type of relay boards support PWM?

    • @GadgetAddict
      @GadgetAddict  Před 9 lety

      brdane Ah sorry, no they wont be any good for PWM.

    • @brdane
      @brdane Před 9 lety

      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
      @deadlykiller27 Před 6 měsíci

      @@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.

  • @marcetigreshark
    @marcetigreshark Před 8 lety

    THANKS FOR THE VIDEO, IT WAS OF GREAT HELP TO ME
    BEST REGARDS

  • @xyzatin
    @xyzatin Před 2 lety

    Simply Amazing. Thank you so much.

  • @outcry27
    @outcry27 Před 9 lety

    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.

  • @boydbros.3659
    @boydbros.3659 Před 6 lety

    Loved this, thank you

  • @aekidna
    @aekidna Před 8 lety

    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!

  • @2gigahijau
    @2gigahijau Před 3 lety

    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?

  • @guidopiotrowski7900
    @guidopiotrowski7900 Před 7 lety

    Great video! Thanks!

  • @TaffoVelikoff
    @TaffoVelikoff Před 7 lety

    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)?

  • @Lot10Games
    @Lot10Games Před 6 lety

    Good video.Good example. Don`t drink that poison from the window!

  • @treborsmith7416
    @treborsmith7416 Před 10 lety

    Well done kabayan!!! Cheers. ...

  • @mohanadobaid8285
    @mohanadobaid8285 Před 7 lety

    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?

  • @dukesnyder3607
    @dukesnyder3607 Před 5 lety

    Good video, thank you!!

  • @jeolex45
    @jeolex45 Před 9 lety

    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

  • @KiuCraft
    @KiuCraft Před 9 lety +4

    Hi Sheldon! !!

  • @oresteselias
    @oresteselias Před 7 lety

    Well explained !!! Fianally

  • @bradleybauer7874
    @bradleybauer7874 Před 9 lety

    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
      @GadgetAddict  Před 9 lety

      You can do the same thing with your raspberrypi :) I've done something similar using servo motors and python on the Pi :)

    • @bradleybauer7874
      @bradleybauer7874 Před 9 lety

      Nice!, well thanks for the video man, it really helped.

  • @m810203
    @m810203 Před 8 lety

    Thanks for your video !!! :D

  • @HiWiFiDrones
    @HiWiFiDrones Před 6 lety

    Hi! Does it work with 3.3V ESP8266 as well?

  • @shusterme
    @shusterme Před 7 lety

    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

  • @kidianliu9673
    @kidianliu9673 Před 9 lety

    Thanks!it's help me a lot:)

  • @maxpagel8951
    @maxpagel8951 Před 9 lety

    great video thanks for that

  • @imanh92
    @imanh92 Před 9 lety

    Thank you so much!

  • @resonanceofambition
    @resonanceofambition Před 7 lety

    Your voice is almost on ASMR level ;D

    • @GadgetAddict
      @GadgetAddict  Před 7 lety

      A few people have said that but I don't know much about ASMR.

  • @johnkevinbustamante1583

    Thanks for the vid., what mosfet model are you using.? Hoping for a feedback 👦🏼

  • @MrSomeDude
    @MrSomeDude Před 7 lety

    nice video!

  • @Umby73you
    @Umby73you Před 8 lety

    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.

  • @ryanwoodhall92
    @ryanwoodhall92 Před 9 lety

    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.

    • @GadgetAddict
      @GadgetAddict  Před 9 lety

      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.

  • @habeshaentertainment9845

    nice job keep it up

  • @p1ggie
    @p1ggie Před 8 lety

    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?

  • @bagusanugerah5817
    @bagusanugerah5817 Před 5 lety

    hello, I like your video. Can I ask, what if the Arduino voltage is directly from the accu ?