Choosing appropriate MOSFET

Hello everyone!

For a project, I'm using Arduino and MOSFET to control a set of high power LED diodes (current control, 1A, ~45V) with PWM (100kHz+, variable Duty Cycle).

Used components:

Simple scheme of circuit is attached to the post. I also have resistor between Arduino and MOSFET gate for Arduino protection. I also consider adding a resistor to connect Gate and Source to reduce VGS faster when switching to 'OFF' state.

When I was buying a n-channel MOSFET, I focused on low Gate-Source Voltage - VGS(TH) below 3.3V, fast switching characteristics and Safe Operating Area - ID=1A, VDS=45V below 'DC line' (Figure 11 in datasheet). Since I don't have single pulse signal only, I wanted to be in safe 'DC' area.

I soon realised that the actual rise and fall times of MOSFET are huge (up to 300 microseconds) compared to those in datasheet (up to 100 nanoseconds). Switching characteristics in datasheet were measured at much higher load (VDD=80V, ID=23A, VGS=4.5V), but I can't find any information if this is the reason for such a big difference in switching speed.

When looking at Safe Operating Area, I used total voltage drop (VDD - 0V= ~45V) at ID=1A. Did I make a mistake when buying a MOSFET and choosing much more powerful one than needed?

I know MOSFET is not exactly like ON/OFF switch, but I learned 2 things:

  • VDS is equal to VDD in 'OFF' state, while there is very small Drain-to-Source current leakage.
  • VDS is much lower than VDD in 'ON' state . Based on MOSFET datasheet, VDS at ID=1A and VGS=3.3V is below 0.5V (Figure 1 in datasheet).

Couple of days ago, I got an idea. I'm not an expert in electronics, so this idea might be totally wrong, since I couldn't find any information that says it's correct (or wrong). Should I use VDS in 'ON' state (instead of VDD as mentioned above) and VDD in 'OFF' state when looking at Safe Operating Area to determine whether a MOSFET is appropriate for my project or not?

Thank you very much for your time!

scheme.png

You need some regulation to keep current through the LED constant.
This is normally done with a switching constant current LED driver, to minimise losses (heat).

Seems a bad idea to use a (PWM-ed) mosfet for a 45watt LED.
Post a link to that LED, and the supply you will be using.

Why do you think you need to PWM a LED with 100kHz.
Try to calculate the pulse width if you're set 8-bit PWM to 1 or 254.
200Hz-1000Hz PWM should be more than enough.
Leo..

Are you using an Arduino (which one?) or the Lolin32 for this?

In general it's a good idea to connect a resistor between source and drain (10k typically), and one between MOSFET and MCU pin (100-1000Ω). Assuming you set your pin D13 to OUTPUT, LOW you should drain the gate charge and switch off the MOSFET really fast, not taking 300 µs. Nonetheless 100 kHz is a pretty high frequency, so you may have to lower the value of the resistor between output pin and gate, keeping the current limit of the pin in mind.

Also indeed it may mess with your constant current control. Lower PWM frequency may work better, try it out.

Thank you for both answers!

Wawa:
You need some regulation to keep current through the LED constant.
This is normally done with a switching constant current LED driver, to minimise losses (heat).

Seems a bad idea to use a (PWM-ed) mosfet for a 45watt LED.
Post a link to that LED, and the supply you will be using.

Why do you think you need to PWM a LED with 100kHz.
Try to calculate the pulse width if you're set 8-bit PWM to 1 or 254.
200Hz-1000Hz PWM should be more than enough.
Leo..

UPDATE on used components:

I am trying to simulate harmonic blinking (sine wave) of LEDs in range from 0Hz to 1kHz with PWM. Program calculates ON and OFF times for all pulses in PWM, then using digitalWrite() and delayMicroseconds() for switching.

If I set PWM frequency at 50x sine wave frequency (up to 50kHz) for precise simulation, and limiting Duty Cycle between 10% and 90% - sine wave offset 0.5, amplitude 0.4; fastest switching will be done 10x faster than PWM frequency. So the fastest switching goes far above 100kHz.

wvmarle:
Are you using an Arduino (which one?) or the Lolin32 for this?

