Go Down

### Topic: A Better Fade? (Read 1 time)previous topic - next topic

#### KirAsh4

##### Oct 02, 2012, 09:24 pm
Ok, I admit this is all about how we perceive light.  Our eyes aren't bionic implants so our brains compensate.  But, I wonder if anyone has either thought about or figured out a better way to do this.

Let's say you are fading an LED from 0 up to 255 then back down to 0 in +1/-1 increments (let's call it a 'pulse').  Well, from 0 to about 175~200, you'll notice it.  But going above that, the change is so minute that it's barely noticeable.  Yes you can notice it, but it's not as dramatic a change as going from say 100 to 150.

So I thought maybe when one reaches those higher numbers, instead of continuing with a +1 step, change to a +2 step, so the fade reaches max intensity faster.  Then I thought, there's got to be a better way.  Maybe a formula?  Or maybe I'm just going about it all wrong.  I may even be over thinking it, who knows.  I just know that when I'm fading an LED up to max then down to 0 again, it just seems to stay near it's max intensity longer than any other range.  I know it's not, but the light intensity makes it appear that way.

So is there a better way for a smoother "pulsing" of an LED?

#1
##### Oct 02, 2012, 10:04 pm
A logarithmic or exponential formula would probably provide a visibly smooth enough fade on/off.  It may not be a perfectly accurate method, but likely close enough that the human eye won't perceive any inconsistencies.

#### dhenry

#2
##### Oct 02, 2012, 10:07 pm
Quote
So is there a better way for a smoother "pulsing" of an LED?

It can be done quickly with a look-up table.

#### fungus

#3
##### Oct 02, 2012, 10:57 pm

I just know that when I'm fading an LED up to max then down to 0 again, it just seems to stay near it's max intensity longer than any other range.  I know it's not, but the light intensity makes it appear that way.

No, it probably is. Light output from a LED isn't linear.

So is there a better way for a smoother "pulsing" of an LED?

Yes. Use a logarithmic curve.
No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

#### MarkT

#4
##### Oct 02, 2012, 11:16 pm

I just know that when I'm fading an LED up to max then down to 0 again, it just seems to stay near it's max intensity longer than any other range.  I know it's not, but the light intensity makes it appear that way.

No, it probably is. Light output from a LED isn't linear.

I think we're talking about PWM driving an LED, so the _average_ light output is theoretically linear in the PWM duty-cycle.  Self-heating reduces efficiency somewhat so linearity is best at lower output powers.  The human eye has _no_ _chance_ of detecting this degree of non-linearity since the response curve is roughly logarithmic over many orders of magnitude (5 or so)
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

#### KirAsh4

#5
##### Oct 03, 2012, 01:51 am
Cool.  Any particular code examples anywhere?

Go Up

Please enter a valid email to subscribe