Peak Detectors!


In this video I’m going to show you how
to build a peak detector circuit and I’ll apply it to the clapper circuit made in
an earlier video. There are many ways to build a peak
detector, but I find this version to be the simplest. Now you’re probably wondering… What is a
peak detector? What does this circuit do? Well let’s say on the input you have a
varying AC voltage. If you feed that into a peak detector, on
the output you’ll get a DC voltage that stays at the peak of the AC value. It works because the diode only allows
current to flow forwards, then the capacitor gets charged, and since the
capacitor has no path to discharge it stays charged at the peak voltage. This can be useful if your input signal
is changing so fast that you can’t even process it, and all you really want is to get a
reading of the maximum voltage it reaches. The graphs I’ve shown here are just the
ideal peak detecting behavior but you should be aware that because
diodes have a small forward voltage drop, the real world peak voltage will be
about 0.5V less than the input peak. Also, since capacitors aren’t perfect
either, the capacitor will slowly self discharge
over a period of time. Usually a few seconds to several minutes depending on
the size of the capacitor. Alright, now I want to show you how to
build a practical peak detector where you can have control over how long the
peak is held for. It’s really simple. Just add a resistor
in parallel with the capacitor. Now there’s a way for the capacitor to
slowly discharge over time. And you can use pretty much any diode
you want. I used a 1N4007. Here’s the formula for calculating the
approximate time to discharge the capacitor. The higher the capacitance value, the
more energy is stored, so it’ll take longer to discharge the capacitor. And of course the higher the resistance
value, the slower the capacitor will discharge. I’m going to make a peak detector with a
10uF capacitor and a 100k ohm resistor. So it’ll take roughly five seconds to fully discharge. Now let’s look at it on the oscilloscope. The red trace is the input signal which is
a 1kHz triangle wave. The yellow signal is the output of my peak
detector. You can see that it’s maintaining the peak
value over time perfectly, minus the small diode voltage drop. At a much lower frequency of 10Hz,
you can see that it still kind of holds the peaks, but discharges by about 0.5V
over 100 milliseconds. I could fix that problem by adding more
capacitance. Alright now let’s see what a peak
detector can do for my clapper circuit. If you remember, the LED only stayed
on while there was a loud sound. It would instantly turn off when it was quiet.
For the clapper circuit to be practical, you’d want a single clap to activate the
circuit for several seconds or several minutes. Here’s the original circuit diagram
again with the amplifier on the left and the comparator on the right. Now I’m going to add my peak detector
circuit in the middle so it holds on to the peak audio levels for a couple
of seconds. And here’s the result… If you want the effect to last longer,
just increase the resistor and capacitor values. Thank you for watching and enjoy playing
with peak detectors!

Add a Comment

Your email address will not be published. Required fields are marked *