DC out peak detector circuit

Discussion in 'General Electronics Chat' started by Razor Concepts, Jul 26, 2009.

  1. Razor Concepts

    Thread Starter Active Member

    Oct 7, 2008
    212
    1
    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?
     
  2. Audioguru

    New Member

    Dec 20, 2007
    9,411
    896
    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.
     
  3. Razor Concepts

    Thread Starter Active Member

    Oct 7, 2008
    212
    1
    Thanks. Are there any other circuits out there that will output up to 5v? I've been trying to look for quite a while but no luck.
     
  4. Audioguru

    New Member

    Dec 20, 2007
    9,411
    896
    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.
     
  5. Razor Concepts

    Thread Starter Active Member

    Oct 7, 2008
    212
    1
    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?
     
  6. KL7AJ

    AAC Fanatic!

    Nov 4, 2008
    2,040
    287

    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
     
  7. Razor Concepts

    Thread Starter Active Member

    Oct 7, 2008
    212
    1
    Can anyone reccomend another circuit to convert the audio signal to DC levels like these?
     
  8. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    What are you trying to construct? If you tell us we can give you some input.
     
  9. Razor Concepts

    Thread Starter Active Member

    Oct 7, 2008
    212
    1
    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!
     
  10. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    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 ;)
     
  11. Razor Concepts

    Thread Starter Active Member

    Oct 7, 2008
    212
    1
    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.
     
  12. Audioguru

    New Member

    Dec 20, 2007
    9,411
    896
    Yes, a higher supply will allow a higher output voltage.
    But the lousy old low-power opamp is very, very slow.
     
  13. Razor Concepts

    Thread Starter Active Member

    Oct 7, 2008
    212
    1
    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/
    [​IMG]



    http://www.users.qwest.net/~ptaylor/Audio/xover-2.jpg
    [​IMG]



    http://www.mshieh.com/Hardware/Projects/AudioMeter/8.php
    [​IMG]


    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?
     
  14. yourownfree

    Active Member

    Jul 16, 2008
    89
    0
    will this help? this circuit is a color organ, this guy went all out and 49 leds, but you can see that you can cut it down to 1 for high, middle, and low frequencies.
     
  15. Audioguru

    New Member

    Dec 20, 2007
    9,411
    896
    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?
     
  16. Razor Concepts

    Thread Starter Active Member

    Oct 7, 2008
    212
    1
    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
     
Loading...