Peak LED advice audio - Page 1
Forum section: electronics / beginners

author: goldfinger
author_rank: Regular Contributor
timestamp: February 02, 2017, 05:37:45 am
content: Hi Guys,I was hoping someone could give me some thoughts on best and most simple way to approach a triggering simple peak detection Led illumination.I'm not looking for a peak and hold, rather the led to flash on and dim relatively quickly once the voltage returns to below threshold.I'm looking for advice because the panel led im using has a VF of 1.8v, 20ma and operating range typically 1.8-3.5v.Although I would like the trigger to occur at approx 0.8v.Forgive me if my thoughts are completely off the mark, but could I:Take the output signal of the audio into an op amp with a predefined gain that after following diode and resistors would provide enough voltage to trigger the led. If it was around 100mv off or so it wouldn't be a big issue.E.g. If I needed 2 volts to get led to turn on then I add appropriate gain in op amp on the basis of 0.8v input.Hope that make sense?? Any suggestions on how best to achieve would be really appreciatedThanks all!

author: jm_araujo
author_rank: Regular Contributor
timestamp: February 02, 2017, 12:14:27 pm
content: You shouldn't depend on the LED Vf to detect the peaks, it can change from LED to LED and with various external factors.The best way it to amplify the signal and use a comparator to turn on the LED.

