DC out peak detector circuit

Thread Starter

Razor Concepts

Joined Oct 7, 2008
214
Hi, I built this peak detector circuit here:
http://macetech.com/vuinput01big.png

VCC is 5 volts

I used a lm324, and instead of the 1uf cap I used a .68uf cap. I used two 4148 diodes as they werent labeled on the schematic.

The audio in is from a MP3 player. With the mp3 player at max volume, the voltage peaks out at about 2.4 volts. Why is this? How can I fix it so the range is higher like in the picture?
 

Audioguru

Joined Dec 20, 2007
11,248
The LM324 is biased at 0V without a negative supply so diode D1 does nothing and can be removed.
The gain of the circuit is 10.09 but your simulation shows the opamp hitting the positive rail at about +3.9V. The supply is +6V in your simulation.

With only 5V for a supply, the max output voltage of an LM324 is +3.8V and diode D2reduces the output of the circuit to about +3.2V.

The lousy old LM324 is too slow for audio.

Maybe the output level of your MP3 player is less than the one in the simulation. Increasing the value of R2 will increase the gain.
 

Audioguru

Joined Dec 20, 2007
11,248
Modern Cmos "rail-to-rail" opamps have an output that goes as high as +5V when the supply is +5V and the output current is zero.
But the output diode reduces the output voltage. The output diode is needed to provide the fast charge then slower discharge of the output capacitor.
 

Thread Starter

Razor Concepts

Joined Oct 7, 2008
214
Hmm. Just wondering, does it take a lot of experience to try and make your own circuits like these? I have been messing about programmable microcontrollers for a while, and building the circuit for those, is basically you can do it right or you can do it wrong. With this kind of electronics I am totally lost, does it just take years of experience with working with them?
 

KL7AJ

Joined Nov 4, 2008
2,229
Hmm. Just wondering, does it take a lot of experience to try and make your own circuits like these? I have been messing about programmable microcontrollers for a while, and building the circuit for those, is basically you can do it right or you can do it wrong. With this kind of electronics I am totally lost, does it just take years of experience with working with them?

Hi Razor:

I don't know if it takes years of experience to learn how to do this, but it takes a different mindset to problem solving than digital electronics. Most of us old analog and R.F. geezers are more comfy with circuits working on a "goodness" scale rather than working or not working! I actually address this issue in a section of my Opus of Amateur Radio Knowledge and Lore. I think you'd find it quite entertaining!

Eric
 

Thread Starter

Razor Concepts

Joined Oct 7, 2008
214
I'm trying to construct a device that can flash LEDs to music, and maybe later do a FFT on it for spektrum analysis. But first the audio signal has to be adjusted so it can be read by the ADC of the microcontroller. Thanks!
 

t06afre

Joined May 11, 2009
5,934
In that case I think you should use a lowpass filter with a say 100Hz cutoff frequency Insert this after your current circuit. Then you compere the amplitude of the signal to some level. as long as it equal or higher than this level you turn the light/led on. This is taken from the top of my head. So I may be wrong ;)
 

Thread Starter

Razor Concepts

Joined Oct 7, 2008
214
Thanks! Also, to increase voltage range, can I give that circuit a higher voltage? I can have that circuit running on 6-7 volts so I get somewhere around 4-5v max output, while the microcontroller is running at 5v. I just need to make sure there the circuit isnt outputting more than what the microcontroller is running at.
 

Audioguru

Joined Dec 20, 2007
11,248
Thanks! Also, to increase voltage range, can I give that circuit a higher voltage? I can have that circuit running on 6-7 volts so I get somewhere around 4-5v max output, while the microcontroller is running at 5v. I just need to make sure there the circuit isnt outputting more than what the microcontroller is running at.
Yes, a higher supply will allow a higher output voltage.
But the lousy old low-power opamp is very, very slow.
 

Thread Starter

Razor Concepts

Joined Oct 7, 2008
214
Thanks. Just as a reference for people looking to do similar things, here is a list of schematics I have found:

http://freecircuitdiagram.com/2008/...ector-detect-the-envelope-of-an-audio-signal/




http://www.users.qwest.net/~ptaylor/Audio/xover-2.jpg




http://www.mshieh.com/Hardware/Projects/AudioMeter/8.php



I think I may try out the first one. But I am not sure what this means: "Note that the output is unbuffered, so only a stage with high impedance input could be connected to this circuit’s output". Can I directly put the output in to a ADC?
 

Audioguru

Joined Dec 20, 2007
11,248
In the Color Organ circuit, the collector and emitter of the PNP transistor are shown backwards on the schematic.
Why not use three LM3915 bar-graph driver ICs instead of millions of transistors and resistors?
 

Thread Starter

Razor Concepts

Joined Oct 7, 2008
214
Thanks, I have seen that before, but really would prefer converting the audio signal to 0-5v levels. It broadens the possibilities of what you can do with it :D
 
Top