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

The Use of Mosfets as Switches: Improving Efficiency and Reducing Energy Loss

In our previous video on electronic basics, we explored the use of bipolar junction transistors (BJTs) as switches. We demonstrated how they can be used to turn on and off loads slowly or rapidly, such as dimming the brightness of an LED efficiently. However, when dealing with larger loads, the transistors tend to heat up significantly due to energy loss in the collector and emitter path. This limits the efficiency of our circuits.

To improve circuit efficiency and reduce energy loss, we can use MOSFETs (Metal-Oxide-Semiconductor Field-Effect Transistors) instead of BJTs. Mosfets have several advantages over BJTs, including a much lower energy loss across their collector-emitter path. This results in an overall efficiency increase up to 97%, which is not bad considering the simplicity of using these devices.

In this video, we will explore how easy it is to control a MOSFet with an Arduino and then discuss the challenges that arise when using them in more demanding applications. There are two types of Mosfets: n-Channel and P-Channel. More commonly used are n-channel types like the IRLZ44N, which has three pins called gate, drain, and source. The gate is equivalent to the base of a BJT, but instead of using currents that flow through the base to switch on loads, Mosfets only require a high enough voltage at their gates.

To control the MOSFet, we need to ensure that the voltage applied to its gate is higher than the threshold voltage mentioned in the datasheet but lower than the maximum rated gate-source voltage. With 5 volts from the Arduino, we can easily control around 5 amps of current while maintaining the lowest possible drain-to-source voltage. The region we use here is called the linear region, where the resistance of the drain-to-source path is almost constant.

Before diving into the theory, let's build up the circuits by connecting the source directly to ground and attaching the cathode of my LED to the drain and the anode to the supply voltage. However, we immediately notice a problem – even electrostatic voltages from our body can turn on the loads, including big ones like this light bulb. To prevent this, it's always a good idea to place a 10k ohm pull-down resistor between the gate and source.

After connecting the PWM signal of the Arduino directly to the gates, the circuit is complete, and it works as intended. We can inspect the voltages on the oscilloscope while the Arduino voltage goes high, the drain-to-source voltage goes low, and vice versa. By adding a potentiometer as analog inputs and tweaking the code, we've created an LED dimmer. Now, let's say you're below that level – applying 5 volts to the gate of the MosFet does very little to nothing because you need to add the voltage of your loads to turn on the switch.

A common way to do this is called bootstrapping, which involves using various ICs, but a much easier solution would be to use a P-Channel MOSFet. The only difference is that we would need a pull-up resistor instead of a pulldown because +5 volts turn the Mosfet off, and zero volts turn it on.

Now that we've mastered the easy part, let's kick it up a notch by connecting a bigger load. Everything still seems to work just fine, but when we look at the oscilloscope, we can observe damped oscillations reaching peaks around 64 volts when the MosFet switches off. This is partly due to parasitic capacities between the terminals of the Mosfets, which are much bigger than those of BJTs.

The problem arises because of small inductance, big current flow, and a rise/fall time of 280 nanoseconds. To find a possible solution, we place a 1.15 ohm resistor between the gates and Arduino to determine the peak gate current flowing, which is around 113 mA. This helps us understand the challenges that come with using Mosfets.

With low frequencies like 490 Hz from the Arduino, the switching losses are almost negligible. However, at higher frequencies like 1 MHz, we have switching losses of 80 mW. All in all, MOSFET driver ICs can make your life easier, but it's essential to handle Mosfets properly.

For more information on how to handle Mosfets correctly, I've put a couple of useful links in the video description. If you like this video, don't forget to like, share, and subscribe – that would be awesome. Stay creative, and I'll see you next time.

