Electronic – Using op-amp and diode switch to drain capacitors – how to limit current

capacitorcurrentdiodesoperational-amplifierswitches

enter image description here

I want to use a diode switch to drain a capacitor. The switch in the circuit is opened and closed regularly. The op-amp will flip between ground potential and 5V at its output. When the output is low, the capacitor gets drained through D1. Do I need R2 and if so, how do I calculate its value based on the op-amp (and diode?) characteristics? Does it simply depend on the maximum output current of the op-amp, so if e.g. the maximum is 50 mA, I'll use a 100 Ohm resistor for R2?

Best Answer

I just wanted to point out two small things about your current approach, that probably you already noticed:

  • The maximum current you can sink is limited by the opamp
  • The minimum voltage you can discharge the capacitor down to, is limited by the forward voltage of the diode
  • The continuous power rating of the current limiting resistor must not be exceeded

As for resistor value, you have some limits that you have to ensure:

Limiting the current of the opamp: $$R>\dfrac{V_{CAP}(0)-V_D}{I_{MAX}}$$

Ensuring that the resistor is not operating out of spec $$R\ge\dfrac{V_{CAP,RMS}²}{P_{RATED}} = \dfrac{-2t}{C\cdot \ln\left(1-\dfrac{2tP_{RATED}}{V_{CAP,0}²\cdot C}\right)}$$

Ensuring that the capacitor is discharged before the beginning of the next cycle $$R\le-\dfrac{t}{C\cdot \ln(V_D/V_{CAP,0})}$$

Where:

  • \$P_{RATED}\$ is the continuous pulsed power rating of the resistor
  • \$t\$ is the length of each discharging cycle
  • \$V_{CAP,0}\$ is the maximum / initial charge of the capacitor
  • \$V_D\$ is the forward voltage of the diode

Try to select a resistor which fulfills all requirements above and it should cover the most critical cases.