Guide: Properly picking and using MOSFETs!

I often recommend Mosfets over trying to use an SSR in some janky way. Here’s what you’ll need to look out for!

You can support me without spending a single penny!

Choosing the right MOSFETs

Hey everyone, Tom here, and back when i made the “Solid State Relays” video, i got lots of questions on “well, can i use them for 12V DC heated beds, too?” and while there are DC in, DC out solid state relays, in most cases, a simple MosFET is cheaper, smaller and will perform better. So in this video, you’re going to learn about what makes a good MosFET for the typical 3D printing applications like switching a hotend or bed heater and how to wire it up.

So there’s one big difference between how you can use an SSR and a MosFET, and that’s isolation. With an SSR, there can be an electrical potential of a few thousand volts between the switching and the switched voltage, that’s why you can easily use an SSR to switch mains voltage with an Arduino without having to worry about stuff melting down. On the other hand, the way mosFETs are typically used for switching simple loads requires your control signal and your load to share the same ground potential – so if you have two different supplies for them, like a 5V supply for an Arduino and a 12V supply for your load, you’ll need to have the ground lines of those two supplies connected together. If you can’t do that without damaging something, you’ll need an SSR, but typically, you want to have all ground lines connected to protective earth anyways – which means a simple mosFET will work just fine as well.

So there are two main parameters you’ll need to know when choosing a MosFET. One is the voltage your load runs at, and the other is the sustained current you want to switch. To gouge if a specific type of mosfet will be able to handle those, you’ll need its datasheet, in my case, as an example, of a common IRLZ44N, and, yes, a datasheet is big and scary and has lot of information you’ll never need, so i’ll try to break it down as simply as possible. So i’m not going to go for 100% perfect technical accuracy, but for “good enough” for 99% of all applications, even if we’re going to take a shortcut here and there.

Now the shortcut i see a lot of folks taking way too often is simply jumping in and seeing the 55V rating and the 47A right below that and going, well, 47A is way more i’ll ever need, so it’s probably going to be fine, right? Wrong. Because it’s not that simple. All that 47A rating says is that the mosFET will not melt down internally at that current if you can provide infinite cooling. And you probably can’t do that, so if you actually push 47A through this type, it’s going to generate more heat that it can dissipate, overheat and melt down within a few seconds due to the internal losses within the package. And most of the time, that’s going to be your limiting factor. So how do you figure out how much a mosFet can actually take? Use the third value up there, which is the internal resistance of the FET when it’s fully switched on. That’s going to determine how much power you’re going to need to dissipate from the mosfet’s package at a given constant load. And constant, for most electronics without huge heatsinks, is longer than about 10 seconds, which you’re easily going to see in any “heater” application. So the R_DS_on, for this particular type is 0.022 Ohms, 22 milliohm, in a perfect world. However, you’re not going to give this transistor a perfect control signal and there are other factors that degrade this rating as well, so it’s probably not a bad idea to calculate with a 20% to 30% worse value here. Multiply that by the current it will need to switch, squared and you’ll get the thermal power generated in the mosfet, in watts. So for a typical 12V cartridge heater with about 4A, that’s roughly .4W of heat that the IRLZ44N will turn into heat, for a 12A heater PCB, it comes out to 3.8W. Because the current is squared here, having three times the current actually makes for a factor of 9 when it comes to thermal losses. Now, these losses also need to escape the package somehow, and the datasheet also gives you a value for that, which is the thermal resistance, junction-to-ambient if you’re not using a heatsink. If you do have one screwed to the transistor, use its datasheet value for the thermal resistance instead. That value basically tells you how much the package will heat up for each watt of thermal losses, so in this case, without a heatsink, it’s 62°C for each watt. So for the .4W with the heater cartridge, no heatsink and no airflow, it’s going to heat roughly 25°C beyond ambient for a total of 45 to 50°C. With the load from a PCB heated bed, you’d end up with a rise of 236° and a total of almost 250°C. Now don’t get me wrong when i say the mosFET will probably keep working at those temperatures beyond its rated maximum of 175°C, but it’s also probably going to desolder itself or light some stuff one fire. Not cool. In quite a few different way, actually. So in this case you’re either going to need a heatsink or a better mosfet with a lower DC resistance.

Now, the other thing you’ll need to look out for are the necessary drive levels for the Mosfet. The IR*L*Z44N is a logic-level type, which means it should reach the specified on resistance at least when it’s driven from a 5V source, so e.g. any of the common Arduino-based boards. Other boards, like more modern ARM-based ones like the Smoothieboard or Replicape, are 3.3V systems and consequently also only provide roughly 3.3V for driving a mosfet, so watch out for that. You can verify how well a mosfet will do with a specific drive voltage, again, in the datasheet, with the static drain-source-resistance at your specific drive voltage, so e.g. 5V, or, more realistically, 4.5V here. You can see that, with a 5V drive, the guaranteed on resistance already jumped to 25 milliohm compared to the front-page rating of 22, which only applies when you use a full 10V to drive it, and if your drive voltage drops down from the full 5V, the mosfet’s resistance will rise even further. By the way, this is the resistance value you should be using when calculating the losses inside the transistor, hence the 20% “fudge factor”.

If we compare this to the much cheaper IR*F*Z44N, which is not a logic level type, but still used, incorrectly, for that application way too often, we’ll see that it doesn’t even have a rating for a 5V drive. So this guy will waste a lot of power and get really hot if it needs to drive something like a heated bed with a 5V control signal.

So that’s how you can verify if a mosfet is a good choice or not for a specific application. As a good “basic” choice, the IRLZ44N will work fine for any load in the same ballpark as a hotend, the only # slightly more expensive IRF3708 will do a good job even for more demanding loads like a typical heated bed. Or, if you need something a bit more hardcore, grab the IRLR8743, which gives you an even lower on resistance, but is not commonly available in the convenient through-hole packages like TO220.

So, how do you wire it up? I mean, it only has three pins, there’s not much that can go wrong. Typically, those three pins are gate, drain, source. Basically, gate is your control port, drain is where, figuratively, the current will drain into, and source it where it comes pouring out again. For the N-channel type mosfets we’ll be using, when the mosfet is turned off, it will block current from flowing from drain to source, when it’s on, it will allow current to flow through. To turn it on, the gate needs to be at a significantly higher voltage than the drain, and to turn it off, at about the same or lower voltage relative to the drain. The exact levels vary depending on which exact mosfet you choose. So what we are going to and actually pretty much all RepRap control boards are using is called low-side switching, where we’ll disconnect our load from the ground line, so in the on-state, of course we’ll have current flowing through this entire thing, but when we turn it off, because the current can now not flow through the mosfet, the mosfet’s drain will charge up through the load to the voltage level of the supply voltage.

So that’s how it should be wired up: Gate goes to your microcontroller’s output pin, if you want it to be really perfect, you can add a 10 to 100 Ohm resistor in series here, then the drain goes to the negative terminal of your load, while the source goes directly to ground. Also, very important, is a pulldown resistor on the gate, typically somewhere around 10k, you can solder this one directly across the Mosfet’s body and it will protect it from going into an undefined state where the Mosfet will mostly work as a resistor and… burn up. Lastly, the positive terminal of your load goes directly to the supply voltage.

And that’s really all there’s to it. So, again, there are only very few cases where you’ll need a DC-DC solid state relay, and most of the time, a Mosfet is the better and cheaper choice as long as you pick a decent one.

As always, thanks for watching, rate, comment, subscribe.

Music is Tobu – Colors

You can support me without spending a single penny!