Is there a simple way to discharge a bipolar capacitor using a 5V signal and a MOSFET/BJT?
Reset Switch

You should not use discrete MOSFETs for this due to the body diode. A single SPST analog switch such as the DG417 or DG9421 would be ideal for this task. These devices have a logic-level threshold and can operate over a wide voltage range due to the fact that they utilize a transmission gate.

Just one caution: you will probably want to place a resistor in series with the switch so that you stay within the maximum power rating of the part.



Zeroing the output

I would not recommend grounding the op-amp's output. Although most small op-amps will survive this, you have to consider what happens when you switch off the op-amp. During reset, the output stage will most likely saturate. This saturation will "carry" over into the next integration cycle, causing a large (and unpredictable) voltage spike as the op-amp tries to compensate for the sudden change in output current. Instead, I recommend one of the following options.

Option 1: use a smaller resistor on your reset. This will not actually zero the output. I would recommend a 220Ω resistor, since it limits the current to 100mA (the maximum 1ms pulsed current rating for the DG417) when combined with the switch resistance. This is a worst-case calculation (24V across the capacitor).

\$ I = 100\mathrm{mA} = \frac{24}{20 + 220} \$

Note that the 100mA pulse will be much shorter than 1ms. In this case the time constant during discharge is 240μs. Also, this does not actually zero your output: it forms a low-pass filter with a cutoff at 660Hz and -12dB DC gain.

Option 2: if you really need the output to stay at zero, you can always add an SPDT analog switch (such as the DG419) between the input resistor and inverting input of the op-amp. Your circuit would then look something like this:







simulate this circuit &ndash; Schematic created using CircuitLab

If you are very concerned about transients (you probably aren't), you could use a DPDT switch that connects your input resistor to ground separately, so that the previous stage sees a constant load.



Component selection

As @Sunnyskyguy EE75 mentioned in the comments, you are going to have trouble finding a 1μF capacitor that works well in an integrator. Due to a variety of factors (dielectric absorption, leakage, temperature variations, etc.) it is best to use either a plastic film (PP/PS/PPS) or Class I ceramic (C0G/NP0) capacitor. These are generally limited to fairly small values (10s of nF max). Thus, you will want to use a smaller capacitor and larger input resistor.

One small warning: as the input resistor value increases, the input bias current of the op-amp becomes more and more significant. Using the OP07C as an example (\$I_B\$ of ±7nA), a 1MΩ input resistor will result in a 7mV offset between the op-amp terminals. This is an order of magnitude higher than the input offset voltage of the OP07.