Dividing 0 to 100% exponetially for dimming light

Thread Starter

Vindhyachal Takniki

Joined Nov 3, 2014
583
1. I need to dim a light 0 to 100% depending upon user input 0 to 100.
Have a driver to which when I pass value 0 to 100% by microcontroller it dims the led accordingly.

2. I was reading below image from this datasheet: https://www.ti.com/lit/pdf/slvaef3

1613229825954.png

3.Page 6, says "Human perception of brightness is not linear with luminance of the LEDs and is more sensitive at low
luminance, which is approximated to a logarithmic curve. So if the linear dimming control method is used,
the final perceived brightness is not linear in human perception. That is why exponential dimming is used."


4. Now have to divide 0 to 100% exponetially? How do I divide the number 0 to 100% exponentially when user input comes 0 to 100?
 

Tonyr1084

Joined Sep 24, 2015
5,966
Not only is light perception non-linear, so is audio. They sell "Linear Taper" pots and "Audio Taper" pots. The audio taper pot is exponential or inverse of exponential, depending on how you hook it up.
 

wayneh

Joined Sep 9, 2010
17,152
The equation for an exponential curve is:
Brightness y = C•((exp^a•x) - 1)​
where C and a are constants and x is duty cycle.

Since brightness y is zero at x=0 and 100 at x=100, a is forced into being a function of C:
a = ln((100+C/C))/100.​
Changing the value of C gives a family of curves with different degrees of curvature, all passing through zero and 100. C=1 is highly curved while C=100 is nearly linear.

The inverse function gives x required for a given brightness.
x = 100 • ln(y/C + 1) ÷ ln(100/C + 1)​
 
Last edited:

MisterBill2

Joined Jan 23, 2018
8,725
We do not have any hint as to what type of light it is, and different kinds have different relations between drive and brightness.
And why does the relationship need to be uniform? In reality it is very seldom uniform.
 

Ian0

Joined Aug 7, 2020
2,178
According to the relevant standard BS EN 62386-102, the brightness should vary logarithmically over 3 orders of magnitude, i.e. from 0.1% to 100%, so you need at least 10 bit resolution for the PWM.
 

wayneh

Joined Sep 9, 2010
17,152
Last edited:
Top