1
\$\begingroup\$

I am searching for the right MOSFET that:

  • Can control a high power LED strip of either 12 V or 24 V.

  • Must be a through hole component (because I intend to solder everything by hand).

  • Should be controllable off of 3.3 V GPIO (I'll use a Wemos D1 mini, and not an Arduino).

I found out a few candidates on this forum already, but I am afraid of running them with 3.3 V only on the gate:

  • IRL540 with an RDS(on) of 0.11 Ω with Vgs = 4 V (which means I'll get even more resistance out of 3.3 V)

  • RFP30N06LE designed for slightly lower Vdss (but largely fills my 24 V requirements). There is no Rds(on) specified with a Vgs lower than 5 V.

Considering one channel only for now, I came up with the following diagram:

enter image description here

  • How do I compute R2's value to avoid ringing and should I place it before or after the pull-down resistor? The discussion on Sizing MOSFET gate resistor was not really clear on the subject about it forming a voltage divider.

  • Is the transistor pertinent to drive the MOSFET with 5 V in order to have a lower Rds(on) resistance, or can I get away controlling the MOSFET directly from 3.3 V?

  • Is there anything I missed or that I forgot to take into account? I am fairly new to electrical engineering so there are a lot of concepts that I am not aware of. I always try to document myself before posting a question, but we never know.

\$\endgroup\$
2
  • \$\begingroup\$ Welcome! Not what you asked but you will be doing yourself a favor by learning to solder SMD. Though-hole is going away. \$\endgroup\$
    – winny
    Commented Aug 15, 2023 at 7:06
  • \$\begingroup\$ @winny ahah, yeah I should invest in some toolings for that. For now it's only the start of my new hobby and through-hole is easier to prototype with (in my opinion). I am too often using daughter board with 2.4mm connection, so that is why I am so into through-hole. I whish I had the electrical skills to design entiere SMD PCB ! \$\endgroup\$ Commented Aug 17, 2023 at 15:44

2 Answers 2

1
\$\begingroup\$

The MOSFET RFP30N06LE you mentioned has \$V_{GS(TH)} < 2V\$, and can be interfaced with the 3.3V digital signal (almost) directly. Even though the datasheet may not explicitly specify \$R_{DS(ON)}\$, you can infer it from graphs of \$V_{DS}\$ vs. \$I_D\$. From the RFP30N06LE datasheet, figure 7 tells you what you need to know:

enter image description here

While these graphs are only typical behaviour (not worst case), they are good enough to show that if you intend to pass, say, 2A of current through your LEDs, \$V_{DS}\$ is well under 0.5V, probably closer to 0.1V. This implies a power dissipation in the MOSFET of \$0.1V \times 2A = 200mW\$ which will barely heat it at all, but you should be aware that the chief cause of increasing \$R_{DS(ON)}\$ is temperature.

For this reason, with a constant current load, you may experience thermal runaway, and should ensure that the device is operating in its "DC Safe Operating Area" shown in figure 4. Of course, a heatsink can always help.

You can do this:

schematic

simulate this circuit – Schematic created using CircuitLab

R1 is chosen to limit gate current while charging and discharging gate capacitance, keeping it under the maximum available from the MCU output. Here that current won't be more than about \$I_G=\frac{3.3V}{470\Omega} = 7mA\$. Choose R1 to suit your MCU's output current capability, according to \$R_1 = \frac{3.3V}{I_{MAX}}\$.

With R1 in place, switching speed is somewhat diminished, and miller effects will also slow down switching. At a guess I'd say you're looking at a couple of microseconds for the MOSFET to switch on and off. For lighting PWM that's probably fine, but if it's not fast enough, then you'll probably need a proper gate driver. Your own circuit is not appropriate, as I'll address below.

R1 also provides some protection for the microcontroller against miller effects, which could conceivably raise gate potential beyond +3.3V (or below 0V), but for extra protection I recommend D1. It keeps gate potential within reasonable bounds, and provides an alternative path for miller current other than the fragile MCU output.

R2 keeps MOSFET M1 (and its load) switched off while the MCU output is high impedance, prior to being configured as a PWM output.


Regarding your proposed circuit, you are operating TRANSISTOR1 as an emitter follower. Its emitter is always 0.7V below the base, so you won't ever have more than 3.3V-0.7V=+2.6V at MOSFET1's gate. That's even worse than just connecting the gate directly to the GPIO pin.

If you want a gate potential of +5V or 0V, then you must configure TRANSISTOR1 as common-emitter, and you must also rename it to Q1, so I don't have to type so much. This kind of thing:

schematic

simulate this circuit

This has potential problems:

  • Q1 is on when Q2 (and the load) is off, so the PWM signal is inverted.

  • Even with the LEDs off (Q1 is on), there is \$\frac{5V}{R_3}=5mA\$ flowing via Q1.

I don't recommend doing it this way.


For high side switching, a common-emitter NPN BJT and P-channel MOSFET can be used:

schematic

simulate this circuit

This uses R3 and R4 to limit how far gate potential can fall (to about +16V here, for \$V_{GS}\approx 8V\$), ensuring that \$V_{GS(MAX)}\$ is never exceeded. The load is powered when Q1 is on, so there's no signal inversion, and no collector current in Q1 when the load is off. Also, gate charge current is sourced from the +24V supply, offloading the hard work from the MCU to Q1. Since we have a much larger \$V_{GS}\$, MOSFET choice is much less constrained.

\$\endgroup\$
4
  • \$\begingroup\$ Thank you so much for your amazingly detailed answer ! I don't understand how I missed the graph of the datasheet, that will be a lesson for me. If I read the datasheet's figure 4 correctly, that would give me 5A for 20V, which is perfect for what I want (thanks for bringing this figure to my attention). \$\endgroup\$ Commented Aug 17, 2023 at 15:38
  • \$\begingroup\$ For D1, should I pick 3.6V since I think the GPIO would be safe between 3.3 and 3.6? \$\endgroup\$ Commented Aug 17, 2023 at 15:40
  • \$\begingroup\$ Thank you also for the proposed circuit with Q1 ! I han't thought of it ! Really thank you for your time, I really appreciate it. \$\endgroup\$ Commented Aug 17, 2023 at 15:41
  • \$\begingroup\$ @MarcoBresson You're welcome! I also debated with myself about D1, even if it's necessary at all. 3.6V would reduce current drawn from the GPIO by a milliamp or so, and would still offer protection, so yes, 3.6V seems OK \$\endgroup\$ Commented Aug 18, 2023 at 1:48
0
\$\begingroup\$
  • R2 is likely to cause more problems than it would solve. I would get rid of it, but see the next point...
  • The emitter of the BJT won't go above about 2.7 V. If it did, the base-emitter junction would be reverse biased and the transistor would be off.
  • Look into opto-isolators/solid-state relays. You should have no trouble finding one that is through-hole and can work with 3.3 V and a single resistor. EXAMPLE There are also gate driver ICs for MOSFETs that can work off 3.3 V logic. These often provide their won charge-pump so you don't even need to provide the 5 V (or whatever) yourself.

If you can't invert the PWM logic, you just need to add an extra transistor. Something like this could work:

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$
8
  • \$\begingroup\$ Sorry, I have no idea where the part number of the transistor come from, could it be replaced with another mosfet with 3.3Vgs? I am under the impression that they tend to be cheaper than opto-isolators. What issues would R2 bring? I am curious as I saw other posts mentioning the beter practice of using it. Thank you :) \$\endgroup\$ Commented Aug 14, 2023 at 14:39
  • \$\begingroup\$ It is a feature of all BJT transistors that the base must be a higher voltage than what you want the emitter at or it will be "off". You are attempting "high-side switching" with an NPN. If you want to use an NPN look into low-side switching. \$\endgroup\$ Commented Aug 14, 2023 at 14:46
  • \$\begingroup\$ Replacing the BJT with a MOSFET would work, but again, you will need to do low-side switching because it is the base to emitter (or gate to source) voltage that matters when using transistors. \$\endgroup\$ Commented Aug 14, 2023 at 14:47
  • \$\begingroup\$ The opto isolator I used as an example is under $1 US, it is up to you to decide what is too expensive. Gate drivers will be much more. \$\endgroup\$ Commented Aug 14, 2023 at 14:47
  • 1
    \$\begingroup\$ The two solutions I see now is using the opto-isolators/solid relays solution you mentioned (but with 6 channels, the price can quickly add up to 10€), or to stick to 12V and finding a MOSFET that nicely accept 3.3V betwwen gate and source \$\endgroup\$ Commented Aug 14, 2023 at 16:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.