author: Dragonfly
author_rank: Contributor
timestamp: February 02, 2017, 09:58:22 pm
content: Since you asked for the "simplest way", you could just use a LM3914 (http://www.ti.com/product/LM3914). It's intended use is to drive a VU panel meter but you could just use one output corresponding to level where you want your LED to light.

author: Benta
author_rank: Super Contributor
timestamp: February 02, 2017, 10:20:29 pm
content: Are you talking line level (775 mV) or loudspeaker output here? Or something completely different? That will influence our answers quite a bit.

author: Audioguru
author_rank: Super Contributor
timestamp: February 03, 2017, 02:04:54 am
content: Quote from: Dragonfly on February 02, 2017, 09:58:22 pmNo.The LM3914 is a linear voltmeter.The LM3915 is a logarithmic meter used in audio VU meters.You need a peak detector that stretches short durations to be at least 30ms for our slow vision to see the peaks.

author: goldfinger
author_rank: Regular Contributor
timestamp: February 03, 2017, 07:29:39 am
content: Quote from: Benta on February 02, 2017, 10:20:29 pmHey bentaLine level output, would be tapped off line going to rca line outThanks

author: goldfinger
author_rank: Regular Contributor
timestamp: February 03, 2017, 07:31:01 am
content: Quote from: Audioguru on February 03, 2017, 02:04:54 amThanks audio guru so a lm3915 would be good option?

author: goldfinger
author_rank: Regular Contributor
timestamp: February 03, 2017, 07:42:44 am
content: Thanks for all feedback thus far guys!Sent from my 486 IBM WIN 3.1x Desktop...

author: MattHollands
author_rank: Frequent Contributor
timestamp: February 03, 2017, 01:28:10 pm
content: Quote from: goldfinger on February 03, 2017, 07:31:01 amRegardless of lm3915 or lm3914 you need a peak detection circuit. The lm391x simply takes a voltage input (ie your audio signal) and lights up different LEDs depending on the voltage. If you were to connect your signal directly into the LM391x the led would flash, but because audio is AC you might only get tiny, non-visible flashes of the LED. If you don't need a very sensitive detector then this may work but if you want it to be accurate you want some kind of peak hold.What you can do is put a diode, capacitor and resistor before the lm391x. This way, when the voltage peaks this voltage is passed onto the capacitor which holds charge and slowly decays. This voltage is then used to trigger the lm391x. Here is a schematic for a design I built using peak detection and an lm3914.https://github.com/mhollands/Spectrum/blob/master/Schematic.pdfPicture from page three attached. Basically it shows a band pass filter (replace this with a unity gain buffer  or the amplifier you mention in OP) AC coupled to a diode. The decay of C19 is set by R21 and RV5 (ie how long the hold will occur for). The signal then goes to an LM3914. However if you only have 1 LED you're probably better off just using a single comparator (if you're using a dual op amp for the unity gain buffer then you may as well just use the second opamp as a comparator).In this case however, the LED will light up for an amount of time proportional to how much the voltage was above your threshold.

author: Audioguru
author_rank: Super Contributor
timestamp: February 03, 2017, 06:12:36 pm
content: Quote from: goldfinger on February 03, 2017, 07:42:44 amAre you serious? My first pc was a 486 running Win 3.1 then I upgraded the processor to a 486-100 that had bits of a Pentium in it. I upgraded to Win 97 and ran high speed internet when everybody said was impossible. Its hard drive was replaced by a larger one that failed.

author: goldfinger
author_rank: Regular Contributor
timestamp: February 03, 2017, 06:39:18 pm
content: Quote from: MattHollands on February 03, 2017, 01:28:10 pmThanks for feedback Matt appreciated mate. So I'm assuming if I went with the diode in front of the op amp I would need some sort of gain not just unity buffer? trigger was 0.8v of ac signal and voltage of diode was 0.7v than it will only provide 0.1v above that to the following cap which needs to be able to power on the led afterwards to indicate signal is above 0.8v but won't have enough signal to do so.

author: goldfinger
author_rank: Regular Contributor
timestamp: February 03, 2017, 06:41:38 pm
content: Quote from: Audioguru on February 03, 2017, 06:12:36 pmHaha sacasim maybe lost in my signatureI remember spending my entire school holidays programming a Commodore 64 only to see a rocket go across the screen at the end of 10 seconds

author: Zero999
author_rank: Super Contributor
timestamp: February 03, 2017, 06:58:25 pm
content: Quote from: Audioguru on February 03, 2017, 06:12:36 pmWell it was impossible, since there never was a Windows 97.

author: MattHollands
author_rank: Frequent Contributor
timestamp: February 04, 2017, 03:11:02 am
content: Quote from: goldfinger on February 03, 2017, 06:39:18 pmWell, the voltage dropped across the diode will be ~0.7v . Therefore the voltage on the capacitor will be ~0.7v less than the voltage on your audio signal. So you want your comparitor to trigger when the voltage on the cap is >0.1v (0.8 - 0.7 = 0.1). You can add voltage gain if that achieves the effect you want. e.g. with 5x gain, your voltage should trigger at 4v so set your comparitor to 3.3v (4 - 0.7 = 3.3)

author: goldfinger
author_rank: Regular Contributor
timestamp: February 04, 2017, 04:09:59 am
content: Quote from: MattHollands on February 04, 2017, 03:11:02 amHey Matt,Thanks for taking the time to provide advice, picked up some bits this morning so I'll play around on bread board.Cap wise where do you think I should start? 500p 1nf? 50nf? It will probably be aligned to a vu meter so it's more as a momentary flicker on/off rather than looking for a hold.Sent from my 486 IBM WIN 3.1x Desktop...

author: MattHollands
author_rank: Frequent Contributor
timestamp: February 04, 2017, 11:59:25 am
content: Quote from: goldfinger on February 04, 2017, 04:09:59 amI think at this stage it's probably just trial and error. All that matters really is the time constant (RC). Play around with some values . I used 1u and ~200kohm.

author: goldfinger
author_rank: Regular Contributor
timestamp: February 05, 2017, 01:21:57 am
content: Quote from: MattHollands on February 04, 2017, 11:59:25 amThanks Matt appreciated I'll switch around a few values and see how I go!Sent from my 486 IBM WIN 3.1x Desktop...

author: Audioguru
author_rank: Super Contributor
timestamp: February 05, 2017, 01:29:24 am
content: It was a long time ago. I guess my Intel 486 was running Win98.