Electronic Basics #23: Transistor (MOSFET) as a Switch


in my previous electronic basics video I showed you that bipolar junction transistors can easily be used as a switch In order to turn on and off your load slowly or even rapidly if you want to for example Dim the brightness of your favorite led efficiently But as soon as I try to control the bigger loads the transistor start to heat up quite a bit Which is mainly due to the energy loss of the collector and emitter path This means our circuits efficiency can still be improved and for that They likely exist another popular and more suitable transistor type these so called Mosfets By creating a similar circuits which can basically do the same as before The Mosfet only as an energy loss of 0.6 watts across as equivalent collector emitter path and thus increases the overall efficiency of the circuits up to 97% Not bad so in this video I will show you at first how easy it is to control such a mosfet with an Arduino And then how difficult it can actually get when you want to use them in more demanding applications Let’s get started There exists two types of Mosfets n-Channel ones and P-Channel ones But more commonly used are n-channel types like this IRLZ44N Which has three pins called gate drain and source which is the equivalent to the base Collector and emitter of a BJT but instead of utilizing Currents that flows through the base of a bJt in order to switch on the loads the mosfet only requires a high enough voltage At the gates no current this voltage needs to be higher than the threshold voltage mentioned in the datasheets But lower than the maximum rated gate source voltage So with the 5 volts of the Arduino we should easily be able to control around 5 amps of current while maintaining the lowest possible drain to source voltage The region we use here in the output Characteristic curves is called the linear region in which the resistance of the drain to source path is almost constant But before going too much into the theory let’s build up the circuits by connecting the source directly to ground the cathode of my LED to the drain and the anode to the supply voltage But one problem that was immediately noticeable was that even electrostatic voltages of my body can turn on the loads Even big ones like this light bulb, so it is always a good idea to place a 10k ohm pulldown resistor between gate and source in order to prevent that and after directly connecting the Pwm signal of the Arduino to the gates the circuit was complete and does work the way it is supposed to so let’s inspect the voltages on the oscilloscope While the Arduino voltage goes high the drain to source voltage goes low and the other way around Perfect and by adding a potentiometer as analog inputs and tweaking the code a bit We just created an led dimmer, but let’s say you are below it that is tied around this time applying 5 volts to the gate of the Mosfet Does very little to nothing because you need to add the voltage of your loads in order to turn on the switch A common way to do this is called bootstrapping for which exists various Ics But a much easier solution would be to use a P-channel mosfets The only difference is that we would need a pull-up resistor instead of a pulldown Because this time +5 volts turn the mosfet off and zero volts turn it on. Now that was the easy part But let’s kick it up a notch by connecting a bigger load Everything still seems to work Just fine But when we have a look at the oscilloscope we can observe a damped oscillation that reaches peaks around 64 volts when the Mosfet switches off and I don’t think he will like that for very long a part of the reason for this oscillation are the parasitic capacities between the terminals of the mosfets Which are much bigger than those of a BJT Power that will be small inductance a big current flow and a rise/full time of 280 Nano seconds and you got yourself problems to find a possible solution, I place the 1.15 Ohm resistor between the gates and Arduino to determine the peak gate current that is flowing Which seems to be around 113mA because when turning on the mosfets it is not only about the voltage at the gates but also about the charge and with a constant gate charge, we can increase the rise and fall time by simply decreasing the gate current and for that we can use a simple resistor for me a 470 Ohm did the trick by decreasing the current Peak to 11mA and thus increasing the rise and fall time which then decreased the oscillation to acceptable values this problem of rise/full time becomes even more complex with higher frequencies Which require way higher gate current to switch the mosfet on and off fast enough otherwise the results might look like this another noticeable aspect is the energy loss at the gates since a certain amount of charge has to move into the gates and afterwards to ground those losses to actually exists But with a low frequency like 490Hz of the arduino. They are almost unnoticeable, but on the other hands with a frequency of 1MHz we have switching losses of 80mW so all in all mosfet driver ICs can make your life easier and If you want more information on how to handle Mosfets properly I put a couple of useful links in the video description I hope you like this video if so don’t forget to like share and subscribe That would be awesome stay creative, and I will see you next time

