# Capacitor to discharge upon switch open

Update Please evaluate this third attempt: This is my first electrical project, so please be gentle with me. I know very little about electronics.

I'm building a machine that has a crank that users pull. The ideal behavior is that when a user releases the crank from its lowered position, the circuit will drive the load (represented by the lamp) for a few seconds, then turn off. Translated: When S1 is first opened, C1 drives X1 for a few seconds, then X1 shuts off. When S1 is closed momentarily, the cycle repeats. To be clear, X1 isn't driver while S1 is closed. I expect that there are better solutions with a different type of switch than S1 (instantaneous button), but in the greater mechanical context, it seems like the only practical choice for the project.

Here's a diagram of my first attempt at the circuit. Please ignore the actual quantitative values, I just want to get the circuit working conceptually. Please let me know if I got the diode directions right. Also, the load is actually a relay, I just wasn't able to find the symbol for that.

My conception is that when S1 is closed, C1 charges via D1. When S1 opens, C1 discharges via X1. I think the main weakness is that C1 is connected in parallel with the short circuit to V1. What do you think?

2nd attempt:

• In your circuit, C1 is in parallel with D1. When S1 is closed, it puts a short circuit across the battery. Things to the right of C1 will never receive power. Jan 18, 2020 at 16:42
• Yes, short circuit is a problem. Pushing button will short circuit the voltage source, so the rest of the circuit does nothing. Jan 18, 2020 at 16:43
• Hi Peter, I figured that'd be the case. Would it work if I were to eliminate that connection that puts them in parallel? ie remove the wire that starts at the junction between S1 and C1. Jan 18, 2020 at 16:47
• The second attempt does charge up the capacitor via diode D1 when button is pushed. When released, capacitor stays charged forever. Lamp never lights up, the D2 is always blocking current. Jan 18, 2020 at 17:00
• I suspected that too. Could I ask for suggestions on what to do? Jan 18, 2020 at 17:11

We can simplify your requirement specifications with a simple timing diagram.

           __                    __________             __    __
Button ___|  |__________________|          |___________|  |__|  |_________
_____                         _____          __    _____
Output ______|     |_______________________|     |________|  |__|     |___


Figure 1. Timing diagram. This shows us that the load is off while the button is pressed and turns on for a preset time when the button is release unless the button is pressed again (as shown on the right of the diagram).

The challenge, as you have discovered, is to do this with a single-pole, single-throw (SPST) switch or simple push-button. A common solution to the limits of a switch - it might not have adequate current or voltage rating or may have the wrong contact arrangement - is to use a relay.

simulate this circuit – Schematic created using CircuitLab

Figure 2. Using a relay to convert an SPST button into a SPDT (single-pole, double-throw) device.

How it works: