# How to discharge a capacitor being charge by an op-amp?

I've only shown a very small part of the circuit (if the rest of the circuit matters I can show the rest - diodes are used to maintain the charge acorss the capacitor).

Background:

The capacitor is constantly getting charged by the op-amp, i.e. the capacitor is initially at 0v, and keeps getting charged (without losing its charge) up to a peak value and it stays at the peak voltage. The peak value is determined by the power supply of the op-amp (In my case this is 15v).

Problem:

What I've been trying to do (without much success) is find a way to discharge the capacitor to 0v (ground it, or just really close to ground) really quickly, and allow it to get charged up again, similar to a relaxation oscillator.

What I've Tried:

I've tried using a UJT, PUT, SCR, and interesting transistor combinations. I can always seem to ground the capacitor really quickly once it reaches a certain voltage, but I as do, it doesn't charge up again (I think it's because I also end up grounding the op-amp, but I'm not too sure). I can show them if need be.

Please help:

It would be great if there was a way to discharge the capacitor once it reaches a certain voltage, and once it has been fully discharged, allow the op-amp to continue to charge it up again. Is this actually possible to achieve with this setup? Or is it inherently not possible? I'm hoping to try and find solutions using purely analogue components (transistors, capacitors etc)

Thank you!

Edit:

Full Circuit (Simplified a bit)

It uses a diode pump to charge up the capacitor in steps.

• What's the purpose of the circuit? What are you ultimately trying to accomplish (to measure, or to amplify, or to detect, etc)? It might help if we can look at the rest of the circuit. – Nick Alexeev Apr 25 '18 at 17:57
• I've added the full circuit. I'm basically trying to create an oscillator. – Physco111 Apr 25 '18 at 18:14
• Use a push button. Once you understand how it works, replace with a mosfet. – Gregory Kornblum Apr 25 '18 at 18:22

## 1 Answer

This is problem that generally occurs whenever you implement an analog integrator.

Analog switch across the capacitor, or a relay (with a small resistance in series). Ideally stop the current into the amplifier so the switch resistance does not compromise the reset.

For example, here is an analog switch suitable for +/-5V supplies that is less than 6$\Omega$ when on, and incorporates level shifting.

There are various analog switches available, some with logic level shifting, some without, some will tolerate 5V or less, some +/-15V. Charge injection (typically in the pC range) may be important if your capacitor is relatively small because the charge injection will affect the capacitor voltage when you open the switch. Generally speaking, the lower voltage your supply rails, the lower switch resistance is possible.

Another possibility is to close the loop around the integrator and drive the output voltage to zero, but you're probably looking at analog switches again. This is done in some meter chips.

Edit:

This is what an analog switch looks like internally, two MOSFETs with inverse drive:

Note that the body connections are not to the source as usual for discrete MOSFETs.

• Thank you for the answer! I don't quite understand what you mean by 'Analogue switch across the across the capacitor' What would this look like? And when you mean by stop the current to the amplifier? – Physco111 Apr 25 '18 at 18:00
• @Physco111 That thing in the ADG601 schematic that looks like a switch- connect one side to one end of the capacitor and the other side to the other end. If the supply voltage is higher than +/-5V use a different switch. By 'stop the current to the amplifier' (integrator)- I mean whatever is off to the left in your circuit. Otherwise you'll get an offset of ~Iin* Rswitch once it settles down. With a 6 ohm switch and reasonable current, that isn't much voltage. If it's a 1K switch and 1mA it's significant. – Spehro Pefhany Apr 25 '18 at 19:26