In general it's a good idea to connect a resistor between source and drain (10k typically), and one between MOSFET and MCU pin (100-1000Ω). Assuming you set your pin D13 to OUTPUT, LOW you should drain the gate charge and switch off the MOSFET really fast, not taking 300 µs. Nonetheless 100 kHz is a pretty high frequency, so you may have to lower the value of the resistor between output pin and gate, keeping the current limit of the pin in mind.

Also indeed it may mess with your constant current control. Lower PWM frequency may work better, try it out.

I am using Wemos Lolin32. Sorry, my mistake for mentioning both.

May I ask why is resistor between Drain and Source (10k as you mentioned) a good idea? I can't find any circuit or info about resistors between Drain and Source. I can only imagine it as a bypass, but can't think of any advantages. Thank you for the answer!

I am currently trying at PWM frequencies no higher than 2kHz, because pulses in PWM with Duty cycle near 0% and 100% need very fast switching (explained in 1st part of this reply), and circuit can't respond that fast (MOSFET and/or LEDs). I will partially avoid this problem with limiting Duty cycle between 10% and 90%.

I have resistor between MOSFET and output pin at the moment, but even if I remove it, there is still ~100microseconds rise time and ~300 microseconds fall time when using oscilloscope and photodiode to detect light from LEDs. I could add resistor between Gate and Source to reduce fall time (I already have intention to do that).

While everything works well (very small distortion in output signal - light) at lower frequencies of sine wave (<100Hz), ON and OFF states in PWM at higher frequencies are too short for current switching speeds - output signal is distorted. I hope I will be able to simulate sine wave up to 1kHz with PWM.

Thank you!

blay1:
May I ask why is resistor between Drain and Source (10k as you mentioned) a good idea?

It ensures the MOSFET is off while your Lolin starts up (and the pins are still set to INPUT).

I have resistor between MOSFET and output pin at the moment, but even if I remove it, there is still ~100microseconds rise time and ~300 microseconds fall time when using oscilloscope and photodiode to detect light from LEDs. I could add resistor between Gate and Source to reduce fall time (I already have intention to do that).

It sounds like you're measuring the reaction time of the whole system, rather than just the MOSFET. Connect your scope to the MOSFET gate and drain to see the actual reaction time of the MOSFET. So one channel to the gate (or the pin), the other to the drain, and connect the ground. You should see a 0/5V signal on the gate, and a 0/12V signal on the drain. Then you can really see how fast the MOSFET switches.

Those COB LEDs definately need current limiting.
LED Vf could vary several volts with <=12watt of heat on a 35mm disc.

I hope your lab supply's current limiting is fast enough for that when you PWM.
You normally use someting like a "meanwell LDD-700H" to PWM these LEDs.
But that also might not be fast enough for what you're trying to do.

This is a good example of a mosfet drive circuit (first diagram).
I think you should keep switching currents of a 3.3volt processor at ~7mA (330ohm gate resistor).
(5volt processors are much better for driving mosfets).
Better to have the 10k bleed resistor on the processor side, to minimise voltdrop from a voltage divider.
Leo..

Nick's diagram:

Note that the 10k resistor does not go between gate and source, but between the Arduino output pin and ground, before the series resistor to the gate. If you connect it at the MOSFET gate, it forms a voltage divider with that series resistor which even if only a tiny bit, reduces the drive voltage to the gate, something you clearly do not want. It may not matter a great deal with these particular values, but it is simply proper design discipline in case you happened to use other values.

The explanation is that the 10k resistor is simply to set the logic state to LOW before the Arduino code initialises the pin and sets it to OUTPUT. The problem it addresses is at the Arduino, not at the FET so it should be placed at the Arduino, not at the FET. :grinning:

blay1:
I soon realised that the actual rise and fall times of MOSFET are huge (up to 300 microseconds) compared to those in datasheet (up to 100 nanoseconds). Switching characteristics in datasheet were measured at much higher load (VDD=80V, ID=23A, VGS=4.5V), but I can't find any information if this is the reason for such a big difference in switching speed.

To switch a big MOSFET at its full speed you usually use around 1A of gate drive to charge the gate
capacitance fast enough - that means using a MOSFET gate driver chip, not some large resistors.

100kHz is pushing everything, thats one transition every 5000ns, so high power gate driver is
a hard requirement.

wvmarle:
It sounds like you're measuring the reaction time of the whole system, rather than just the MOSFET. Connect your scope to the MOSFET gate and drain to see the actual reaction time of the MOSFET. So one channel to the gate (or the pin), the other to the drain, and connect the ground. You should see a 0/5V signal on the gate, and a 0/12V signal on the drain. Then you can really see how fast the MOSFET switches.

Will do that, thank you.

Wawa:
This is a good example of a mosfet drive circuit (first diagram).
I think you should keep switching currents of a 3.3volt processor at ~7mA (330ohm gate resistor).
(5volt processors are much better for driving mosfets).
Better to have the 10k bleed resistor on the processor side, to minimise voltdrop from a voltage divider.
Leo..

Paul__B:
Note that the 10k resistor does not go between source and drain, but between the Arduino output pin and ground, before the series resistor to the gate. If you connect it at the MOSFET gate, it forms a voltage divider with that series resistor which even if only a tiny bit, reduces the drive voltage to the gate, something you clearly do not want.

The explanation is that the 10k resistor is simply to set the logic state to LOW before the Arduino code initialises the pin and sets it to OUTPUT. The problem it addresses is at the Arduino, not at the FET so it should be placed at the Arduino, not at the FET. :grinning:

Thanks for the advise!

MarkT:
To switch a big MOSFET at its full speed you usually use around 1A of gate drive to charge the gate
capacitance fast enough - that means using a MOSFET gate driver chip, not some large resistors.

100kHz is pushing everything, thats one transition every 5000ns, so high power gate driver is
a hard requirement.

Hmm, didn't think about that :/. Thank you! So I need driver (like this one) to get for example 10V 1A output to the MOSFET gate for faster switching?

Paul__B:
Note that the 10k resistor does not go between source and drain, but between the Arduino output pin and ground, before the series resistor to the gate. If you connect it at the MOSFET gate, it forms a voltage divider with that series resistor which even if only a tiny bit, reduces the drive voltage to the gate, something you clearly do not want.

You mean between gate and source, not source and drain.

And I hear this myth a lot:

It doesn't matter whether the 10k is before or after the current limiting resistor, the gate drive voltage
will be completely fine - a 70mV reduction in gate drive is utterly irrelevant for a 5V logic level MOSFET
(which are usually guaranteed down to 4.5V across all devices and all temperatures).

And you can use 100k if you like, making it even more academic.

Or put another way if the order of the resistor matters, your circuit is poorly engineered in the first place
with no safety margin or leeway to allow for component tolerances and thermal drift.

You could argue that the 10k resistor should be across the gate/source directly so that there is less chance of the
MOSFET gate floating should the current limit 150 ohm resistor become detached/open.

However yes, it is forming a potential divider, and you should always be aware of the voltage reduction
and determine if its an issue (which here with 10k and 150 ohm resistors it is not).

Based on suggestions, I did some adjustments to the circuit:

  • adding 330 ohm resistor between microcontroller output pin and MOSFET gate.
  • adding 10k ohm resistor between gate and source. As MarkT wrote, potential divider is not a problem in this case. I tried putting in on microcontroller side, and I didn't see any visible difference in MOSFET response.

wvmarle:
It sounds like you're measuring the reaction time of the whole system, rather than just the MOSFET. Connect your scope to the MOSFET gate and drain to see the actual reaction time of the MOSFET. So one channel to the gate (or the pin), the other to the drain, and connect the ground.

First, I measured rise and fall times of MOSFET with small load - 470 ohm resistor between 5V microcontroller pin and drain, then doing the same with LEDs (total 1A, ~45V); both schemes are attached. Even with low (3.3V, 10mA) microcontroller output signal, MOSFET turn on/off time in both cases is less than 10 microseconds (based on VDS), being slightly bigger with LEDs, I guess it's because of higher load.

The main problem is in LEDs. Detecting light with photodiode, LEDs need ~50 microseconds to go from 0% to 100%, and ~300 microseconds from 100% to 0%.

I guess I need faster power LEDs :slightly_frowning_face:; or is there any chance to lower LEDs rise/fall times with additional components?

About MOSFET driver; I will definitely consider getting it when I get faster LEDs.

Thanks again for helping me, I have learned a lot!

scheme LEDs.png

scheme resistor.png

Why do you need such a high PWM base frequency? The eye can't detect appreciable flicker above about a couple of hundred Hz .

So unless you're designing some arcane signalling system the normal arduino pwm base of a bit under 500Hz will be perfectly adequate, and will make MOSFET switching losses far lower than your ( specious?) 100kHz spec.

Allan

There are definitely much faster LEDs out there - such as the ones that produce the pulses for fibre optics.

But indeed more and more wondering what you're trying to do here, really. It starts to sound like an XY problem.

Main goal is to get precise harmonic blinking (sine wave) using PWM. Blinking is used as a light source when capturing images/video with cameras.

you're suggesting a 100 kHz frame rate or what? That's a mighty fast camera.

Even so, what's the advantage of blinking an LED (plus the effort of keeping it perfectly in sync with the camera's frame capturing)? It doesn't make sense to me. Some time ago I pointed my phone camera at an LED display, gave really interesting effects, as I could suddenly see the multiplexing of the LEDs in action. The camera would shown only single lines of the display while my eye saw the complete wording... Just keeping the lights on should be a much easier solution.

I don't want to go too much into details, because the method I am using is from Mechanical Engineering. This method demands harmonic blinking (sine wave) of light source when capturing images. Exposure time of camera sensor can be much larger than just one period of sine wave. While method works with analogue light source control, I'm trying to replace analogue with PWM.

That sine wave is supposed to be at 100 kHz? Or lower frequency? Continuous series of pulses or just a single wave for the light?

And am I correct that this light source is supposed to fade in and out, changing its brightness as a sine pattern?

A sort of strobe?

You could try the tone() function for choosing various frequencies... but fixed 50% duty cycle and only up to 30kHz..

What range do you need? - a suitable VCO based on eg a CD4046 might be useful. Or for really wide range a AD654.

If synchronizing with mechanical stuff - eg something rotating, a suitable pick-up and a divider chain and phase comparator would give a phase locked loop synchronous with the rotating bit.

And , of course, you'd still need suitable mosfets and high-current gate drivers.

Allan

wvmarle:
That sine wave is supposed to be at 100 kHz? Or lower frequency? Continuous series of pulses or just a single wave for the light?

At the moment, I would like to get sine wave up to 1kHz, continuous signal (for example, 100 sine periods). If I get for example 50 pulses per 1 sine wave with variable Duty cycle lets say between 10% and 90%, PWM frequency will be 50kHz, with fastest switching done 10x faster than PWM pulse period.

wvmarle:
And am I correct that this light source is supposed to fade in and out, changing its brightness as a sine pattern?

If I used analogue control, yes (something like this), but since LEDs dont have linear relative flux-current characteristic, I'm modulating sine pattern with PWM (LEDs fully turning on/off) to avoid distortions in brightness pattern.

Like I said before, with PWM, method works well at lower frequencies, problem is at high frequencies, when LEDs I currently use can't fully turn on/off before next switch - making distortions in sine pattern. I used photodiode to detect light and filtered the signal on oscilloscope; while areas of maximum slope in sine wave were looking great, maximums and minimums were almost flat/constant.

allanhurst:
A sort of strobe?

You could say its a strobe, with a sine wave pattern.

allanhurst:
What range do you need? - a suitable VCO based on eg a CD4046 might be useful. Or for really wide range a AD654.

If synchronizing with mechanical stuff - eg something rotating, a suitable pick-up and a divider chain and phase comparator would give a phase locked loop synchronous with the rotating bit.

And , of course, you'd still need suitable mosfets and high-current gate drivers.

Allan

Okay, I'll look both VCOs (though getting a bit lost here :slight_smile: ). I am trying to make the circuit as simple as possible. Getting faster LEDs (and high current gate driver if needed) will be more than enough for current goals.

Presumably this is for some sort of test/research project , where efficiency doesn't really matter.

Using a photodiode with suitable transconductance amplifier ( NS, now TI have excellent photodiode application notes) would allow you to drive the system with an accurate variable frequency/amplitude sinewave in a feedback loop to give an accurate sinewave light output.

You ought to achieve < 0.1% distortion fairly easily at 1kHz or so.

PWM just adds complication and inaccuracy. Buy some heatsinks!

But I'm curious as to why an accurate light sinewave is useful. Comments?

Allan