Search code examples
arduinorgbled

Arduino RGB led-strip turns off at full intensity


I'm playing around with an Arduino Uno, and an RGB led-strip (Ikea Dioder 4 strips, only one is connected). Primary and secondary colors look fine when writing 255 to one or two colors. The problem is when I want white light (e.g. 255 on all three LEDs), then instead of becoming fully white, it just turns off.

I have an ethernet-shield connected to the Arduino, and a seperate 12V dc powersource. When I connect the power source to the Arduino, it works, but the regulator gets insanely hot (known issue). So I connect the LEDs to the 12V power source directly (they are rated at 12V, the Ikea one is also 12V). Only this causes the problem.

In the program below I can see it very clearly. The code should do the following: fade to red; fade to yellow; fade to white; repeat. The first two go fine, but when it's time to fade to white, it fades to black instead. It just turns off. And I have no idea why.

int redPin = 3;
int greenPin = 5;
int bluePin = 6;
int color[] = {3, 5, 6};
int i = 0;
int j = 0;

void setup(){
  pinMode(redPin, OUTPUT);
  pinMode(greenPin, OUTPUT);
  pinMode(bluePin, OUTPUT);

}

void loop(){
  for(i=0;i<=2;i++)
  {
    for(j=0;j<=255;j++)
    {
       analogWrite(color[i],j);
       delay(5);
    }
  }
  delay(1000);
  analogWrite(redPin, 0);
  analogWrite(bluePin, 0);
  analogWrite(greenPin, 0);

}

Solution

  • The problem has been solved (I think) by connecting the GND for the IC and the (-) side of the adapter to the GND of the Arduino.