New Trivial Peak Detector Circuit?

GroupDIY Audio Forum

Help Support GroupDIY Audio Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

ioplex

Well-known member
Joined
Apr 3, 2013
Messages
48
By mistake I stumbled on what seems to be a surprisingly effective half-wave peak detector circuit:

YMEPAHB.jpg


Unlike the usual trivial peak detector examples, D1 stops the op amp from going into negative saturation. D2 does the usual diode drop compensation. D3 mirrors D2 separately so that it isn't drained and thus you have a diode compensated peak detector that doesn't drive the op amp nuts. Also, it uses one high-Z op amp and at low signal levels below 100mv (200mvpp) it has a nice logarithmic output characteristic which might be useful for interfacing with a low-res ADC.

However, in practice, with the high-Z voltage divider on the input (explanation to follow), the output can erratically switch and stick to several hundred mv. The 100p on the input and 4.7M on the output as shown mostly corrects this problem but at the expense of high frequencies and decay rate. And still the output bottoms out at ~50 mv. With low input impedance the whole thing is surprising accurate actually. With an n-channel MOSFET on the output it looks like it could make a sample-hold circuit to measure photons or something. But of course I'm not measuring photons ...

The overall objective with this circuit is to come up with something really simple for interfacing conventional +-15V circuits with microcontrollers like an Arduino. Microcontrollers are great for controlling large numbers of LEDs using shift-register constant current sink arrays like CAT4016. But the builtin ADCs of an Arduino are not fast enough for high frequency audio. So I'm trying to devise a very high-Z single op amp input that can a) buy some time so that the microcontroller can collect samples at a leisurely rate of say 1ms/sample and b) step down the 15v to the 5v of the Arduino's analog inputs. I've done this with the above circuit. I've written the code to average 10 samples and drive LEDs at 100Hz and it's all very reactive and quite accurate.

But again, the circuit is a little unstable when the input Z is very high. And ideally I would like to make it even higher.

So my question is, can anyone speculate as to why the circuit is unstable with the high-Z input and how to fix it? Note that C2 is critical to stability. If I make it smaller, stability is greatly improved. And in practice I find that 1.5n is actually better for accuracy in the real circuit. It actually overshoots a little with 3n3 even though the sim thinks otherwise. Is it because the gain crossing 0 is super high and so I have a high frequency oscillator?

Can someone recommend how I might fix the stability this circuit or improve it in general?
 
For posterity, the following circuit completely resolves the above mentioned stability issue and allows arbitrary input impedance including DC (which is probably necessary for a proper peak detector):

ZTyUqWC.jpg


This is probably overkill for audio but HF performance is much better than the usual simple diode / cap circuit especially with low signal levels where the later is a borderline oscillator.
 
Back
Top