Peak Detector while Arduino is asleep

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.

97702195816995fcc602e7f6eb5a114f

The parameters aren't perfect, I added what I've seen from the datasheet but some are missing.

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?

What capacitor type are you using? Your schematic shows an electrolytic; these are leaky.

COnsider a different type of capacitor will help, e.g. polystyrene, solver mica, polypropeline or PTFE. IIRC these are all low leakage types.

FEATURES

  • Input Bias Current 100 fA

Really consumption due to IC opamp should not be.

Perhaps tantalum capacitor might be interesting in this application.

1 Like

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.

1 Like

Thank you guys, I will check out different capacitors. That is the default capacitor in ADS. I might have to use it and change parameters

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...

1 Like

Thank you, I will try to experiment with different capacitors and come back. ADS only seem to have the electrolytic capacitor symbol to use

Electrolytic - small wonder it leaks so much. I would use a poly film cap. With that, you could probably reduce the value by 100x.

An after thought - when and how do you want it to discharge? :slight_smile:

1 Like

I'm thinking about using a MOSFET that switches on when the Arduino awakens from sleep!

Then you have to watch out for leakage there, too.

If the voltage is no more than the 5 V supply, a 74HC4066.

1 Like

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

1 Like

a 74HC4066.

Does that have an output enable Paul?

This device is shown as having a max gate leakage of <50nA at 25C

BTW I wondered about using schottky diodes in the ciircuit but their leakage is much greater than silicon junction diodes

It doesn't have an output! :grin:

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. :+1:

1d28ef0539f37e5ede477f46ad03e545
5405d0be9a16e21f84ef999e7efe50dc

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

https://www.electronics-tutorials.ws/rc/time-constant.html
image

2 Likes

The wonderful thing about a simulation is that it can provide you with things like a signal source with zero internal resistance. :slight_smile:

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.