I hope you can help me with a problem on my arduino connection to a RGB Led Strip through a 12v power supply. I did the wiring from this tutorial How To Wire It! RGB LED Strip - YouTube , and it's partially working but, as you can see in the pictures I attached, that one LED ( the green one ) is blinking higher than the others and it's not respecting the code...even if I put a digitalWrite LOW function, he is always on. That happend also when I wired some individual leds separately ( one led was always on). I mention that one of my transistors is very hot through the procces, probably I have to buy a bigger one. So it could be from some previous code that I loaded? And also as you can see in the pictures, there are some leds simply not working from the strip...how can I fix this? It helps if I clear the eeprom?
here is one example of the codes i used:
int greenPin = 4;
int bluePin = 6;
int redPin = 5;
}
void fadeFromTo(int from, int to){
for(int i = 0; i < 255; i++){
analogWrite(to, i);
delay(5);
analogWrite(from, 255 - i);
delay(5);
}
}
the other 2 leds are fading but the green one is stronger and does not respect the code.
Thanks for the time and effort.
I changed it and it didn't helped...the green led still lights stronger and won't do something...and this doesn't solve the problem with the leds that ar not working at all...
How are you powering the LED strip?
As the image showing the breadboard/UNO wiring is not showing everything properly can you either do more images or draw out how you wired it.
Transistor getting hot is not a good sign. Maybe you have damaged one/some.
What LED strip is it? Can you give us the link to where you bought it?
What transistors are you using?
How have you wired everything up? A hand-drawn schematic is fine, it doesn't have to be fancy.
Going by the looks of your code, that is a simple non-addressed RGB strip. Non-working or dim LEDs is going to be caused by a problem with the strip or LEDs themselves, not your code. Those LEDs are all just hooked up in a big series/parallel circuit so your code can't tun one individual LED on or off.
Each time you load a sketch onto the Arduino it clears out the old one, so there can't be any remnants of your previous sketch kept on there to play havoc with your current one.
What happens to the LEDs if you connect it straight to the power and completely bypass the Arduino altogether?
About the wiring...everything was wired as in this tutorial How To Wire It! RGB LED Strip - YouTube ...and about the leds, I attached a picture but I think they should work properly...
Transistors may be the problem because I dont know exactly what power they have.
Thanks!
I can't watch a video at the moment, I'll need to you to show me a schematic. You can draw the schematic on a piece of paper and take a photo, that is fine. But poorly-framed photos of parts of your wiring don't help.
You also haven't told me what transistors you are using.
andres_prs:
...and about the leds, I attached a picture but I think they should work properly...
That's fine that you think that, but they quite clearly aren't. Since your mystery transistors can't turn individual LEDs in the string on or off I'm interested to hear how you think it is happening if it isn't a hardware problem with the LED strip itself.
The easy way to check is to
BJHenry:
connect it straight to the power and completely bypass the Arduino altogether
and see what happens. The LEDs should all come on at full power- any that don't are broken.
Thank you for the replies, the transistor I was using was an bc547c r1 e transistor, I'm going to buy another one, but I think the problem is from the leds because they are non-adressable and they need to be programmed all together, not like one led individually... When i bypassed the arduino and pluged the leds to + and - from the power supply just the green led was lightning.
Here's the drawing of the schematic. ( same for the other 2 leds)
I don't see a current limiting resistor from the LED strip to the transistor collector?
What value are the resistors between the Arduino and the transistor base?
Where is your wire connecting the LED strip ground to the Arduino ground?
Riva:
I don't see a current limiting resistor from the LED strip to the transistor collector?
Where is your wire connecting the LED strip ground to the Arduino ground?
Those strips typically have a common + and an individual GND for each colour. They also have the current limiting resistors build into the strip.
OP, you will need to connect the GND of the Arduino to the GND of the external power supply though.
Schematic is incomplete: no markings at the transistor (E, B, C are which pins?), no part numbers, etc.
How many LEDs? The BC547 can do no more than 100 mA or so. Not much. LED strip suggests multiple LEDs.
By the way, I can't be bothered to try to follow an unclickable link to a video, then sit through it trying to distill some information out of it and hoping you interpreted it the same way. Quite surely this idea applies to most of the forum population. A properly drawn schematic tells the whole story all in seconds. You'll have to supply the information - help us help you.
Ok so i bypassed the arduino and wired the breadboard as in the pictures, put the ground to the leds and they are all lighting now. So what do I need to connect more so that I can programm it with arduino? And maybe one short example of code for non-adressable rgb leds?
That's good to hear that your LED strip is functional
Your the code that you've posted in your original post should be fine for controlling the LED strip that you have. The transistors that you're using are probably not up to the task. For some quick and dirty math, if you're using a 1m strip of LEDs then you're drawing about 4A per colour. (20 LEDs per colour per meter @ 20mA per LED). That is well above the 100mA that your current transistors can do.
If I were you I'd get some logic-level MOSFETs in a TO-220 package- the IRL540 is a good option but there are also others.
For a project like this you should also move away from solderless breadboard. It isn't reliable and also isn't designed to handle that sort of power. This sort of thing should be soldered up on some stripboard. That'll make sure that you don't have to spend time trying to troubleshoot a dodgy connection later on down the track.
Still more than a BC547 can handle. The current should still be OK for a solderless breadboard - though the 1.2A common is too much. Wires in pins close together helps a lot.
Still more than a BC547 can handle. The current should still be OK for a solderless breadboard - though the 1.2A common is too much. Wires in pins close together helps a lot.