Hardware for varying high-power LED

Hello, I want to control the intensity of a high-power LED so it cycles between 20 and 50% with smooth transitions. I want to use 700mA luxeon start led with a driver.
My question if i can use a IRLZ44N MOSFET like the one bellow:
(circuit 2)

Thanks in advance,

Possibly not. A high power led needs a constant-current driver. These drivers may not work correctly if you use PWM to switch on and off either their inputs or their outputs.

If you can find a constant current driver with an enable input, you may be able to feed the PWM signal from and Arduino pin and not need to use any MOSFETs.

1 Like

Look for a "constant current" dimmable LED driver. (It's actually controlled current if it's dimmable.) They are like switch-mode power supplies but designed for constant current instead of constant voltage. It's NOT an easy thing to build yourself.

LEDs (like all diodes) are nonlinear. Their resistance changes with voltage. They are pretty-much the opposite of everything else... You feed then the correct current and the voltage "magically" falls into place. A "normal" power supply or driver tries to hold the voltage constant.

Alternatively, you can use a simple MOSFET driver with "extra" voltage" and resistor to control/limit current, like with a "regular" little LED. LED Resistor Calculator. To work best, you'll probably need at least 18V. And, you'll need a resistor that can handle the power.

A resistor is rarely used for high power LEDs because it's inefficient and related to that, it generates extra heat.

Speaking of heat, "bare" high-power LEDs usually need a heat sink.

1 Like

Thanks for the replies. Not sure this helps but the LED driver is dimmable on the driver with a resistor (image). Thanks again.

See figure 15 in the datasheet.
You can connect that driver directly to any 5V Arduino.
Dim using PWM.

2 Likes

Thank for the feedback. Now i have a silly question that could find a solution. The program works well when I power the arduino with the USB cable. But if use a 9V into the barrel, which i split into the LED driver, the program (fade in/out) does not work. Any suggestions?

The input to the buck need to be at least 2.5V higher than the LED(s) forward voltages(s).
So if you three 3.0V LEDs in series the the input voltage need to be 11.5V.

Also a 9V battery won't be able to supply the current for a 700mA LED.

Thanks, I am using a 9V 2A power adapter. The buck puc drives two luxeon 2.1V LEDs.
Shouldn't this power supply allow the arduino to run the program and the LEDs? Going to 12v is a bad idea right? Added a photo if it helps. Thank you!

Sorry I don't know why I assumed you were using a battery

Yes it should. Are you saying that it does not?

Do you have the USB and 9V to the barrel connected at the same time?

Is there anything in your code that waits for serial input?

Thanks for your patience!
It does not run the script. I remove the USB and plug the barrel.
I'm using the script bellow -sorry, I'm an almost ignorant on the matter

const int ledPin = 9; // PWM-capable pin

const int brightnessLow = 0; // 20% of 255
const int brightnessHigh =30; // 50% of 255

const int fadeStep = 1; // Smaller step = smoother fade
const int fadeDelay = 100; // Delay between fade steps in milliseconds

void setup() {
pinMode(ledPin, OUTPUT);
}

void loop() {
// --- Fade from 50% down to 20% (if starting from high, else this is skipped first cycle)
for (int i = brightnessHigh; i >= brightnessLow; i -= fadeStep) {
analogWrite(ledPin, i);
delay(fadeDelay);
}

// --- Stay at 20% brightness for x milisecond
analogWrite(ledPin, brightnessLow);
delay(500);

// --- Fade from 20% up to 50%
for (int i = brightnessLow; i <= brightnessHigh; i += fadeStep) {
analogWrite(ledPin, i);
delay(fadeDelay);
}

// --- Stay at 50% brightness for x miliseconds
analogWrite(ledPin, brightnessHigh);
delay(500);
}

Are you sure you have the polarity correct on the barrel connector?

Also do you have the LED- connected to the Arduino GND?

Yes. otherwise the arduino would not light up right?...

Yes

The LED are powered by the 9v 2A power supply. The buck puck is connected to the pin -9 and GND...

I can't see anything wrong. 9V at 2A sould be enough power for the Uno and the LEDs.

If you push the reset button does it start working?

Tried the reset and doesn't solve. Maybe another arduino unit ?...but i solved my main issue. I appreciate your help!

Try this code
I added some code to blink the onboard LED.
So after you connect the 9V to the barrel jack, push the reset and the LED should blink 10 times


const int ledPin = 9; // PWM-capable pin

const int brightnessLow = 0; // 20% of 255
const int brightnessHigh = 30; // 50% of 255

const int fadeStep = 1; // Smaller step = smoother fade
const int fadeDelay = 100; // Delay between fade steps in milliseconds

void setup() {
  pinMode(ledPin, OUTPUT);
  pinMode(LED_BUILTIN, OUTPUT);
  
  // Blink the LED
  for (int j = 0; j < 10; j++)
  {
    digitalWrite (LED_BUILTIN, LOW);
    delay (300);
    digitalWrite (LED_BUILTIN, HIGH);
    delay (300);
  }

}

void loop() {
  // --- Fade from 50% down to 20% (if starting from high, else this is skipped first cycle)
  for (int i = brightnessHigh; i >= brightnessLow; i -= fadeStep) {
    analogWrite(ledPin, i);
    delay(fadeDelay);
  }

  // --- Stay at 20% brightness for x milisecond
  analogWrite(ledPin, brightnessLow);
  delay(500);

  // --- Fade from 20% up to 50%
  for (int i = brightnessLow; i <= brightnessHigh; i += fadeStep) {
    analogWrite(ledPin, i);
    delay(fadeDelay);
  }

  // --- Stay at 50% brightness for x miliseconds
  analogWrite(ledPin, brightnessHigh);
  delay(500);
}

uploaded the new code.
it does blink 10 time but the fade in/out is gone when i use the barrel...

With the 9V connected it did blink 10 times?
If yes then that means the code is running and 9V is powering the Uno.

Now I'm real confused as to why the dimming part of the code only works with the USB connected.