I want to control a RGB strip with an Arduino and NPN transistors. The problem is, that the blue LEDs only light up at an extremely low brightness. Also when the red LEDs are on, the green ones are shining at a much lower brightness, than normally.
Regardless witch pin I connect to which LEDs on the strip, the blue one is still always the one that's not working. The strip does not seem to be the problem, since I tested the setup with another strip, that's working correctly.
The same problems accours with a CH340G Arduino Nano and with an original Arduino Leonardo.
I'm using S8050 transistors.
int green_light_pin= 11;
int red_light_pin = 9;
int blue_light_pin = 10;
void setup() {
pinMode(red_light_pin, OUTPUT);
pinMode(green_light_pin, OUTPUT);
pinMode(blue_light_pin, OUTPUT);
}
void loop() {
RGB_color(120, 0, 0); // Red
delay(1000);
RGB_color(0, 255, 0); // Green
delay(1000);
RGB_color(0, 0, 255); // Blue
delay(1000);
RGB_color(255, 255, 255); // White
delay(1000);
}
void RGB_color(int red_light_value, int green_light_value, int blue_light_value)
{
analogWrite(red_light_pin, red_light_value);
analogWrite(green_light_pin, green_light_value);
analogWrite(blue_light_pin, blue_light_value);
}
RRB_Test.ino (661 Bytes)