Low brightness flicker of LED strip WS2812C 2020 with Fast LED

Hello,

I am working on a project that is using a tiny LED strip of 2020 size leds of type WS2812C.
I am driving it with an digispark attiny85 using the FastLED library and the strip has small capacitors at every LED.

The issue is that when I reduce the brightness of the strip, lets say from 65 to a low value like 20 (where 255 is the max), the strip flickers as its getting to the low brightness. When it reaches the 20 brightness level, the flickering stops, so its happening only when the brightness is changing.

As its dimming between brightness levels 65 to around 30, the visual change in brightness is very smooth and gradual, but then the last few steps is like the brightness is falling off a cliff very suddenly with each step and the difference is very visible and not smooth any more.

You can see it on the video linked below, but its hard to see on camera, much more pronounced when viewed in person.

Here is my code below, its a simple function with a for loop that goes through all LEDs in the strip, writes the brightness to them and then displays it. there is a delay between writing each brightness. I noticed that the bigger the delay the worse the problem, so shorter delays make it look smoother, but the steps between lowest brightness are still not smooth.

Any help would be appreciated!

FastLED.addLeds<WS2812, DATA_PIN, GRB>(leds, NUM_LEDS);  // GRB ordering is typical

void dimming_animation(int start_brightness, int end_brightness, int dimming_delay_local)
{
  //for brightness going up
  if(end_brightness > start_brightness)
  {
    if(display_messages) Serial.println("Increasing Brightness");
    for(uint8_t j=start_brightness; j<=end_brightness; j++) 
    {
      if(display_dimming_index) Serial.println(j);
      for(uint8_t i=0; i<NUM_LEDS; i++) 
      {
        leds[i].setHSV( 0, 255, j);
      }
      FastLED.show();
      delay(dimming_delay_local);
    }
  }
  
  
  
  //for brightness going down
  if(end_brightness < start_brightness)
  {
    if(display_messages) Serial.println("Decreasing Brightness");
    for(uint8_t j=start_brightness; j>=end_brightness; j--) 
    {
      if(display_dimming_index) Serial.println(j);
      for(uint8_t i=0; i<NUM_LEDS; i++) 
      {
        leds[i].setHSV( 0, 255, j);
      }
      FastLED.show();
      delay(dimming_delay_local);
    }
  }
}

Normal behaviour.
With 8-bit dimming you have 256 steps, but only about 20 equal brightness steps.
Because our vision is sort off logarithmic, not linear.
If you would have linear brightness code, then you have brightness steps all the way to max.
An improvement could be a gamma lookup table, and switching off 1/2, 3/4, etc. of the LEDs in the lower dim region.
Leo..

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.