2
\$\begingroup\$

I'm trying to design a peak detector which can be cleared by using an pin on the arduino. To design the peak detector I was following this guide-How to make a peak detector circuit. I used the circuit shown in that post and it works fine.

I made some changes to the circuit to use mosfet as switches in order to clear the peak value stored and another mosfet to allow the output to the stored value for certain times. Circuit The switch s1 is used to clear the stored value and the output across load r2 appears when the clock u1 is high The output waveforms

The problem: Now the problem i'm running into as you can see from the graph is once the switch s1 is closed and opened again, the peak detector stops working. Also how do i remove the spikes appearing at the output whenever the clock u1 is switching?

\$\endgroup\$
2
\$\begingroup\$

Issue 1, you need a pull-down to ground on the gate of Q1. Mosfets have a high gate capacitance, than needs to be drained. This is a problem with your switch design that will not appear if the switch is replaced with the pin from the micro.

Issue 2, is also caused by mosfet capacitance. (You should also change Q2 to a p-channel.) Also it is not uncommon to add a low pass filter in the output stage of peak detectors to limit spurious switching signals. However, the spikes you see may be more the simulator than reality. Real clock signals do not have infinite rise times.

It's also not a good idea to short the output of the first op-amp like that. Add a small resistance after the diode and before the holding capacitor line.

\$\endgroup\$
  • 1
    \$\begingroup\$ Thank you! I've included a path for the capacitance to drain and those spikes are gone. Another thing i wanted to know is do you have any suggestions for schottky diodes? part number? The peak detector i'm building will have a max peak of around 1V so silicon diodes are not feasible. \$\endgroup\$ – Abhishek K Mar 20 '17 at 15:06
  • \$\begingroup\$ Maybe a 1n5817. however, you do understand the feedback circuit is supposed to nullify the diode voltage. \$\endgroup\$ – Trevor_G Mar 20 '17 at 15:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.