Electronic – Help in finding capacitor and resistor value for discharging circuit

capacitorschmitt-trigger

I'm newish to electronics and I am trying to make a circuit that charges a capacitor, then discharges it when a switch is closed. The signal then goes into a schmitt trigger to be cleaned up. The trigger I was thinking of getting is this

schematic

simulate this circuit – Schematic created using CircuitLab

My question is will this circuit work or have I screwed it up? Also how to I figure out the correct values of the capacitor and resistors? I want the capacitor to charge in around 20ms if that is possible. Thanks

Best Answer

That'll work.

Assuming you want 'reasonable' values, choose R1 somewhere between 1k and 100 kohm. Choose C so that 0.7*R1*C is the time you need. Choose R2 << R1, but at least 10 ohm (to protect the switch from arcing when you use it to discharge the capacitor.

So to charge in 10 seconds (consider that a long time), choose R1 = 100k. Then C is (10/70k) = 150 uF.

Note that capacitors are not particularly accurate (neither is the schmitt trigger), so your results may vary. It's easier to modify R1 to adjust.