Electronic – Need gate driver for MOSFET (IRF540) and microcontroller

mosfetmosfet-drivernmosstm32f10x

I'm trying to use a STM32F100RBT6B microcontroller to turn on a n-channel MOSFET (IRF540) to switch on a voltage of 24V to an electrical magnet.

I understand I would need a gate driver between the microcontroller and the MOSFET. I know the NMOS Qgs is 10nC at max, so I figured I would need at least 10 mA from the driver to switch it on fast enough (1uS at 10 kHz).

I also know the VoH from the microcontroller for a TTL-port is 2.4V. Does anybody know of a gate driver that would work for this application, and how I would go about to find such a gate driver? (I'm a student still learning about this, so correct me if I'm wrong).

Best Answer

Since you're just switching a magnet, you don't need high speed, or high gate current. However, since your MCU operates on 3.3 volts, you do need some sort of driver to guarantee that your MOSFET gets turned on strongly, and 3.3 volts on an output just won't do that.

For a simple case like this, all you need is a transistor and a few resistors, and

schematic

simulate this circuit – Schematic created using CircuitLab

this will do, as long as you don't mind the fact that the signal is inverted. That is, a high output at the MCU will turn the relay off, not on. Note a few things. R2 and R3, when the transistor is off, set the gate drive at 12 volts. Without the combination, using only R2 would apply a maximum of 24 volts to the gate, and this exceeds the maximum specification. Also, D1 is called a flyback diode, and you should always use one when switching anything with a coil. If you don't, when you turn off the relay you'll get a big voltage spike across it, and you may well kill your transistor. Worse, sometimes it will take multiple operations to kill the transistor, so you think you've got a working circuit, but you can't understand why it's unreliable. The diode should be rated for whatever current the relay coil draws, and have a higher voltage rating than the power supply.

Related Topic