Power MOSFETs make great switches in electronic circuits. They are relatively cheap, easy to drive, switch very fast and can be very efficient. If your circuit requirements are not too critical – say switching a relay on and off from a microcontroller GPIO, you don’t need to think too hard. I often use a “jellybean” MOSFET – the BSS138K as it has a 50V, 0.2A rating, an on-resistance of a couple of Ohms and a gate threshold voltage of 1.2V making it suitable for driving from logic levels.
Figure 1 shows just how simple such a circuit can be. Apart from the MOSFET and the relay coil, the only other component required is the flyback diode D1. Resistor R1 will be required to prevent unwanted switching if your microprocessor starts up with the GPIO pins in a high-impedance state (as many do). Generally, this type of circuit “just works”.

Switching a relay from a microcontroller output via a MOSFET is a fairly simple piece of design. It only requires a MOSFET, a diode and (probably) a resistor. Generally, this type of circuit does not require a lot of thought and “just works”. It’s not so simple if you need to switch a load of several amps as this article demonstrates.
If we want to drive something a little more ambitious it pays to know some of the traps that are easy to fall into. Here is one related to the thermal behaviour of MOSFETs. Let’s imagine we want to temperature control a 250W soldering iron. The resistance of the element is around 7Ω, so we need at least 42V across the element to get full power. The current at this point will be about 6A. We will pulse width modulate the MOSFET to regulate the temperature.
This is enough data to get us started. We will choose a 100V, 10A MOSFET to give us a margin of safety. A quick search turns up the IRF530A, which is a steal at about 50 cents apiece. The headline data tells us this has a VDSS of 100V, ID of 14A and RDS(ON) of 0.092Ω.
Rounding RDS(ON) up to 0.1Ω suggests the MOSFET will dissipate about 3.6W at 6A. Figure 2 shows a thermal model of the MOSFET plus a heatsink.

This is the thermal model of the MOSFET plus a heatsink. The total thermal resistance is 16.9°C/W. With 3.6W dissipated and an ambient temperature of 50°C, the junction temperature could rise to 110°C. However, we calculated the dissipation based on the RDS(ON) a junction temperature of 25°C. This design will in fact run-away thermally and destroy the MOSFET as described in the text. This is a trap to avoid!
I’ve selected a typical 25mm high PCB mount heatsink (CUI HSE-B250-04H) with a thermal resistance of 13.6°C/W. The total thermal resistance between junction and ambient is therefore 16.9°C/W. With 3.6W dissipated and an ambient temperature of 50°C, the junction temperature could rise to 110°C, comfortably below the 175°C maximum. So, we are good, right?
— ADVERTISMENT—
—Advertise Here—
Not so fast! Checking the data sheet curve for RDS(ON) vs temperature (Figure 3) shows us that at a junction temperature of 110°C, the RDS(ON) will actually be around 0.17Ω, almost twice that we used earlier. This means our dissipation will be 6.1W, not 3.6W that we assumed before, and therefore our maximum junction temperature will be 153°C. You can probably see where this death spiral is taking us. At 153°C the on-resistance will rise to 0.23Ω and the junction temperature to 189°C, exceeding the 175°C maximum. We have just destroyed our MOSFET.

This graph of RDS(ON) vs junction temperature is taken from the MOSFET data sheet. Note that the “headline” RDS(ON) is at a junction temperature of 25°C. It will be almost twice this value at 125°C. You need to start the design by choosing a junction temperature, use the resulting RDS(ON) to work out power dissipation and design the heatsink accordingly.
Let’s see how this should really be done. We start with a target junction temperature of 125°C. Figure 3 tells us that at this temperature the RDS(ON) will be 0.18Ω and therefore we will have a power dissipation 6.5W. Now we can work out that the heatsink thermal resistance will need to be 11.5°C/W. This is a point of thermal equilibrium – its right on the balancing point of thermal stability. It’s a good idea therefore to choose our heatsink’s thermal resistance to be a bit lower than the equilibrium value to be safe. Fortunately, the HSE-B250-04H has a bigger brother (HSE-B500-04H) which is 50mm high and has a thermal resistance of just over 8°C/W.
A good rule of thumb for MOSFETs is to assume that everything gets worse with temperature. For anything but trivial designs, you should read the data carefully and do the maths – otherwise you could get into trouble.
References
“BSS138K: N-Channel Logic Level Enhancement Mode Field Effect Transistor 50V 0.22A, 1.6Ω.” Accessed April 27, 2022. https://www.onsemi.com/products/discrete-power-modules/mosfets/bss138k.
“IRF530A – Power MOSFET, N Channel, 100 V, 14 A, 0.11 Ohm, TO-220, Through Hole.” Accessed April 27, 2022. https://au.element14.com/on-semiconductor/irf530a/mosfet-n-ch-100v-14a-to-220-3/dp/2563971.
CUI Devices. “Series: HSE-BX-04H-01” https://www.cuidevices.com/product/resource/hse-bx-04h-01.pdf
Sponsor this ArticleAndrew Levido (andrew.levido@gmail.com) earned a bachelor’s degree in Electrical Engineering in Sydney, Australia, in 1986. He worked for several years in R&D for power electronics and telecommunication companies before moving into management roles. Andrew has maintained a hands-on interest in electronics, particularly embedded systems, power electronics, and control theory in his free time. Over the years he has written a number of articles for various electronics publications and occasionally provides consulting services as time allows.