Pages: [1]   Go Down
Author Topic: Increasing Brightness Linearly  (Read 428 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Full Member
***
Karma: 2
Posts: 124
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I understand that LED brightness seems to be logarithmic as a function of duty cycle. In other words, perceived brightness = log(duty cycle) or that as the duty cycle becomes higher, the perceived differences in brightness become more imperceptible.

A person on the AVR Freaks forum posted this thread on how to use the formula "brightness = log(10^(duty cycle)) = x" to cancel out the log using a lookup table or linear interpolation.

Is there a name for this kind of "linearizing using the inverse"? I searched wikipedia and found "Inverse problem" but it got complicated really quickly with matrices and I couldn't follow.
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 170
Posts: 12465
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

what is the colour of the LED as IIRC these formulas depend on the colour too.

If you want to implement a lookup table check multimap() - http://playground.arduino.cc/Main/MultiMap -
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

0
Offline Offline
Full Member
***
Karma: 2
Posts: 124
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

My particular LEDs were green and white.
Logged

Offline Offline
Sr. Member
****
Karma: 7
Posts: 266
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The logarithmic curve is only a relatively coarse approximation. More accurate is the CIE LAB correction:

http://neuroelec.com/2011/04/led-brightness-to-your-eye-gamma-correction-no/

This post on the forum explains how to calculate a lookup table:
http://forum.arduino.cc/index.php/topic,147810.0.html

You may want to check out "progmem":
http://arduino.cc/en/Reference/PROGMEM
Logged


Pages: [1]   Go Up
Jump to: