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.