I would like to make a simple indicator, that takes line-level audio, and drives a single LED, such that the LEDs brightness varies with the audio level, powered by +5V single supply. (As such, I'm not interested in LM3916 Dot/Bar Display Driver kind of indicators)
Let's assume I have line level +4 dBu as audio input, which has a peak of ±1.73 V (Line level - Wikipedia.
EDIT: Attempting to put this as a mapping example: I'm aware that human perception of "loudness/volume" is logarithmic, note sure whether perception of brightness is too. So basically, if I have, say, a 20Hz or 1kHz sinusoid that peaks at ±1.73 V ("max"), I would want the LED to shine at max recommended brightness; if the sinusoid peaks at whatever voltage, so its loudness is perceived as half from the previous "max" example, then the LED should shine at half perceived brightness from the "max" case; for 0V DC audio input (muted), LED should not shine. I cannot express specific requirements about responsivity, but the LED should generally pulse in the rhythm of music (i.e. kick drums and other accents would cause a pulse of increased perceived brightness) - similar to this https://www.youtube.com/watch?v=GBdO7ugAqdI - except I want to handle only a single, usual, round 5 mm LED (not a strip as in the video).
The more I think of this, the more I find it is not exactly trivial:
- If I just stick an LED on the line signal directly (plus appropriate resistor, so recommended current flows at +1.73V), then the typical currents pulled by a LED, say 20 mA, would likely degrade the line signal
- Therefore, I'd need to at least buffer the signal - but if I just use a voltage follower fed by a single supply, I'll lose the negative "semiperiods" of the audio signal; plus if we take VDon = 0.6V of the LED, then the diode would shine only in the positive "semiperiod", and only between there where Vdon is crossed and the max voltage.
- There are some ICs that provide RMS to DC, but all I've found seems to accept input only up to 200 mV RMS, so then I'd additionally need to attenuate the line-level signal (and I'd probably have to scale the DC output as well, so it fits the diode)
- If not RMS, then I'd want to use envelope follower / peak detector ( as the one noted in Creating a "Sharp" Turn on for LEDs ), but then I need at least a second opamp to buffer the detected envelope signal before driving LEDs
- There are schematics like https://hackaday.io/project/1765-led-strip-flashing-to-music where the audio signal directly drives transistors that eventually control the LED current, but I'd have to recalculate all those components to make sure they'd be optimal for line level driving LED within spec
- I could in principle do the equivalent of: ADC of the audio signal -> calculate envelope/peak detection/RMS in microcontroller software -> use this to control PWM out -> use a digital buffer on the PWM signal to drive a LED; then I only need to calculate the series resistor in respect to the supply that drives the LED; but the rest of the processing chain is just overkill
Note that I do not have requirements for high quality of such an indication, just that its sort of perceived as decent - which is why I find it difficult to decide which technique to focus on; I wouldn't want to spend time working on something, if a ready-made solution exists.
I sort of expected that there would be ICs on the market, that could: possibly be set to accept either differential or single-ended analog input; possibly accept a trimmer pot for signal scaling; accept input for a power supply that drives the LEDs (in my case, there is only one +5V supply, though); and be capable of handling positive or negative input voltages even if powered by single-supply (strictly positive voltages) - and provide an output to which a LED and a resistor calculated in respect to the supply (or even a standalone LED, towards either supply or ground) can be attached; abstracting away the actual technique (say, whether PWM is used internally or not) inside the chip. In short, ICs that would be "easy" to set up, in some sense. But I haven't found anything resembling that.
So, are there ICs on the market, that would do something like this?
Since it seems to be common practice to buffer digital signals for LED driving with ICs named like "non-inverting CMOS buffer" SN74AC244N; maybe I have a terminology problem, and simply have been using the wrong words to look for such an IC...
But if there aren't such ICs, what would be the recommended way to handle the line audio signal, so it can be used to drive LED brightness indication?