Go Down

Topic: Why do I fail at controlling RGB led strip via Arduino PWM (Read 899 times) previous topic - next topic

cagancelik

Hey,

I happen to have one of these RGB LED lighting kit for PC case: https://www.newegg.com/Product/Product.aspx?Item=N82E16811980001

It has a remote and gets the power from molex adapter inside the case. All leds are connected to a small black box controller unit (which works as receiver, microcontroller and power distribution). I took the black box apart and desoldered 4 pins connected to it (R,G,B and anode or cathode whatever it is).

I am trying to control the LED colors via Arduino Uno R3. Powering UNO with PC power supply. (The same MOLEX to power adapter converter also fits to Arduino) And then I am using VIN pin to feed 4th pin of the LED (the one isn't doing anything about colors) and then I am connecting any other 3 pins to 5v then VOILA I can create any color I want and it is BRIGHT! Same goes when I connect color pins to Arduino ground...

But connecting them to 11,10,9 pins and controlling via PWM is always problematic. I can never get the color I want. It is always some mix of all colors. Why PWM is always failing and what can I do to solve it?





Thanks

larryd

No schematic, no sketch, no links to components, no answers.


.
No technical PMs.
If you are asked a question, please respond with an answer.
If you are asked for more information, please supply it.
If you need clarification, ask for help.

raschemmel

Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,<br />DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

cagancelik

No schematic, no sketch, no links to components, no answers.


.
Sorry. Updated my post with the product link and pictures of my modification. Please take a look.




larryd

There are current limits to your Arduino outputs, ~20mA per pin.

We need to know more about what you are driving.
i.e. is the Arduino driving the leds directly or the driver type it is driving.

These are 12v strips.
.
No technical PMs.
If you are asked a question, please respond with an answer.
If you are asked for more information, please supply it.
If you need clarification, ask for help.

cagancelik

There are current limits to your Arduino outputs, ~20mA per pin.

We need to know more about what you are driving.
i.e. is the Arduino driving the leds directly or the driver type it is driving.

These are 12v strips.
.
As I have stated and showed in the picture, I am driving them with PC's 12v rail. (VIN pin).

larryd

To drive a 12v LED you need a driver transistor.
The Arduino can only output 0-5volts at 20mA.

Examples



.

No technical PMs.
If you are asked a question, please respond with an answer.
If you are asked for more information, please supply it.
If you need clarification, ask for help.

Grumpy_Mike

Quote
As I have stated and showed in the picture, I am driving them with PC's 12v rail. (VIN pin).
No that is the power supply, you are using an Arduino pin to switch 12V. I am astonished it is still working. You need a driving traansistor to both handle the current and the high voltage.

Quote
I can never get the color I want. It is always some mix of all colors.
Yes that is all that PWM ever does. The individual LEDs are different brightness, they only mix if you have some sort of diffuser  in front of them.
Also you can't get every colour from an RGB LED. Tricky ones are brown and orange.

cagancelik

Can please provide which transistor I need? I'd like to buy it on Ali Express or Banggood.



cagancelik

Uhm.. Can I also drive 12v PWM based PC fans (4 pin) with this mosfet?

Wawa

4-pin computer fans already have a drive circuit inside.
Just connect a 12volt supply to the fan, share grounds, and connect a PWM signal to the PWM pin of the fan.
Leo..

cagancelik

4-pin computer fans already have a drive circuit inside.
Just connect a 12volt supply to the fan, share grounds, and connect a PWM signal to the PWM pin of the fan.
Leo..
I just did that and speed adjustment works OK but the fan makes awful screeching noise. Do you know any way to to eliminate it?

Grumpy_Mike

Quote
Do you know any way to to eliminate it?
Maybe increase the PWM frequency above audio levels.
http://playground.arduino.cc/Code/PwmFrequency

Go Up