You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I built a lamp with a single led strip controlled via PWM. I use a brightness gamma correction factor of 2,8. When I set the brightness to any value <56, the led strip completely turns off.
If I understand correctly, this would mean (56/255)^2.8 ~= 1.4% duty cycle.
I also flashed the lamp with ESPHome which can debug-log the actual duty cycle and I see that the led strip already turns on with a very dim light at a duty cycle of 2/16363 ~= 0.01%.
Same lamp and wiring, of course.
To Reproduce Bug
Wire up an LED strip, set gamma brightness to 2.8, set brightness to a value <56. Watch the LED strip turn off.
Expected Behavior
Have the led strip light up at values down to ~10/255, not stop at 55/255, given a gamma factor of 2.8.
Install Method
Binary from WLED.me
What version of WLED?
v0.15.1 build 2507300
Which microcontroller/board are you seeing the problem on?
Thanks, that improved it a little bit. I can now go down to 28/255. 0-27 is no light.
However, I noticed, if I change the "color" channel of my single white light to for example 50:50 black/white, it is possible to dim the light further. I feel like in a single light scenario, there should not be a color selection that influences brightness, but only a brightness selection
@andreaskoelsch do you have "Use Gamma correction for brightness (not recommended)" enabled in led settings ?
If yes it would explain why you see a sharp drop at lower values - gamma for brightness is calculated in 8bit, instead of ~12bit used for PWM duty cycle. In 8bit, gamma=2.8 is really strong - values below 40 are all mapped to 0.
reducing gamma will give you better brightness control for low brightness colours (try down to 2.3)
not using "gamma for brightness" will prevent 8bit "killing" of low values
Ohh, I didn't know that. For a better WAF, I'd like to resemble the ESPHome behavior. Is there a way to calculate the pwm duty cycle with the full resolution?
Ohh, I didn't know that. For a better WAF, I'd like to resemble the ESPHome behavior. Is there a way to calculate the pwm duty cycle with the full resolution?
you'd need to check the code, the calculation is complex.
The code calculates PWM parameters based on what you set in LED settings, and adds dithering in case you also select "off refresh".
Beware that the calculation is not straightforward, and i doubt that its comparable to a static duty cycle assignment.
Edit 1:
You should also consider the frequency limits of your MOSFET driver - some of these cannot cope with very high frequency PWM signals (=short duty cycles) - reducing the PWM frequency might actually improve the behaviour at low brightness.
Edit 2:
A logic analyzer might help to understand the PWM signal at PIN level. These things are available for cheap (~10€), and might be better to invest the small money, instead of tricking the source code into showing the duty cycle at software level.
thanks for your inputs. I think this will get too complicated for a simple monochrome light for me, so I'll stick with ESPHome for now even though it's not really ideal for travelling.
Activity
DedeHai commentedon Oct 25, 2025
Set lowest frequency, enable dithering or use better gate driver
andreaskoelsch commentedon Oct 25, 2025
Thanks, that improved it a little bit. I can now go down to 28/255. 0-27 is no light.
However, I noticed, if I change the "color" channel of my single white light to for example 50:50 black/white, it is possible to dim the light further. I feel like in a single light scenario, there should not be a color selection that influences brightness, but only a brightness selection
softhack007 commentedon Nov 10, 2025
@andreaskoelsch do you have "Use Gamma correction for brightness (not recommended)" enabled in led settings ?
If yes it would explain why you see a sharp drop at lower values - gamma for brightness is calculated in 8bit, instead of ~12bit used for PWM duty cycle. In 8bit, gamma=2.8 is really strong - values below 40 are all mapped to 0.
andreaskoelsch commentedon Nov 17, 2025
Ohh, I didn't know that. For a better WAF, I'd like to resemble the ESPHome behavior. Is there a way to calculate the pwm duty cycle with the full resolution?
DedeHai commentedon Nov 18, 2025
you'd need to check the code, the calculation is complex.
softhack007 commentedon Nov 18, 2025
@andreaskoelsch you need to study the implementation of these two functions
WLED/wled00/bus_manager.cpp
Line 436 in aaad450
WLED/wled00/bus_manager.cpp
Line 539 in aaad450
The code calculates PWM parameters based on what you set in LED settings, and adds dithering in case you also select "off refresh".
Beware that the calculation is not straightforward, and i doubt that its comparable to a static duty cycle assignment.
Edit 1:
You should also consider the frequency limits of your MOSFET driver - some of these cannot cope with very high frequency PWM signals (=short duty cycles) - reducing the PWM frequency might actually improve the behaviour at low brightness.
Edit 2:
A logic analyzer might help to understand the PWM signal at PIN level. These things are available for cheap (~10€), and might be better to invest the small money, instead of tricking the source code into showing the duty cycle at software level.
andreaskoelsch commentedon Nov 27, 2025
thanks for your inputs. I think this will get too complicated for a simple monochrome light for me, so I'll stick with ESPHome for now even though it's not really ideal for travelling.