WEBVTTKind: captionsLanguage: enin my previous electronic basics videoI showed you that bipolar junction transistors can easily be used as a switchIn order to turn on and off your load slowly or even rapidly if you want to for exampleDim the brightness of your favorite led efficientlyBut as soon as I try to control the bigger loads the transistor start to heat up quite a bitWhich is mainly due to the energy loss of the collector and emitter pathThis means our circuits efficiency can still be improved and for thatThey likely exist another popular and more suitable transistor type these so called MosfetsBy creating a similar circuits which can basically do the same as beforeThe Mosfet only as an energy loss of 0.6 watts across as equivalent collector emitter pathand thus increases the overall efficiency of the circuits up to 97%Not badso in this videoI will show you at first how easy it is to control such a mosfet with an ArduinoAnd then how difficult it can actually get when you want to use them in more demanding applicationsLet's get startedThere exists two types of Mosfets n-Channel ones and P-Channel onesBut more commonly used are n-channel types like this IRLZ44NWhich has three pins called gate drain and source which is the equivalent to the base Collector and emitter of a BJTbut instead of utilizingCurrents that flows through the base of a bJt in order to switch on the loads the mosfet only requires a high enough voltageAt the gates no current this voltage needs to be higher than the threshold voltage mentioned in the datasheetsBut lower than the maximum rated gate source voltageSo with the 5 volts of the Arduino we should easily be able to control around 5 amps of currentwhile maintaining the lowest possible drain to source voltageThe region we use here in the outputCharacteristic curves is called the linear region in which the resistance of the drain to source path is almost constantBut before going too much into the theory let's build up the circuits by connecting the source directly to groundthe cathode of my LED to the drain and the anode to the supply voltageBut one problem that was immediately noticeable was that even electrostatic voltages of my body can turn on the loadsEven big ones like this light bulb, so it is always a good idea to place a 10k ohmpulldown resistor between gate and source in order to prevent thatand after directly connecting the Pwm signal of the Arduino to the gates the circuit was completeand does work the way it is supposed to so let's inspect the voltages on the oscilloscopeWhile the Arduino voltage goes high the drain to source voltage goes low and the other way aroundPerfect and by adding a potentiometer as analog inputs and tweaking the code a bitWe just created an led dimmer, but let's say you are below it that is tied aroundthis time applying 5 volts to the gate of the MosfetDoes very little to nothing because you need to add the voltage of your loads in order to turn on the switchA common way to do this is called bootstrapping for which exists various IcsBut a much easier solution would be to use a P-channel mosfetsThe only difference is that we would need a pull-up resistor instead of a pulldownBecause this time +5 volts turn the mosfet off and zero volts turn it on. Now that was the easy partBut let's kick it up a notch by connecting a bigger loadEverything still seems to workJust fineBut when we have a look at the oscilloscope we can observe a damped oscillation that reaches peaks around64 volts when the Mosfet switches off and I don't think he will like that for very longa part of the reason for this oscillation are the parasitic capacities between the terminals of the mosfetsWhich are much bigger than those of a BJTPower that will be small inductance a big current flow and a rise/full time of280 Nano seconds and you got yourself problems to find a possible solution, I place the1.15 Ohm resistor between the gates and Arduino to determine the peak gate current that is flowingWhich seems to be around113mA because when turning on the mosfets it is not only about the voltage at the gatesbut also about the charge andwith a constant gate charge, we can increase the rise and fall time by simply decreasing the gate current and for thatwe can use a simple resistor for me a470 Ohm did the trick by decreasing the current Peak to 11mAand thus increasing the rise and fall time which then decreased the oscillation to acceptable valuesthis problem of rise/full time becomes even more complex with higher frequenciesWhich require way higher gate current to switch the mosfet on and off fast enough otherwise the results might look like thisanother noticeable aspect is the energy loss at the gates since a certain amount of charge has to move into the gates andafterwards to ground those losses to actually existsBut with a low frequency like 490Hz of the arduino. They are almostunnoticeable, but on the other hands with a frequency of 1MHzwe have switching losses of 80mW so all in all mosfet driver ICs can make your life easier andIf you want more information on how to handle Mosfets properly I put a couple of useful links in the video descriptionI hope you like this video if so don't forget to like share and subscribeThat would be awesome stay creative, and I will see you next time