Non-linear LED Response Workaround?

The problem here isn’t that the LED is nonlinear, because it is. The problem is that it is linear, but human eyes are not. Human eyes have a response that is closer to response = \sqrt[3]{brightness} What this means is that if you increase a black led by a tiny amount, it looks like a big change. If you increase a white led by the same amount, it does not look like a big change.

Because neopixels are linear, and only have 8 bits of precision, the darkest we can make it without turning it off, is 1/255th of it’s maximum brightness. Unfortunately, this still looks fairly bright to the human eye. ProffieOS tries to work around this by doing dithering, which adds some additional levels by rapidly switching the LED between 0 and 1 values, but even that is not enough at very low levels.

There are a couple of ways to possibly get this to work.

  1. Cover up the led with some tape or something, then use higher values. By reducing the maximum brightness in this way, we’re also gaining more precision in absolute brightness.
  2. Use regular LEDs instead of neopixels. The ProffieOS PWM has 32768 levels, which should be enough.
  3. Use dotstar/Apa102 LEDs. These leds have more bits controlling the brightness, leading to much more accuracy in the lower levels. (Not entirely sure how much, because I haven’t tried it.)

To gain more control over the curve and colors, you probably want to use TrConcat<> to concatenate multiple transitions together.

1 Like