Hi All.
I am trying to get my RGBW LED to light up for half a second at its brightest.
I am only interested in turning on the Red LED for now.
I am using PWM from an Arduino NANO so that the threshold voltage of the MOSFET is exceeded and in turn current passes through the LED.
The specs for the Red LED are Forward Voltage ( @ 350mA ) 2.6 V max.
The LED is powered with a benchtop power supply set at 2.6V and 950mA.
This is what my hardware in conjunction with the code was supposed to do:
When the user enters a value, between 1 and 255, the LED turns on with the corresponding brightness.
A value of 1 is where the LED is the dimmest.
A value of 255 is where the LED is the brightest.
Here is my problem:
When the user is entering 255, the LED is not drawing 1 Amp. It is drawing only around 337mA. ( I got this current value from the display of the benchtop power supply. )
I ran a few tests and this is what I found out:
a) When the user enters 255, the voltage from the PWM is 4.48V when the PWM signal is high.
b) When the user enters 255, the voltage between gate and source is 4.5 volts.
Can someone tell me why the LED is not pulling 1Amp at 255.
How can the LED be made to pull 1 Amp when the user enters 255?
LED Datasheet: https://www.ledsupply.com/content/pdf/XLampXML_Color.pdf
MOSFET Datasheet: https://www.infineon.com/dgdl/Infineon-IRLB8721-DataSheet-v01_01-EN.pdf?fileId=5546d462533600a40153566056732591
Some Datasheet specs for the MOSFET are below:


const int pwmPin = 9;
void setup() {
Serial.begin(9600);
pinMode(pwmPin, OUTPUT);
Serial.println("Enter a brightness value (0 to 255):");
}
void loop() {
if (Serial.available() > 0) {
int brightness = Serial.parseInt();
if (brightness >= 0 && brightness <= 255) {
analogWrite(pwmPin, brightness);
Serial.print("Brightness set to: ");
Serial.println(brightness);
// Keep the LED on for half second
delay(500);
// Turn off the LED
analogWrite(pwmPin, 0);
Serial.println("LED turned off");
} else {
// Error msg if the value is out of range
Serial.println("Invalid value! Enter a brightness value (0 to 255):");
}
}
}


