valley peak detector

daviddeakin

Joined Aug 6, 2009
207
Assuming your input signal is pure AC (swings positive and negative) then you can simply reverse the diode. (You will have to reverse the capacitor too if it is a polar type). This will produce a negative DC voltage equal to the negative input peaks (minus the diode drop).

But if you want the negative peaks to produce a positive output voltage then you will need some sort of inverting amplifier before the peak detector.
 

Thread Starter

franky_acc

Joined Jan 23, 2014
20
Assuming your input signal is pure AC (swings positive and negative) then you can simply reverse the diode. (You will have to reverse the capacitor too if it is a polar type). This will produce a negative DC voltage equal to the negative input peaks (minus the diode drop).

But if you want the negative peaks to produce a positive output voltage then you will need some sort of inverting amplifier before the peak detector.
Hi David,
I've tried that but it doesn't work. I am using a sinusoid (where the wave is all in the positive range or above 0V) by the way.
 

ronv

Joined Nov 12, 2008
3,770
Is your objective to know the peak to peak value of the sine wave or know the DC level of the peak and valley?
 

MrChips

Joined Oct 2, 2009
30,706
Hi Mrchips,
Unfortunately I can't do that with what I'm doing.
Sure it can be done. You just need to know how to do it correctly.

Suppose your peak is 4V and the valley is 1V.

Invert the signal. The peak becomes -4V and the valley is -1V.

The peak detector will peak at -1V.
 

Thread Starter

franky_acc

Joined Jan 23, 2014
20
Is your objective to know the peak to peak value of the sine wave or know the DC level of the peak and valley?
Hi Ronv,
I need to know the DC level of the valley. Also, inverting the signal so I can do a positive peak detect is not allowed. Another thing is the DC level will eventually have to discharge because the valley may change(get closer to 0V) on the next sine wave cycle. Basically I want to follow the largest valley.
 

AnalogKid

Joined Aug 1, 2013
10,986
It sounds like you have a positive power supply only, rather than +/-. If so, try this.

Your positive peak detector works by charging a capacitor up from GND to the sine peak (minus Vf of the diode). If the next few peaks are lower, the cap self-discharges down to that level. If you want the cap to track more quickly, you add a resistor in parallel with the cap.

A negative peak detector will work the same way if you connect the "bottom" of the cap to Vcc and reverse the diode. Now the cap is charged "down" by the negative peaks of the sine even if those peaks are above GND, and the caps leakage current (or parallel resistor) discharges the cap to track changes greater than a certain time constant.

ak
 

Thread Starter

franky_acc

Joined Jan 23, 2014
20
Sure it can be done. You just need to know how to do it correctly.

Suppose your peak is 4V and the valley is 1V.

Invert the signal. The peak becomes -4V and the valley is -1V.

The peak detector will peak at -1V.
How will this work if the op-amp is a single supply (0-5V) and has to be a single supply?
 

Thread Starter

franky_acc

Joined Jan 23, 2014
20
This is the circuit, positive PD, I was working with and wanted to convert to a negative pd.
So the signal is a sine wave that osculates above 0V and has a 1Vp-p.

@praondevou: its a little project. Yes, needs to detect every cycle. But I don't want to go there right now since I can't even get a neg PD.

@analogkid: Yes, only have a positive PS. So the capacitor needs to be electrolytic?
 

Attachments

Thread Starter

franky_acc

Joined Jan 23, 2014
20
It sounds like you have a positive power supply only, rather than +/-. If so, try this.


A negative peak detector will work the same way if you connect the "bottom" of the cap to Vcc and reverse the diode. Now the cap is charged "down" by the negative peaks of the sine even if those peaks are above GND, and the caps leakage current (or parallel resistor) discharges the cap to track changes greater than a certain time constant.

ak
I tried this. It didn't work. Please see my configuration in my previous post. In there it shows the diode cathode pointing to right. But on my Bboard it is pointing to left to get the neg pd.
With the configuration you suggested, what is connected to gnd?
 

AnalogKid

Joined Aug 1, 2013
10,986
Only the capacitor, as in post #12. When the circuit starts there is zero charge in the capacitor. With only the diode reversed, it never can increase the charge to equal the negative peaks, which are above ground in your application. With the resistor tied to Vcc, it supplies the charge and the diode *dis*charges the capacitor down to the negative peak voltage.

ak
 
Last edited:

praondevou

Joined Jul 9, 2011
2,942
Okay, I think this works.
The 100k will charge the cap again after the sine wave comes out of the valley.
Depends on how much ripple you accept on the capacitor. Increasing the 100k will lower the ripple but it will take longer to get up from a lower valley to a higher valley (or from zero to the first valley)

Depends on your project.
 
Top