# How robust and stable is this circuit?

I have a small delay circuit to automatically open my building door by pressing the intercom button for a few seconds.

Whenever the intercom button is pressed the switch closes and the cap starts charging. At about 4.1V charge it triggers the op amp which closes the relay, operating the door.

Will this work in real life? I created a similar circuit with two stages of npn and while it worked for a few years, it started to degrade and the delay was reduced from 3s to about 1s.

I hope that by using a smaller cap (maybe even ceramic?) and removing the BJTs the circuit will last longer without deviations from whatever time constant I set.

Also, I've seen similar circuit with a BJT at the output of the op amp. Is there a reason a simple diode will not work? Will the BJT help protect the diode?

• What's that IC? IF it's a comparator, you're good to go. If it's an Op-amp, replace it with a comparator. Commented Dec 29, 2021 at 1:14
• 1. Why have you got 5 ohms in the negative supply? 2. The diode should be parallel to the relay coil, not in series. 3. You have no decoupling capacitor. 4. How quickly do you need the circuit to rest when the button is released? (You have no discharge path for the 22 uF capacitor.) Commented Dec 29, 2021 at 1:23
• To get controlled hysteresis: swap opamp inputs.add a resistor from OA out to OA inverting to provide hysteresis.change relay to ground. Reverse relay diode. Commented Dec 29, 2021 at 3:24

To sum up what others have said and add more points:

• You should use a comparator or a Schmitt trigger instead of an opamp
• The diode should be in parallel to the coil and in reverse, with the cathode going to the supply voltage and the anode going to the comparator. This is called flyback diode and its job is to protect the comparator from coil back EMF
• The capacitor needs a discharging resistor. Make sure it's greater than 470k so that the capacitor has a chance to reach the desired voltage. You may need to reduce the value of the 100k charging resistor
• Electrolytic caps lose capacitance over time, so using a ceramic one is a better idea
• Check the datasheets of your comparator and relay and see if your comparator can sink enough current for your relay. If it can't, you'll need a small BJT (don't forget the base resistor) or MOSFET
• If your circuit switches several times back and forth while the capacitor voltage is crossing the divider voltage, you need to add hysteresis with a Schmitt trigger. You can get an IC for that or build it using a comparator by adding a resistor - you can find more information and calculations online
• Lots of great points, especially I didn't think about needing a BJT to sink more current. I'm not familiar with comparators but will try and learn about them. Commented Dec 29, 2021 at 17:32