Go Down

Topic: make pwm output non linear (Read 3 times) previous topic - next topic

mrboni

Non sure if I'm phrasing this well, but is there a way to take a pwm signal to drive an led, and using external components, introduce a non linear curve into the effective current that flows through an led?

The desire is to apply gamma correction to a dimmable led setup, but I dont' want to do it in software, as there is not enough resolution in 8bits to have a smooth 'bottom end' when using this (ie lookup table on arduino) method.

So basically, is there a hardware way to allow me to make more use of those precious 8 bits?

dhenry

Use a look-up table to do the conversion.

mrboni

Like I said, if I use a look up table when I only have 8 bits of resolution, the 'jumps' between steps at the bottom of the range are massive, and very noticable

fungus

You can extend it a couple more bits by switching between PWM values.

eg. Do PWM 1 0 1 0 1 0 to get brightness "0.5"

This only works well if you do it in sync with the PWM cycle, but you don't say what hardware is involved.


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

dhenry

The way to do it in hardware fully is to output an analog voltage and run that voltage through a logrithmic V-I converter to drive an led.

A V-I converter can be an opamp; but the simplest would be to utilize a transistor's b-e junction non-linearity. Simple as that.


Go Up