# valley peak detector

Discussion in 'General Electronics Chat' started by franky_acc, Apr 15, 2014.

1. ### franky_acc Thread Starter New Member

Jan 23, 2014
20
0
I hope I have posted in the correct forum.
I am trying to create a simple valley peak detector. I have been able to make a positive peak detect using a zener and or schottky diode. I would like to build a valley PD using a zener or shcottky.

The circuit for postive peak detect is like this: http://www.allaboutcircuits.com/vol_3/chpt_3/5.html

thanks,
Frank

2. ### daviddeakin Active Member

Aug 6, 2009
207
27
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.

3. ### MrChips Moderator

Oct 2, 2009
12,625
3,451
Invert the signal and use a peak detector.

4. ### franky_acc Thread Starter New Member

Jan 23, 2014
20
0
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.

5. ### franky_acc Thread Starter New Member

Jan 23, 2014
20
0
Hi Mrchips,
Unfortunately I can't do that with what I'm doing.

6. ### ronv AAC Fanatic!

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

7. ### MrChips Moderator

Oct 2, 2009
12,625
3,451
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.

8. ### franky_acc Thread Starter New Member

Jan 23, 2014
20
0
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.

9. ### AnalogKid Distinguished Member

Aug 1, 2013
4,687
1,297
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

10. ### franky_acc Thread Starter New Member

Jan 23, 2014
20
0
How will this work if the op-amp is a single supply (0-5V) and has to be a single supply?

11. ### praondevou AAC Fanatic!

Jul 9, 2011
2,936
489
Is this homework or an actual project?

Can a subsequent valley only be lower than the previous one or can it be higher too?

AND, do you need cycle by cycle valley detection?

12. ### daviddeakin Active Member

Aug 6, 2009
207
27
OK, here's one method that may work for you:

File size:
15.2 KB
Views:
38
13. ### franky_acc Thread Starter New Member

Jan 23, 2014
20
0
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?

File size:
14.2 KB
Views:
23
14. ### franky_acc Thread Starter New Member

Jan 23, 2014
20
0
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?

15. ### AnalogKid Distinguished Member

Aug 1, 2013
4,687
1,297
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: Apr 16, 2014
16. ### franky_acc Thread Starter New Member

Jan 23, 2014
20
0
Okay, I think this works.

17. ### praondevou AAC Fanatic!

Jul 9, 2011
2,936
489
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.