Electronics > Beginners

Correcting LED PWM brightness curve using analog stuffs (no programming)

<< < (3/3)

Ian.M:
And now a LTspice sim of a 5V single supply version of my clipping indicator.  It hasn't got a *LOT* more complex as I was able to kludge a -2.5V level shift into the anti-log amplifier stage.  I've also tweaked the response a bit to get a visible clipping indication closer to threshold.

Get single supply 5V capable quad true RRIO OPAMPs, and the eighth OPAMP can be used for the rail splitter.  Up to U5 output, signals are best plotted with respect to Com, rather than ground.

K3mHtH:

--- Quote from: TerminalJack505 on February 06, 2020, 04:08:36 am ---I played around with some ideas in the simulator as well.  Here's the best that I could come up with.  It would require just one IC (an open-collector comparator) and a handful of passives.

The LED would have only 4 discrete intensity levels so it isn't a analog response but may still look okay.  The resister values on the divider as well as the outputs could be tweaked to taste.  (I pretty much just made up their values.)

I generalized about the PWM voltage level and system voltage level.  (I just used 5V for each.)  How you would filter the PWM would depend on currently unknown factors but may be as simple as using a first-order filter.  (A resistor and a cap.)

--- End quote ---

Thanks Jack, I tried something very similar actually but didn't like it in the end - since one LED shows the "onset of clipping" which makes sense, but the other 3 are just arbitrarily set so when they turn on they don't really indicate anything specific - just "and now a certain amount more clipping is happening". The original intention of the continuously variable brightness LED was just to roughly show how much clipping was happening, but showing it in discrete multiple stages didn't make sense in practice since the stages don't correspond to anything. I appreciate the schematic though, interesting that we both came up with similar ideas, and apologies if I'm being very picky about the behavior of an LED.

I did manage to get something I'm happy with by tweaking the value of the LED current limiting resistor at the op-amp output so that the changes to the PWM duty cycle make more noticeable brightness changes.

K3mHtH:

--- Quote from: Ian.M on February 06, 2020, 03:41:41 pm ---And now a LTspice sim of a 5V single supply version of my clipping indicator.  It hasn't got a *LOT* more complex as I was able to kludge a -2.5V level shift into the anti-log amplifier stage.  I've also tweaked the response a bit to get a visible clipping indication closer to threshold.

Get single supply 5V capable quad true RRIO OPAMPs, and the eighth OPAMP can be used for the rail splitter.  Up to U5 output, signals are best plotted with respect to Com, rather than ground.

--- End quote ---

Wow thanks Ian, that's a very thorough solution! I'd like to breadboard it just to see how it behaves, but I think the parts count might be too high for my application and space requirements. I was initially hoping my problem would be solved by things like "oh, just put a cap across x" or "change the resistor to y" type things.

As I mentioned to Jack above, I ended up increasing the resistance of the LED current limiting resistor until the duty cycle made perceptible brightness changes. It's not the greatest, but seems to work. Thanks for your schematic and LTspice file though, lots for me to learn from it - especially that anti-log inverting amp - I didn't know about that configuration before!

Navigation

[0] Message Index

[*] Previous page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod