Pages: [1]   Go Down
Author Topic: RGB LED flickering  (Read 3163 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 25
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

I am controlling an RGB LED strip using  PWM Pins 9,10,11 according based on this tutorial:
http://learn.adafruit.com/rgb-led-strips
When I dim the light the LEDs start flickering. Shouldn't the the PWM frequency be high enough so that i cant see the flickering?
Does anyone knows the  the standard frequency of PWM? Should I manipulate the PWM frequency?

Tanks in advance
Logged

Eugene, Oregon
Offline Offline
Sr. Member
****
Karma: 9
Posts: 388
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Its kinda hard to tell what is happening and not. It sounds like maybe you are trying to run the whole strip of LEDs off the arduino, which sounds like too much current for the arduino, but then again, its hard to say from here.

If you can include more details (like show us the entire circuit, including power supply, how many LEDs, which type of arduino you are using, ...)
Logged


United Kingdom
Offline Offline
Tesla Member
***
Karma: 227
Posts: 6639
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The standard Arduino PWM frequency is 488Hz, which is high enough to avoid visible flickering.
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 639
Posts: 34724
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Most beginners forget to connect the ground of the 12V power supply to the ground of the arduino.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 25
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I use an Arduino "compatibel" to the Nano 328. I am using mosfets so the LEDs strip current does not flow over the arduino and the ground and the +12V supply are the same for the arduino and the LED Strip. The wiring is identical to the tutorial:http://learn.adafruit.com/rgb-led-strips/usage
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 639
Posts: 34724
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

If you do it right with the right components you should not see any flicker.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 25
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Mike can you also tell me which are the right components?
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 639
Posts: 34724
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The components mentioned in the artical and not a subistitute that you think might work.
Logged

Offline Offline
Edison Member
*
Karma: 116
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Shouldn't the the PWM frequency be high enough so that i cant see the flickering?

Your eyes do get better at preceiving flickering at low brightness. What you observe could be due to that.
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 639
Posts: 34724
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

What do you actually mean by flickering?
Is it perceivable looking directly at the light?
Or is it that you want to see no flicker as you rapidly scan your eyes across the field of view that contains the lights?
 
Logged

Albany, NY
Offline Offline
Newbie
*
Karma: 0
Posts: 21
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi lukeskymuh, I believe I might be encountering the same issue as you. The flickering I encounter is when the leds are dimmed to a low pwm value, they flicker in a way a candle flame does right before it goes out. Not like a refresh rate problem. I thought it was my hardware but I realize now I am not encountering the problem when I set the pwm to a fixed value, or strobe it with a simple loop. Turns out, the only time I can get this flicker to happen is when running that color swirl code form adafruit which you linked to. We have different hardware setups, but we are using that same bit of code. Do you have the flicker when setting the pwm to a value of 10 or when doing a simple pwm increase loop on the leds?

-Sathi
Logged

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 150
Posts: 5744
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi lukeskymuh, I believe I might be encountering the same issue as you. The flickering I encounter is when the leds are dimmed to a low pwm value, they flicker in a way a candle flame does right before it goes out. Not like a refresh rate problem. I thought it was my hardware but I realize now I am not encountering the problem when I set the pwm to a fixed value, or strobe it with a simple loop. Turns out, the only time I can get this flicker to happen is when running that color swirl code form adafruit which you linked to.

What TLC library is that using? It's definitely possible to cause flicker by not controlling the chip properly.
Logged

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

Albany, NY
Offline Offline
Newbie
*
Karma: 0
Posts: 21
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

No where in the thread was the TLC mentioned, yet you guessed that I might be using it? I am indeed. Is this a known issue? When I get home I will check what version of the library I have. Thanks.

-Sathi
Logged

Albany, NY
Offline Offline
Newbie
*
Karma: 0
Posts: 21
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am using the Tlc5940_r014_2 library. I am pretty sure it is the newest one from the google code page at:

http://code.google.com/p/tlc5940arduino/downloads/detail?name=Tlc5940_r014_2.zip&can=2&q=

Not sure what the deal is, but I can generate all sorts of weird artifacts based on different code parameters. If I increase
the pwm values at a slow rate, the leds increase in brightness in pulsating sort of pattern, like they are breathing. At faster speeds things look smooth. But I can't get it to fade slowly from one color to the next in a smooth manner. Especially at low
pwm values where they have that strange candle light like flicker. I'll avoid hijacking this guys thread and make a new topic on this I can't get it worked out. Thanks.

-Sathi
Logged

Pages: [1]   Go Up
Jump to: