Capacitor Discharge: How fast in the circuit below?

Thread Starter

Tonyr1084

Joined Sep 24, 2015
9,744
By now you all should know my math skills are poor at best. I'm modifying a circuit, a "Freezer Door Open Alarm" that when the door is open C1 charges up over X time. When charged it will trigger U1A which triggers FET1 which turns on the SonAlert. The annoyance is that when loading the freezer the alarm can start to squawk. Wifey hates that. At present you have to either close the door or hold SW1 closed and wait for the cap to discharge. If you don't hold the switch long enough the alert starts squawking really soon. X = 42 sec.

In the circuit below I'm adding R3 (100Ω) and D1 (1N4002) to the circuit. SW1 is already present and it's a micro-switch. The question is "How long will one have to hold SW1 in the shown position to discharge (respectively) C1?
Screenshot 2025-06-03 at 8.59.20 AM.png
 
Last edited:

Futurist

Joined Apr 8, 2025
721
Seems to me you have more or less a capacitor 1000 uF in series with a resistor 100 Ohms (that is after making a few simplifying assumptions).

Such an arrangement has a time constant which is often used in problems like this, as a threshold or definition for what "charged" means, it is simply the product of R and C (in suitable units).

https://www.digikey.com/en/resources/conversion-calculators/conversion-calculator-time-constant

Putting your values into the calculator we get 0.1 seconds:

1748964295212.png
As you can see from the graph, after 5 time constants or 0.5 seconds, the capacitor is more or less fully discharged. But the sgnificance of this depends upon the circuits behavior, what does the circuit reared "discharged" to mean?
 
Last edited:

crutschow

Joined Mar 14, 2008
38,316
The discharge time-constant is 100*1000µF = 100ms.
The LTspice sim below shows it reaching 0.67V @ 500ms and 0.50V @ 1s (due to the diode drop):

You could use another 2N7000 to discharge it, if you wanted to go to 0V.

1748965024770.png
 
Last edited:

Thread Starter

Tonyr1084

Joined Sep 24, 2015
9,744
Futurist Thank you. Never occurred to me to search for a calculator. Does D1 (1N4002) change things? If so - probably the change is insignificant. Since the calculator shows 100mS to discharge (respectively) the diode shouldn't make much difference.
 

Thread Starter

Tonyr1084

Joined Sep 24, 2015
9,744
The discharge time-constant is 100*1000µF = 100ms.
The LTspice sim below shows it reaching just below 0.7V (due to the diode drop) at 500ms:
Of course you could add a PB to do that discharge.
Thanks. Yeah, I kind of thought the discharged value would be around one diode Vf.
As for a PB - it's too easy to just touch the door switch (installed ABOVE the freezer) where the whole thing sits.

I'm also considering ordering a 3X (18650) battery holder and upping the voltage. In old age the ears are going poor and hearing the squawking mostly goes unnoticed. Sometimes the freezer door doesn't fully shut because of something blocking it from full closure. and especially on a 9V battery that is probably dropping enough voltage it's getting harder and harder even for the wife to hear.
 

Futurist

Joined Apr 8, 2025
721
Futurist Thank you. Never occurred to me to search for a calculator. Does D1 (1N4002) change things? If so - probably the change is insignificant. Since the calculator shows 100mS to discharge (respectively) the diode shouldn't make much difference.
I expect it to be relevant to some degree, when forward biased it looks like a few ohms but once the voltage across it drops to say 0.6 v it transitions to a very high value resistor, I defer to people more expert though about this like @crutschow
 

Futurist

Joined Apr 8, 2025
721
Thanks. Yeah, I kind of thought the discharged value would be around one diode Vf.
As for a PB - it's too easy to just touch the door switch (installed ABOVE the freezer) where the whole thing sits.

I'm also considering ordering a 3X (18650) battery holder and upping the voltage. In old age the ears are going poor and hearing the squawking mostly goes unnoticed. Sometimes the freezer door doesn't fully shut because of something blocking it from full closure. and especially on a 9V battery that is probably dropping enough voltage it's getting harder and harder even for the wife to hear.
Its' when I see questions like yours that I realize how terribly rusty I am with all this. I studied this stuff full time for two years but that was 45 years ago, my knowledge has become very "gappy" and it helps me to review these kinds of basic questions.
 

Thread Starter

Tonyr1084

Joined Sep 24, 2015
9,744
You could use another 2N7000 to discharge it, if you wanted to go to 0V.
Since it is taking 42 seconds to trigger the alert, going to zero volts probably won't make much difference. Especially if I change from a 9V battery to 3X 18650's.
About 200ms.
t=-RCln(Vf/Vi) = -1 * 100 ohms * 1000uF * ln(0.6V/4.5V) = 0.2s
Hadn't counted on the voltage divider R1/R2 as the cap value. Makes a lot of sense.

Y'see! This is why I ask these questions. I get good logical answers.
 

AnalogKid

Joined Aug 1, 2013
12,043
The charge and discharge times are based on the voltage across the cap. Unfortunately, this changes exponentially, not linearly. The curve is very well known, and anyone who uses it often learns the following shortcuts.

One time constant (TC) equals the resistance (in ohms) times the capacitance (in farads). For your discharge question, that is 100 x .001 = 0.1 seconds. (1000 uF = 0.001 farads)

The time to discharge a cap down to a certain percentage of its max voltage:

1 TC = 63%
2 TC = 86%
3 TC = 95%
4 TC = 98%
5 TC = 99%

Ignoring the diode for now, if the cap is fully charged when the switch is flipped, it will discharge down to 9 - (9 x 0.63) = 3.33 V in 0.1 seconds (1 time constant). At 1/2 second (five time constants), the cap will be 99% discharged.

The real numbers are slightly different because of D1, but them's the basics. With D1 in the circuit, the cap can charge all the way up to 9 V, but can discharge only down to 0.7 V, not 0.0 V. In very round numbers, that is a 10% -ish change in the results.

AND - - - If you move the switch to the GND side of the circuit, you can delete D1.

Give the very large difference between the charge resistance (51,000) and the discharge resistance (100), that is a ratio of impedances of over 500:1. In a circuit with 5% tolerance resistors, you can ignore a 1-part-in-500 error term.

ak
 
Last edited:

Thread Starter

Tonyr1084

Joined Sep 24, 2015
9,744
The charge and discharge times are based on the voltage across the cap. Unfortunately, this changes exponentially, not linearly. The curve is very well known, and anyone who uses it often learns the following shortcuts.

One time constant (TC) equals the resistance (in ohms) times the capacitance (in farads). For your discharge question, that is 100 x .001 = 0.1 seconds. (1000 uF = 0.001 farads)

The time to discharge a cap down to a certain percentage of its max voltage:

1 TC = 63%
2 TC = 86%
3 TC = 95%
4 TC = 98%
5 TC = 99%

Ignoring the diode for now, if the cap is fully charged when the switch is flipped, it will discharge down to 9 - (9 x 0.63) = 3.33 V in 0.1 seconds (1 time constant). At 1/2 second (five time constants), the cap will be 99% discharged.

The real numbers are slightly different because of D1, but them's the basics. With D1 in the circuit, the cap can charge all the way up to 9 V, but can discharge only down to 0.7 V, not 0.0 V. In very round numbers, that is a 10% -ish change in the results.

ak
Thanks for the thorough explanation. Much appreciated.
 

Thread Starter

Tonyr1084

Joined Sep 24, 2015
9,744
Nobody uses MFD anymore ? ? ? Milli-Farads?
1F
100MFD
100,000µF

Why is that? Just a very uncommon farad rating these days?

Gotta go to work now.
 

AnalogKid

Joined Aug 1, 2013
12,043
MFD meaning micro farads is gone gone gone. So is MMFD (micro-micro farads).

These days, thanks to the SI group issuing style guides, capital-M is the prefix for mega, not micro; and the abbreviation for farads is F, not FD. Note that the abbreviation is capitalized because the unit is a person's name, but when spelled out, the full word is not. Thus, uF is the abbreviation for micro-farad. s is for seconds, while S is for Siemens. A three henry inductor is 3H.

mF for milli-farads technically is the correct term. Both 470 uF and 0.47 mF are correct. 1000 uF is not, but everyone does it.

https://en.wikipedia.org/wiki/International_System_of_Units

WAY more than you ever wanted to know: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication811e2008.pdf

ak
 
Last edited:

Thread Starter

Tonyr1084

Joined Sep 24, 2015
9,744
1000 uF is not
So it should show as 1mF? The cap is labeled as a 1000µF, 16VDC. [{(-semantics-)}]
I assumed that the switch would be depressed before, or shortly after, the buzzer went off.

The cap tolerance also matters.
When the door opens, 42 seconds later the alert begins to squawk. If you close the door briefly or reach up and push the switch (easily accessible) for a second the cap should be brought back to nearly resting. Probably because it may still have a residual 700mV stored it might start squawking in 40 seconds. I'm sure the wife can live with that.

Adding another 2N7000 is less practical than a diode and resistor. Even with the FET (I know I need to redraw it properly) I'd still probably put a resistor in series. Maybe not 100Ω, maybe 47Ω. Little quicker drain and still not blast the FET with a sudden rush of current.
 
Top