100 thoughts on “Electronic Basics #23: Transistor (MOSFET) as a Switch

  1. Thank you for your helpful video ?
    I have a question about the efficient formular at 0:30, where do you take the value of voltage 5.15 and 6 V and the current 3.3A from?

  2. I would like to make a led light bar that flashes 16: 1 watt leds, 8 white and 8 red preferably with the ability to flash 4 at a time. I have a arduino that is outputting the signal to my tip120 that is going to switch the 12 volts to the led driver but after watching this video I dont think i am doing it right, what do you recommend?

  3. Hey Great Scott! What does IRF 150 or this numbers on MOSFET signify ? Can you add this info while using any component on your upcoming videos further thanks👍👍

  4. @3:52 you say, with +5 volts you turn the mostfet off and zero volts turn it on, didnt you mean +5 volts turn it on and zero volts turn it off?

  5. If I wanted to turn a PSU on through the green wire and ground using a raspberry pi's GPIO, would it be best to use a mosfet to silently do the switching?

  6. Is it possible to use this to allow arduino to use 10A,20A,30A…to power high speed motors? Or is there a better way?

  7. whenever i put the 10K resistor between gate and source my load wont turn on from a 5v logic signal on gate any suggestions?

  8. Joel is right you should have a million subscribers. I was looking for easy way to control heating, and laser circuit with PSoC 4. your video helps me to solve the problem. thank you.

  9. hello, thanks a lot for a great job. in order to control a load between 1amp to 30amp, what do you suggest to use?

  10. Perfekt👍👍👍
    Wo ist denn das Basic Video über Ampere, Amperestunden und Wattstunden über Batterien und Akkus hinverschwunden??? 🤔🤔🤔🤔
    Lg Danke

  11. yo i am having some problems with my mosfets i did everything you said but when ever i hook a led to it is on even if i have a discharge resistor on it

  12. sir you plees helping my
    am redy to esc circuit home maide but sir is warking but out olteg ok no carent sir wery low carent output
    plees he;lping sir

  13. my fb name ( althu althaf ) profail is saim photose
    am teaching your video happy to waching this video

  14. For deriving the Power loss due to switching, I assume you first calculated the energy by using QV. shouldn't it be 1/2QV ? "time: 5:57" in video. Please clarify.

  15. Amigo se puder me dar uma ajuda aí fico agradecido. E possível ligar um motor brushless com Mosfet canal n? As três fazes seriam n?

  16. you are awesome man i follow all your videos and i like your voice when you say let's get start it !! .please i'm important for electronic circuits and i found this amplifier circuit with two mosfets and ir2110 driver can you explain how it works and how can i found replacement to this driver or increase this circuit .thanks
    the link of circuit : https://goo.gl/images/L8tYKq

  17. Is there anyway to check the continuity of the load (LED in this case) through the MOSFET with an ADC pin without blowing up the arduino with the load voltage?

  18. How do you know so much things about electronics? Pls refer the books and the links to the amazon(if there is an electronic version of the materials)

  19. Hi Greatscott, very nice video as usual. I have a logic level n-channel mosfet(FQP30N06L) and switchin on-off by appliying 0 and 3.3v Vgs from a gpio pin. Drain side I have a load operates at +5V. After the pc turns off, PC pulls up +5V all GPIO pins(Vgs). As a result after pc turns off it turns on the load again. How can I prevent the gate voltage if more than 5V at the logic level mosfet? Best.

  20. Thanks for sharing. Trying to understand why motherboards that can attain higher switching frequencies perform better and generate less heat doing so. And why is there a low and high side mosfet and is it really that expensive to go from a 5.5mOhm mosfet to a 3mO?

  21. As soon as I heard his voice and recognized who it was he got the "thumbs up" Excellent videos all the time from this man!!!!!!!!!!!!!!!!!!!!!!

  22. have you ever thought why do people make comments on your videos like "i dont understand anything but…" or "every video i feel more stupid", this is very common comments on your videos, and i see that because you dont explain in clarity. people who want to study this component click on your video because it says electronic basics, but in your video, you talk like you are talking with somebody who already knows this stuff. you didnt explain how it works fundamentally, you just go through it very quickly and people dont have time to process all the information. the pause button doesnt help because the pause button cannot clarify what you are saying. please consider this feedback honestly, im not insulting you.

  23. Hey dude,, I got much knowledge from your videos , much thankful for that ,, I stuck at chosing mosfets at high frequency , I want to use mosfets at 1 MHz ..!

  24. You mentioned driver ICs for MOSFET(S). Why not show us an example using such a device! However, the video was very informative and gratefully received.

  25. If my LED is already on with the exact same setup as 2:53. (i.e gate not connected to anything) does that suggest my mosfet is fried? It's a IRF530N which should be N channel.

  26. I am trying to control 2wheeler horn with my esp32 through a 12v automotive relay,horn is taking upto 15a of current at 12v.
    THE problem is whenever i send on signal for 350ms by esp32 relay remains on ,it get stuck.What to do?

  27. "Pair that with an small indutance a big current flow a rise/fall time of 280 ns and you got yourself problems " Funny😆😆 right?

  28. Dear Scott.
    I hope you can help me out.
    I am building a 6x6x6 rgb ledcube.
    I want to use a mosfet to switch the ground of the leds.
    So the current wil be between 15 and 540ma
    The leds voltage wil be 5v.
    The arduino to gate wil be 5v 30mA
    Can you help with mosfet to take.
    Thank you in advanced

  29. In what you call the linear region at 2:18 (I prefer to call it triode or ohmic region since there's a lot of confusion with this term), the MOSFET acts as a Vgs controlled resistor, it is not 'like' a constant resistor as I think you suggested, which is actually why the relation between Vds and Id leads to a steep straight line (meaning resistance not constant since R = V/I), as opposed to an horizontal line, which you could actually see when it reaches the saturation region. But I'm not an expert, so I can be wrong. Thanks for the video and all the valuable information you provided.

  30. Ive always kind of hated how the linear region vs saturation seems opposite of BJT linear/saturation concepts when using Mosfets. Its becomes confusing

  31. Ive always kind of hated how the linear region vs saturation seems opposite of BJT linear/saturation concepts when using Mosfets. Its becomes confusing

  32. I learn all the relevant information very quickly from you sir. It feels like you invented electronics! 😂

  33. hello 👋, I need your help scot, I want to built monitoring system, which will on/off water guide. So imagine you have metal roof, u need to turn on water guide when roof temperature reaches for example 40° degrees, and then turn off when it drops to 30° degrees.
    I hope 🙏 u will see this,
    Waiting for u . thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *