# Calculate time on power on delay

I am trying to make a time delay circuit (see the image) in which when press a momentary button the relay will stay open for a specific time. I tried my circuit but I cannot calculate the time (I tried the T=RC formula and it did not work). Does anyone knows how I can achive something like that to stay open for a specific time?

• The 1N4007 is a mistake - short it out. Commented Mar 1, 2020 at 16:02
• You need a resistor in series with the cap. With an ideal +12V source, your delay is zero with what you have shown. And like Andy said, the diode serves no purpose. Commented Mar 1, 2020 at 16:06
• The diode will tend to led the MOSFET turn on but prevent it from turning off as the MOSFET gate won't be able to discharge. "... and it did not work" is not useful in helping us to debug your circuit. How does it not work? Hit the edit link below your question ... Welcome to EE.SE. Commented Mar 1, 2020 at 17:34
• @Transistor You are right, I should give more information about what went wrong. Saying it did not work I mean that the occured by the calculation was not the same as the time occured on the circuit. On the circuit the relay was on for much longer time Commented Mar 1, 2020 at 23:06
• Thank you all for replying!!! Commented Mar 1, 2020 at 23:06

I think this is more what you are looking for:

simulate this circuit – Schematic created using CircuitLab

R2 provides a path to discharge the gate charge of M1. R2 is effectively in parallel with R3 etc. so the time will be a bit less as a result.

R1 limits the charging current of the capacitors so it does not damage the switches or pull the power supply down.

D2 is a catch diode to deal with the inductance of the relay coil (as M1 turns off slowly anyway in normal operation, so it may not be an issue, but if the gate of M1 was shorted to ground the voltage at the drain would rise high enough to avalanche the MOSFET most likely, which isn't great).

• Thank you so much mate. Both schematics are really close to what I am looking for. So in this case let's say on the c1 capacitor the power on time is T=2.2mF*(15kΩ+100kΩ)? Commented Mar 2, 2020 at 0:28
• The resistance is 15K || 100K or 15K*100K/(15K+100K) = 13K. The time will be approximately some number K T ~= K * R *C, but K may not be exactly 1, depends on the MOSFET, supply voltage and relay characteristics. This is not a very precise circuit. Commented Mar 2, 2020 at 0:53

I put the diode there because I want to put 3 different combinations of R and C and 3 buttons in order to have 3 different time delays (30, 60, 90 seconds). So i thought that when i press a button, a specific capacitor discgarges and the other 2 will charge, so in order to prevent this I put the diode on the way to the gate (1 diode after each R-C combination).

That was a nice try but the problem is that the MOSFET has an extremely high input impedance and a little bit of capacitance. It doesn't behave like a regular transistor whose charge will leak away through the base-emitter junction. The gate behaves more like a small capacitor so charging it up through the diode will work fine but you won't be able to discharge it. Your RC circuit will decay but the MOSFET will stay on.

simulate this circuit – Schematic created using CircuitLab

Figure 1. A three-input OR arrangement.

At the expense of two more MOSFETs you can solve the problem. You can also use the diode to act as a snubber to prevent the relay damaging the MOSFETs at switch off.

• And how I will calculate the power on time? Also could you please explain what the snubber is? Commented Mar 1, 2020 at 23:58
• Power-on time will be approximately given by the time constant, $\tau = RC$. Remove the diode from your first circuit and take some measurements. You'll find plenty of material on a web search for "snubber diode". Commented Mar 2, 2020 at 0:02
• OK thank you very much for your time. I will check it out Commented Mar 2, 2020 at 0:05