Hi!
I'm trying to design a peak detector circuit that hold the maximum voltage while the Arduino Nano is asleep, up to 8 seconds. The problem I run into is that the capacitor discharges too fast.
I know what I need is:
A capacitor large enough to hold the charge for up to 8 seconds but small enough to detect 10 kHz changes
Op Amp that outputs large enough currents to charge the capacitor fast
I've tried using the LMV796MF operational amplifier with output current of up to 60 mA without success. Here is circuit and simulation results.
What kind of capacitor? For sample and hold circuits, I've seen some specific recommendation about cap types (polystyrene comes to mind). I didn't look up your opamp, is it a JFET input amp?
The LMV796/LMV796Q family provides optimal performance in low voltage and low noise systems. A CMOS input stage, with typical input bias currents in the range of a few femtoAmperes, and an input common mode voltage range, which includes ground, make the LMV796/LMV796Q and the LMV797 ideal for low power sensor applications.
I think the capacitor is the likely culprit. However don't forget that the DIODE1 also has leakage. I think, increasing the capacitor value is not a good way to go, if you can help it. I would try to reduce it if anything...
The LMV796MF (its CMOS) looks to be ideal for your application, with very low input current (0.1 nA) and Iout up to 60mA.
The IOS you have set in the simulation is wrong. Also the op amp will need to drive 100mA to capture a 10kHz pulse.
RCOM may also be at fault - 1G is probably more sensible.
The value of R2 also looks to me to be WAY too big.
We dont know what parameters the simulation is expecting of a 1uF electrolytic, but again the value is too big.
Try an 0.1uF
then from Cv=iT you should see a change of dV /dt = 0.1 * 10^-9 /0.1 * 10^-6 = 1mV /sec
if my math is right (ignoring cap and diode leakage).
IF charging is too slow you could even use a smaller capacitor; or look at this modification of the circuit to give more charging current
It is simply a switch - bidirectional - either pin is input or output as you choose. It has four switches with a single switch control pin for each - "enable" if you wish to call it such.
I changed RCOM, IOS, capacitor value and resistor value. It looks much better now, it does not discharge as fast as before! Still would like it to hold the top value longer...
Can't seem to find how to change the capacitor type in ADS
Thanks @Paul_B my mistake I'd picked up a hex buffer datasheet somehow!
Leakage current +_1ua max is probably just they didnt bother measuring smaller than that!
You are seeing about 100mV / sec which I just dont believe (I've build these circuits over 30 years ago and was getting MUCH better results with components available then)
I also dont beilieve the charge time is so quick. It NEEDS to be, because to get a value close to the peak on a single pulse with respectable accuracy you need >5T
Don't forget to consider the internal resistance of the capacitor, electrolytic models usually have a high ESR compared to Tantalum, which has models with milli ohms of ESR, unless the resistance of the RC circuit has a very high value. I have also seen that electrolytic capacitors have suffered an increase in the ESR value as a function of time of use.