Author Topic: Peak LED advice audio  (Read 4654 times)

0 Members and 1 Guest are viewing this topic.

Offline goldfingerTopic starter

  • Regular Contributor
  • *
  • Posts: 63
Peak LED advice audio
« on: February 02, 2017, 05:37:45 am »
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 appreciated

Thanks all!
 

Offline jm_araujo

  • Regular Contributor
  • *
  • Posts: 72
  • Country: pt
Re: Peak LED advice audio
« Reply #1 on: February 02, 2017, 12:14:27 pm »
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.
 

Offline Dragonfly

  • Contributor
  • Posts: 19
Re: Peak LED advice audio
« Reply #2 on: February 02, 2017, 09:58:22 pm »
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.
 

Offline Benta

  • Super Contributor
  • ***
  • Posts: 5871
  • Country: de
Re: Peak LED advice audio
« Reply #3 on: February 02, 2017, 10:20:29 pm »
Are you talking line level (775 mV) or loudspeaker output here? Or something completely different? That will influence our answers quite a bit.
 

Offline Audioguru

  • Super Contributor
  • ***
  • Posts: 1507
  • Country: ca
Re: Peak LED advice audio
« Reply #4 on: February 03, 2017, 02:04:54 am »
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.
No.
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.
 

Offline goldfingerTopic starter

  • Regular Contributor
  • *
  • Posts: 63
Re: Peak LED advice audio
« Reply #5 on: February 03, 2017, 07:29:39 am »
Are you talking line level (775 mV) or loudspeaker output here? Or something completely different? That will influence our answers quite a bit.
Hey benta

Line level output, would be tapped off line going to rca line out

Thanks :)

 

Offline goldfingerTopic starter

  • Regular Contributor
  • *
  • Posts: 63
Re: Peak LED advice audio
« Reply #6 on: February 03, 2017, 07:31:01 am »
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.
No.
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.


Thanks audio guru so a lm3915 would be good option?
 

Offline goldfingerTopic starter

  • Regular Contributor
  • *
  • Posts: 63
Re: Peak LED advice audio
« Reply #7 on: February 03, 2017, 07:42:44 am »
Thanks for all feedback thus far guys!


Sent from my 486 IBM WIN 3.1x Desktop...
 

Offline MattHollands

  • Frequent Contributor
  • **
  • Posts: 313
  • Country: gb
    • Matt's Projects
Re: Peak LED advice audio
« Reply #8 on: February 03, 2017, 01:28:10 pm »
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.
No.
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.


Thanks audio guru so a lm3915 would be good option?

Regardless 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.pdf

Picture from page three attached. Basically it shows a band pass filter (replace this with a unity gain buffer [Edit] or the amplifier you mention in OP[/Edit]) 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.
« Last Edit: February 03, 2017, 01:42:25 pm by MattHollands »
Read about my stuff at: projects.matthollands.com
 

Offline Audioguru

  • Super Contributor
  • ***
  • Posts: 1507
  • Country: ca
Re: Peak LED advice audio
« Reply #9 on: February 03, 2017, 06:12:36 pm »
Sent from my 486 IBM WIN 3.1x Desktop...
Are 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.
 

Offline goldfingerTopic starter

  • Regular Contributor
  • *
  • Posts: 63
Re: Peak LED advice audio
« Reply #10 on: February 03, 2017, 06:39:18 pm »
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.
No.
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.


Thanks audio guru so a lm3915 would be good option?

Regardless 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.pdf

Picture from page three attached. Basically it shows a band pass filter (replace this with a unity gain buffer [Edit] or the amplifier you mention in OP[/Edit]) 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.

Thanks 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.

 

Offline goldfingerTopic starter

  • Regular Contributor
  • *
  • Posts: 63
Re: Peak LED advice audio
« Reply #11 on: February 03, 2017, 06:41:38 pm »
Sent from my 486 IBM WIN 3.1x Desktop...
Are 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.


Haha sacasim maybe lost in my signature :) I 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 :)
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19519
  • Country: gb
  • 0999
Re: Peak LED advice audio
« Reply #12 on: February 03, 2017, 06:58:25 pm »
I upgraded to Win 97 and ran high speed internet when everybody said was impossible.
Well it was impossible, since there never was a Windows 97.  :P
 

Offline MattHollands

  • Frequent Contributor
  • **
  • Posts: 313
  • Country: gb
    • Matt's Projects
Re: Peak LED advice audio
« Reply #13 on: February 04, 2017, 03:11:02 am »
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.
No.
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.


Thanks audio guru so a lm3915 would be good option?

Regardless 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.pdf

Picture from page three attached. Basically it shows a band pass filter (replace this with a unity gain buffer [Edit] or the amplifier you mention in OP[/Edit]) 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.

Thanks 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.

Well, 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)
Read about my stuff at: projects.matthollands.com
 

Offline goldfingerTopic starter

  • Regular Contributor
  • *
  • Posts: 63
Re: Peak LED advice audio
« Reply #14 on: February 04, 2017, 04:09:59 am »
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.
No.
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.


Thanks audio guru so a lm3915 would be good option?

Regardless 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.pdf

Picture from page three attached. Basically it shows a band pass filter (replace this with a unity gain buffer [Edit] or the amplifier you mention in OP[/Edit]) 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.

Thanks 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.

Well, 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)
Hey 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...
 

Offline MattHollands

  • Frequent Contributor
  • **
  • Posts: 313
  • Country: gb
    • Matt's Projects
Re: Peak LED advice audio
« Reply #15 on: February 04, 2017, 11:59:25 am »
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.
No.
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.


Thanks audio guru so a lm3915 would be good option?

Regardless 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.pdf

Picture from page three attached. Basically it shows a band pass filter (replace this with a unity gain buffer [Edit] or the amplifier you mention in OP[/Edit]) 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.

Thanks 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.

Well, 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)
Hey 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...

I 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.
Read about my stuff at: projects.matthollands.com
 

Offline goldfingerTopic starter

  • Regular Contributor
  • *
  • Posts: 63
Re: Peak LED advice audio
« Reply #16 on: February 05, 2017, 01:21:57 am »
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.
No.
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.


Thanks audio guru so a lm3915 would be good option?

Regardless 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.pdf

Picture from page three attached. Basically it shows a band pass filter (replace this with a unity gain buffer [Edit] or the amplifier you mention in OP[/Edit]) 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.

Thanks 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.

Well, 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)
Hey 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...

I 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.
Thanks Matt appreciated I'll switch around a few values and see how I go!


Sent from my 486 IBM WIN 3.1x Desktop...
 

Offline Audioguru

  • Super Contributor
  • ***
  • Posts: 1507
  • Country: ca
Re: Peak LED advice audio
« Reply #17 on: February 05, 2017, 01:29:24 am »
It was a long time ago. I guess my Intel 486 was running Win98.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf