Hi everyone, i ordered a RGB LED strip but i simply can't turn it on...
i searched for some days and i got no results.
my LED strip is powered by 12V since i'm working with arduino and it only has 5v output i understand that i have to use some NPN transistors. I'm using the TIP 121 since the shop didn't have the TIP 120... can that be the problem?
i just wanted to check how the strip works and build my own algorithm later, so i copied the code from adafruitto and tested it.
i noticed that if i move the strip slightly it turns some leds on but with very very low brightness.
i can't see what i'm doing wrong but i guess it is pretty obvious...
#define REDPIN 10
#define GREENPIN 9
#define BLUEPIN 11
#define FADESPEED 5 // make this higher to slow down
void setup() {
pinMode(REDPIN, OUTPUT);
pinMode(GREENPIN, OUTPUT);
pinMode(BLUEPIN, OUTPUT);
}
void loop() {
int r, g, b;
// fade from blue to violet
for (r = 0; r < 256; r++) {
analogWrite(REDPIN, r);
delay(FADESPEED);
}
// fade from violet to red
for (b = 255; b > 0; b--) {
analogWrite(BLUEPIN, b);
delay(FADESPEED);
}
// fade from red to yellow
for (g = 0; g < 256; g++) {
analogWrite(GREENPIN, g);
delay(FADESPEED);
}
// fade from yellow to green
for (r = 255; r > 0; r--) {
analogWrite(REDPIN, r);
delay(FADESPEED);
}
// fade from green to teal
for (b = 0; b < 256; b++) {
analogWrite(BLUEPIN, b);
delay(FADESPEED);
}
// fade from teal to blue
for (g = 255; g > 0; g--) {
analogWrite(GREENPIN, g);
delay(FADESPEED);
}
}
Hi, you should have resistors between the Arduno pins and the transistor bases. A few KOhms should be ok. Otherwise you could damage the Arduino. Maybe you already did. Will those Arduino outputs still run 5mm leds ok (with 200~300R series resistors)?
sorry, i know that must be the error now that you talk about it, i'm a noob with transistors.
the thing is, arduino only gives +5v and i need +12v to power the strip and i thought the transistors would solve that problem.
please explain me what i am doing wrong.. -.-
Your schematic is correct, IF you have the transistors wired correctly and the lack of base resistors didn't damage the Arduoino. Does the chip feel warm or hot at all?
You also need +12V supply Gnd connected to the Arduino Gnd. It should be if the 12V is connected to the Arduino barrel jack connector.
no, i checked some times and they were cold.
i'll check the wires and the connections. maybe it is just a bad connection between the breadboard and the wires
You need to make a splitter cable from your power supply so that the Arduino gets 12V at the barrel jack, and the +12V at the LED strip gets 12V.
If the LED strip is not too long, 6 or maybe 9 RGB LEDs at the most, you could power it from the Vin header pin.
Which involves attaching your pic and then posting, copying the link address, then modifying your post and attaching the copied link address. Yes, its is a minor pain!