MOSFETs and Transistors with Arduino
Вставка
- Опубліковано 29 чер 2024
- Today we will learn how to use Transistors and MOSFETs to enable our Arduino to switch high-current DC loads, including a 12-volt RGB LED Strip Light.
Article at dronebotworkshop.com/transist...
More tutorials and projects at dronebotworkshop.com
Chat on the Forum at forum.dronebotworkshop.com
Join the newsletter - dronebotworkshop.com/subscribe/
Transistors are the basic building block of modern electronics. Just about everything uses transistors, including the Arduino itself.
Using a power transistor or MOSFET we can drive high-current devices using the logic-level outputs from our Arduino. Today we’ll learn to use both devices.
We will start with a simple transistor switch, you’ll see how easy it is to switch a high-current DC lamp using a popular power transistor.
Inductive loads like motors and relays present an additional challenge, as these devices generate a “back-EMF” that we need to deal with. We’ll use a diode to take care of the back-EMF and build a simple motor speed controller.
We will then turn our focus to MOSFETs. MOSFETs have a number of advantages over standard transistors. We will learn how to use popular MOSFET modules to control an RGB LED Strip in a simple but colorful experiment.
Here is what is in today's video:
00:00 - Introduction
02:49 - Transistors and MOSFETs
16:23 - Transistor Switching Demo
22:54 - Transistor Motor Control
29:52 - MOSFET RGB LED Strip Light Control
Please note that transistors and MOSFETs are great for controlling DC loads, but not AC. I’ll be showing you how to control AC loads in a future video. - Навчання та стиль
Every DBW video I see, I'm just blown away how well you break stuff down. You're the single reason I'm still doing electronics
In love with your shop, absolutely amazing
Of all the damn arduino mosfet videos out there, this is THE BEST one out there for understanding the process from beginning to end. I am eternally in your debt.
Great vid, any coverage of transistors, mosfets, bjt's etc. Will always stimulate healthy discussion.
Can hardly wait for the next vid in this series.
Thanks for sharing.
👍👍👍👍👍
ua-cam.com/video/OlGxkWtopIg/v-deo.html
I’m so jealous of this guys workspace. That is some magnificently ocd organization. Beautiful!
Same feeling bro
Yeah mine is so messy. I am slob. Haha
Ah, that has to be all CGI. Nobody has that COoL a shop! :O)
This is why I keep coming back to these videos.... workshop envy
What? Your workshop doesn't have every tiny drawer labeled and every tool in its own place on a pegboard? And a power supply spanning the gap at the bottom, and two voltmeters? and a resistor color guide?
Hey, I just want to say I love your channel and it's really helping me a lot in my projects!
Your teaching and videos are so wonderful.
I'm very grateful that there's people in the world teaching like you do.
Awesome stuff !! Thanks !!
(Watching from NZ)
Fantastic! Thanks a lot for all your great, inspiring work & tutorials. Really nice that you provide a fancy website along with the videos with the detailed articles, code snippets, lib downloads and of course the PDF version of the articles. I really like your clear way of explaining things. Best wishes!
Thank you so much for the video! It will definitely help me in my DC motor drive projects. Until now I was working with small motors for rc cars and wanted to move to the next step and drive bigger motors.
Spending 51' watching this video was a beautiful experience where i learnt a lot about automated systems...thank you brother
Definitely one of the most fantastic learning channels on UA-cam. Great learning for folks just getting into electronics--and even a great review for people who've not done this stuff for a while.
ua-cam.com/video/OlGxkWtopIg/v-deo.html
You are so good at clearly explaining how everything works. Thank you!
ua-cam.com/video/OlGxkWtopIg/v-deo.html
this channel is GREAT. This guy captures exactly the possible doubts that could be in our mind, and answer they BEFORE we even ask it! That's a teacher!
Yes, together with bigclivedotcom they do a hell of a job on learning us a LOT.....
Thanks for this. I learn by solving problems and your videos act as a good bridge from application to theory. Sure, I'll probably spend the first couple of years being asked why I didn't know something obvious that's taught in 101, but after that I usually (in software, at least) end up doing stuff simply because I hadn't been taught that it can't be done.
Another fantastic educational video from our teacher.
I'm from Mafra, SC, Brazil and YOU are my main reference for my electronics-related learning. Great explanation, direct, precise and organized! Congratulations for your videos!
PS: i just LOVE your workshop!
Great video! Clear and easy to follow. You mention everything that is needed to mention, which makes it comfortable to follow. Thank you.
The man speaks with confidence, I call that Knowledge. Thanks
I call that a politician.
@@scottmcclements7566 No.....this man does not lie.
@@scottmcclements7566
L
I just found your channel and I love it. I've been working with Arduinos and electronics for years and I'm learning some things from your channel.
This was an excellent tutorial! Thank you for being so thorough, and most importantly for going SLOW!
Great. Your slow way of speaking makes learning much easier, even for those who don't speak English natively, like me. Congratulations!
Absolutely !
What a brilliant channel. Keep up the good work, your content and delivery is on point!
An incredibly practical and absolutely fantastic video. I love your teaching style and the comprehensiveness of your topics. Thank you for taking the time to share your knowledge. This is a gem of a channel.
ua-cam.com/video/OlGxkWtopIg/v-deo.html
Thanks for wearing the static wrist strap. It demonstrates a good habit.
You're The Man!
Thanks for all your efforts.
You're fast becoming my favorite teacher!
Almost everything I want to do, you have already have the videos made!
Timing is everything. What an adventure...
Subscribed and checking out the website and forum.
Good technology is less costly these days to bring this all together like never before in history.
Android USB OTG to a Arduino Mega, is quite possibly the greatest simple potential for AI robots.
High quality quality education and no student loans. Amazing. THANK YOU
I viewed a lot of videos about transistors/mosfets but now I really got it. Thank you, very good tutorials!
Very educational it open my eyes with a new whole perspective.
Iam now beginning to have interest in electronic hobby
Your videos are really, really well made - I enjoy watching them and learn a lot. After having watched your videos on stepper motors and servos, would you please consider making a tutorial on the similar hobby-sized brushed DC motors with rotary encoders installed on them? They come with either optical or magnetic encoding, some with a single sensor, and some with AB encoding like in rotary encoder knobs.
Very good informational video, which basically demonstrates how to replace the good old mechanical relay with a modern MosFet transistor.
Good stuff sir. Fairly comprehensive while still being practical and to the point. Well presented and easy to follow. Keep it coming, and most importantly, thanks for creating.
Thanks man, you are one of the few jewels here on youtube
This was great! I don't have the components yet for this. But now I do have the urgency to get them. This is so over my skill level so far. You set this up and explained it so well I'm going to give it a try anyway.
outstanding Bill! thanks for this one.. it helps to explain things to me..carry on, and be safe brother.!
Thank you sir! I really needed to hear the description and function of these transistors.
It is tremendously helpful!
You Sir are one of the few ppl on YT who use esd protection - wrist strap and dissipative foam for lining your parts drawers.
Bravo!
I was able to complete a project I've been struggling with for ages now. Really helpful so thank you very much!!
Really cool! I had a set of those about that long around the windshield of my Class A Motor Home for holiday use. They are still stuck up there and have been for over 6 years, it came with an AC to DC power supply with built in controller so I ran it off that. We used to head south in November from South Dakota, and come home in March from Arizona so it was a home for me and my wonderful wife (RIP) who was taken from me because the hospitals shut down just when the cancer made itself known if she could have been tested, it could have been stopped but the test was considered non essential surgery so she had to wait 3 months and by then the cancer had invaded most of her body. It was a long 3 months at home while I with the aid of my daughter cared for her as the cancer ate away at her fragile body. In the end she spent 4 days in hospital till her last breath was taken, with me on one side and my daughter on the other holding her hand as it was exhaled for ever. Damn covid! She did not have it but the government kept her from the test and at the time there were NO CASES and the hospital sat empty!
Love your channel, excellent explanation as usual. Thank you, you're a great teacher!
Great simple explanation of a complex subject. Your graphics are priceless.
Hi Bill. When watching this I thought that it might be an idea one day to show people how you progress from a fritz diagram to a maze of wires on a breadboard. I think some people (me included) have difficulty transferring from design to a pile of component placement and wire alignments. Cheers and thanks for your works.
Really appreciate the hard work you put into your video thanks
Perfect wanted you to do this for a long time.
A very useful and interesting video. Thank you for yet again more tips and advice.
Code suggestion: use #define and/or const variables instead of regular global variables for static values (pin #, physical constants, etc).
Why? This matters when memory is a constrained resource. The compiler puts #define values and const variable values into the machine code, which is stored on Arduino's flash memory. In contrast, the compiler allocates space for regular global variables in Arduino's SRAM. Arduino UNO has only 2K of SRAM, but 32K of Flash.
The other reason is readability. You can use #define and/or const variable to implicitly document that this value does not change during runtime. A regular variable suggests that the value might change.
ua-cam.com/video/OlGxkWtopIg/v-deo.html
Very informative! I'm a complete n00b, and wanted to make a delay-timer on a fan in a 3D-printed enclousure. This is now far more approachable after watching your video - thank you so much!
It's a really great video, I liked it a lot. It's a bit slow, so it's easily watchable at 1.5x playback speed. Thanks.
This was a very helpful video. I'm new at using an Arduino (Elegoo Starter Kit) and have a great thirst for learning electronics. You really helped me understand more about transistors. Thank You!
ua-cam.com/video/OlGxkWtopIg/v-deo.html
That was perfect.
Thank you so much. I’m headed straight to my workbench yo finish my project.
This is the cleanest and neatest shop that I've ever seen. Wow.
i was just about the say the same thing. shows he is very organized. being organized says a lot about how you think and work. I would trust this man with my electronics or projects.
@@Dimprecator lol lol lol lol lol .. good one .. i knew in my gut i was putting my foot into some dark deep areas lol lol
@@Dimprecator a desk is not the same as a workbench ....
Amazing. In older days we would have to pay for a class of this quality at a private workshop.
Knowledgeable and detailed, great stuff, mate! Thx a lot!
just to share. i`m impressed, after youtube autoload this video while i was making something else, my brain recognize your voice... WOW how long i met you. =) Nice to see you again. Keep safe.
Thanks Bill for the video. It will helps me a lot as a beginner with Arduino. as useal you are very clear in the workshops.
Great video tutorial. Clearly explaining all the things. Thank u so much.
Not even a 1 second is wasted, thanks. Very good video from start to end. Explained what is transistor a general info, and how to use them in curcuit, circuit cables and connections made very clear with drawings. Nice informations and warnings along the video are also nice.
Really cool, straight-forward, clearly and easily explained. This guy makes the world a better place. For some electronics noobs and enthusiasts at least.
I love your videos. I learn a great deal from them. I just wanted to clarify the comments about the diode. Inductive loads resist starting and stopping their current flow. They act kind of like a flywheel. When the circuit tries to stop the motor or coil current suddenly the collapsing magnetic field attempts to keep the current flowing the same direction resulting in a large spike of voltage which can destroy the transistor. The diode allows a backward current to flow around the coil which prevents damage to the circuit.
Well said! It's so much easier to think in terms of current than back emf. Nature won't let the magnetic field collapse in zero time, so we allow the current to continue flowing in the SAME direction through the coil by adding the diode. And the energy stored in the magnetic field gets converted to heat in coil and diode rather than some other unfortunate component.
Hello from India Sir.....thank you very much for creating such informative videos .....your videos and teachings are helping a lot....the way you teach us by doing practical things is the best way to teach....God bless you with good health and happy life....always looking for more from you.
37:04 for anyone doing this for the first time, uncoil these. I learned the hard way LEDs can produce enough heat to cook themselves.
Never thought about that until this very moment.
Good tip!
And there would be a gazillion in there with them all being flat!
Fantastic! Thanks a lot for all your great, inspiring work & tutorials.
I love your channel! You're crazy good at teaching this stuff. Thanks!
Great video, I always learn something from your videos, please keep them coming, thanks
Very informative and consistent detail.
Nice examples in the real use.
thanks! I was searching for this for weeks. I asked people on the internet how to do this but your video finally explains it well. Exactly what I need. I want to switch the christmas lights (4.5 V DC) using an arduino because I am lazy to stand up, go to the switch and use my own fingers to turn it on or off. Now I can control the lights via wifi. :))
ua-cam.com/video/OlGxkWtopIg/v-deo.html
An excellent introductory tour - and for those of us doing mainly digital electronics you cover most of what we need to know about interfacing our puny logic circuits to the power hungry big-boys world of motors, relays, solenoids and lamps.
One quick observation. As you noted, the LEDs on an RGB chain get quite hot. Thus, it's NOT a good idea to operate them on the reel like that for very long as they can get heat damaged and you start to get failures. Each individual LED doesn't generate much heat, but on a reel like that each position contains three LEDs (a red a green and a blue) and over a 5M length you may have a couple of hundred of them. When theyy are spread out its not really noticeable, but when they are reeled up tight together like that they generate quite a lot and if used for long they might overheat and fail.
Great! Your teaching and videos are so wonderful. Knowledgeable and detailed, great stuff, mate! Thanks a lot! Your slow way of speaking makes learning much easier, even for those who don't speak English well, like me. Congratulations!
And you can always set the playback speed to 1.5x otherwise😀
Another great video very well explained and appreciated. One correction though, with the reverse biased diode across the transistor when driving the inductive load, it isn't there for the initial counter emf when the voltage is first applied, rather it is for when the field collapses, as when the applied voltage is reduced. counter emf will resist any initial current flow, the collapsing magnetic field with the inductive load will produce whatever voltage is required to drive enough current to collapse the field. it is this created voltage during the collapsing field that will pop your transistor without the reverse diode in place.
I was wondering about that too. Thanks for setting my world right again.
Thanks a lot for all this work, which becomes a "must watch" for all makers.
I am very grateful for the explanations and suggestions, the truth is that he takes knowledge to the highest level very seriously, thank you very much. Please do not stop with this brilliant way of approaching electronics.
Thank you teacher ! a hug for you from Brazil !
Hey that's a lot easier than I thought it would be. Thanks so much for making these videos!
ua-cam.com/video/OlGxkWtopIg/v-deo.html
Great information and very slick graphics (Presumably many hours with Power Point)
I think your information is a good resource,
Thank you
Thanks for Wonderful workshop in back ground; clear flow of lesson and practical guide
Sure do enjoy the information you present in your videos.
Very good. Just what I need for my project. Thank you. Very well made video
thoroughly enjoyed the fundamentals of electronics :)
By far, the best channel on UA-cam.
Many thanks for your time.
Saw this last weekend. Helpful video
Let me first start by saying that I really hate to criticize this video. Your videos are always very well done, accurate and enjoyable to watch. However, with that being said, I do have to make some corrections and additions.
1. The BJT transistor: You used a darlington transistor, which, depending on the application, could be a good or bad choice. DT’s have a very high gain (Hfe) which allows them to be driven with much lower current, which makes them great for development boards, like the Arduino. However, they also have a much higher collector-to-emitter saturation voltage Vce(sat), which is also dependent on how much current you are drawing through the transistor. In the case of the TIP-120, it can be as high as 4 volts. This means, that if you are using a 12 volt supply, with the transistor in full saturation (fully on), you will only have 8 volts available for your load. The rest gets wasted as heat. If you have to use a DT, you should look for one with a lower Vce(sat), or simply use a pair of separate BJT transistors, to get higher gain and a voltage drop of 0.6 volts, which is typical for standard BJT transistors. DT’s are great, as long as you understand their limitations and design around them.
2. The MOSFET: You should NEVER drive a standard MOSFET, with a gate voltage of 5 volts. They are rated to be driven at 10 volts. If you drive them with less voltage, the drain-to-source resistance Rds(on) will be much higher. In fact, datasheets for standard MOSFETS don’t give any ratings, or performance curves, for being driven at lower than 10 volts. At less than 10 volts, the Rds(on) is unpredictable, at best. Most times, you won’t even drive it into it’s transition state, where it really needs to be. What you *should* be using, is what’s called a “Logic Level” MOSFET. These are designed to be driven at 5 volts. Most of them provide ratings and performance curves, as low as 4 volts. Under-driving a MOSFET and having a high Rds(on), will increase the junction temperature, which raises the Rds(on), which raises the junction temperature, which raises the Rds(on). In other words, they can sometimes start a continuous cycle, affecting each other, until you end up in ‘thermal runaway’. A better choice, with similar ratings, would be the IRL520. Notice, in the part number, that there’s an ‘L’ where the ‘F’ used to be. The ‘L’ denotes that this MOSFET is ‘Logic-Level’. When looking at a MOSFET datasheet, it will typically say if it’s a logic-level MOSFET, right on the front page, under the “Features” header. This is an important specification, which is why they place it so prominently. That’s just one of many parameters that must be considered, when using a MOSFET. There are also thermal characteristics, maximum gate voltages and gate capacitances (which usually only comes into play, when driving the MOSFET at very high frequencies) which have to be considered, when selecting a MOSFET. For the average hobbyist, simply sticking to what other people use, in similar circuits, is the safest and easiest route.
This video was a nice, quick overview of how to use BJT’s and MOSFETS, but it really could have used more work. Like I said earlier, I really hate to criticize one of your videos, but the information you presented, is more than likely to cause a lot of confusion and frustration. I’m not going to say that any of this is easy. I’ve been an EE, for 32 years. My eyes still get blurry, when pouring over datasheets. This is why most engineers have their own “favorite” MOSFETS. We’re familiar with each one and know exactly how they’ll perform. Personally, when I need an N-channel, Logic-Level MOSFET, I typically pull a FQP30N06L out of the bin. It’s inexpensive, reliable and it’s rated at 32 amps/60 volts. It also has a 5 volt Rds(on) of .035 ohms, a built in protection diode and has a fairly low gate capacitance, giving it good high-frequency characteristics. Are there better MOSFETS out there? I’m sure there are, but I’m very familiar with this one and it never lets me down. Unless I have a need for something very specific, or I’m repairing something that needs a specific part, I tend to stick with the ones I know. I do have other favorite ones, but this is my ‘go-to’ MOSFET, for general switching and PWM control. Besides, who wants to stock 50 different numbers? When you have a few favorites, you can buy them in large quantities and save a lot of money. If you’re just working with things like Arduinos, and using smaller loads, the IRL520 is a really good choice. It’s popular, it’s less expensive and it’s another one of my favorites.
Think this video was only supposed to be a general overview,
though I would look forward to any video you might produce on this topic, let me know and I will subscribe.
Guess anyone would be well advised to check the datasheets before launching into a project using any of these components.
Regards
These components are pretty specific, everyone who is not studying in this field or is very passionate about electronics won't even know what all these specifications mean. Imagine telling someone about the collector-emitter current who isn't into electronics😂
Dawid Wilczewski - Imagine that people are here, because the ARE “into it”. Imagine that they aren’t just here to learn WHAT to do, but also want to know WHY they are doing it. If they’ve made the effort to learn, they deserve to have complete and accurate information. If I have the experience, knowledge and ability to help them, they deserve that, as well. Imagine THAT.
ISO Guy - I wish that I was set up to make a video, right now, but I’m in the middle of some projects. If you’re interested, here’s one of the best videos I could find, on the subject of MOSFETS. It will give you the knowledge and confidence to use them, but not bury you with an over abundance of theory. There is a bit math, though, but that’s unavoidable in electronics. Hope it helps! ua-cam.com/video/GrvvkYTW_0k/v-deo.html
If you are so well Informed on this subject than why do you not make a similar video? no use writing a long boring SA here which makes no sense either.
Thank you for such informative well structured lessons. Really do appreciate these lessons!
Thank you so much for sharing this knowledge and well explained and demonstrated.
this is the first video of yours i've seen. subscribed! great channel!
Awesome! I cant stop binging your channel! You have got a fantastic way of doing what you doing!
Идеальный порядок в мастерской,респект!
Such a soothing voice, you actually remind me of my electronics instructor in high school (technical high school).
Lovely jingle and beautiful workshop
That's a top level demonstration / tutorial. Thank you.
Awesome video's my man. Keep it up.
It must be like being a high school electronics teacher but with the added bonus of 1) only reaching students who actually care about the lesson, and 2) not having to put up with the difficult students who hold up the class because they should otherwise jut be breaking rocks somewhere or at a military school - you know the types I mean :)
Great explanation. I like using the 2n3055 transistor on wheel chair motors. Lots of power and using 24 to 36 volts.
This great man, was surely born to be a teacher, thank you by hart
Your great knowldge allied with your calm way in explaining makes almost impossible no to learn. Thank your, Sir!
oh I totally missed this, thanks for sharing
Great presentation as always
That was a very helpful video. I have put off learning that arduino too long. I already have the LED RGB (collecting dust) I will admit the common positive on the strip confused me. Thanks a bunch.
brilliant - I havent seen this type of tutorial before! really great
Exciting and well-put video. Thank you, Sir!!
Thanks for sharing your knowledge!!!
Exactly what I've been looking for, thank you 👍
Very good explantation of how it works. Most interesting.👍🏻