How to calculate capacitor discharge time

Discussion in 'General Electronics Chat' started by Guest3123, Mar 31, 2016.

  1. Guest3123

    Thread Starter Member

    Oct 28, 2014
    312
    18
    I would like to know how to calculate capacitor discharge time.

    EC=IT
    E x C = I x T
    Voltage times Capacitance = Current times Time
    The max voltage across the capacitor is 7 V (9 V battery minus the LED Vf)
    C = (I x T) / E
    C = (.02 x 3) / 7.0 = 0.0086 = 8600 uF

    The resistor is calculated using Ohm's Law.
    R=E/I
    Resistance = Voltage divided by Current
    R = 7 / 0.02 = 350 ohms

    Explains how to find the capacitor needed to discharge the voltage threw the LED. I got that.. But how do I find out how long it will take for a capacitor, resistor to discharge the voltage?

    Like for instance, this guy..


    His parts.. 1000uF, or 0.001F Capacitor, 9v battery, and a 22k Ohm Resistor. The LED is red, which means it's 0.02A (20mA), and has a forward voltage of 2Vdc.

    Finding the resistor for the LED.
    9Vs - 2Vf = 7.0RVd
    R = 7RVd / 0.02If = 350Ω


    But I'm lost.. How do I figure out how long the LED will stay lit..? I know how to find the capacitor value for the RC Circuit I have.. But I don't know how to find how long the LED will stay lit, if I have a capacitor, and know the values of the component.

    He says in the comments, that it will still be lit, even after 10 minutes.. Wouldn't you need a higher capacity capacitor to do stuff like that?

    10 Minutes x 60 Seconds = 600 Seconds.
    0.02A x 600 = 12
    C = (0.02A (If) x 600s) = 12 / 7Vdc (Vf) = 1.71 Farads !!!!

    That's EXPENSIVE !!! But he's not using a 1.71 Farad capacitor.

    http://www.mouser.com/ProductDetail/Cornell-Dubilier/DCMC175U16FG2D/?qs=zv9oXRM5khgxb9WM9DbwmA==

    It's $141.55 for a 1.7 Farad capacitor.
     
  2. #12

    Expert

    Nov 30, 2010
    16,346
    6,833
    The basic equation is E0 = DE x e^-(time/RC)
    The new voltage equals the change in voltage times e(the natural log base) to the negative (time over RC)
     
  3. MrChips

    Moderator

    Oct 2, 2009
    12,449
    3,368
    As the capacitor discharges, the voltage drops and so does the current.
    The LED will still be visibly lit even when the current falls below 1mA.
    Using the formula t = RC is a quick estimate but the LED will stay lit for much longer.

    The R in this calculation has to include the effective resistance of the LED which turns out to be non-linear, i.e. the LED resistance increases as the voltage gets lower.
     
  4. Guest3123

    Thread Starter Member

    Oct 28, 2014
    312
    18
    I don't understand.
     
    Last edited: Mar 31, 2016
  5. dannyf

    Well-Known Member

    Sep 13, 2015
    1,835
    367
    The charge up and discharge voltage is exponential.
     
  6. MrChips

    Moderator

    Oct 2, 2009
    12,449
    3,368
    AAC is an educational site on all things electrical and electronic. Experienced members are here to help you. There is never a dumb question. The question usually reflects the level of knowledge of the person posting the question.

    Learn to be humble. This is a public forum. Don't go being rude or mouthing off your displeasure at answers provided. Your comments will come off as being rude and offensive.

    Your lack of understanding of the word exponential indicates your knowledge level. That's ok. Don't defend or attack it or make disparaging remarks about it. This is not Google or Wikipedia. Go look it up and come back with your questions for clarity.

    It is almost impossible to explain and determine the discharge characteristics of an RC circuit without applying the exponential equation.

    Time Constant = R x C is a direct result of applying the exponential equation. It does not provide exact information about anything to do with the LED. Moreover, it involves a rather strange mathematical constant called euler's number which happens to be equal to 2.718281828459045235...

    In your situation, R is the resistance of the resistor plus the resistance of the LED.
    The resistance of the LED is changing. There is no simple way of calculating the resistance of the LED.

    The bottom line here is there is no simple formula for calculating how long the LED will stay lit.
     
  7. blocco a spirale

    AAC Fanatic!

    Jun 18, 2008
    1,440
    368
    This is your problem; You believe that there is an obligation on the unpaid forum members to provide the answers you want in the format you want.
    Why would you expect anything from a free forum?
    Why would you criticise someone for taking the time to reply to your post?
     
    Last edited: Mar 31, 2016
    cmartinez likes this.
  8. shortbus

    AAC Fanatic!

    Sep 30, 2009
    4,019
    1,540
  9. MrChips

    Moderator

    Oct 2, 2009
    12,449
    3,368
    When you watch a YouTube video you don't have the opportunity to say, "Stop, I don't understand what you are saying or showing me."
    You cannot often do this within a website.

    That is the beauty with a forum such as AAC. You can get personalized one-on-one tutoring within hours or even minutes. We don't know what is your level of knowledge or experience. It is up to you to say what you know and what you don't know or don't understand. That way the answers and instructions can be tailored to you specifically. Being frustrated and making off remarks will simply discourage anyone from wanting to provide assistance.

    Here is a simple exercise.

    Assume we have a 1Ω resistor connected to a variable voltage DC power supply.
    Set the power supply to fixed voltages, increasing from 0V to 10V in 1V steps. Measure the current through the resistor at each voltage setting.
    Write the values of current and voltages in a table form as follows:

    Voltage (V) Current (A) Power (watts)
    0 0
    1 1
    2 2
    3 3
    4 4
    5 5
    6 6
    7 7
    8 8
    9 9
    10 10


    Get a sheet of graph paper (checkered paper) and draw a graph of I along the vertical axis and V along the horizontal axis.
    Now calculate the power dissipated by the resistor using Power = Current x Voltage.
    Write down the Power vs Voltage and plot the Power vs Voltage graph.

    Note the difference in shape of the two graphs you have drawn.
    Describe in words what you observe and the difference between the two graphs.
     
  10. wayneh

    Expert

    Sep 9, 2010
    12,154
    3,061
    For a capacitor, the voltage and retained charge are always related to each other.
    V = Q/C​

    The current leaving the capacitor, which is charge leaving the capacitor and flowing in the rest of the circuit, depends on the voltage and the resistance in the circuit.
    -dQ/dt = I = V/R (note the sign, positive current out of capacitor causes Q to decrease)​

    At any one moment we can assume the resistance R is nearly constant, but it changes overall because of the LED.
    R = ƒ(I)​
    Let's ignore that complication but just remember that it will cause the LED to stay lit a bit longer than whatever we calculate.

    We're left with a complicated relationship where the current depends on the instantaneous voltage, which is turn depends on how much current has already flowed out of the capacitor. The solution to that is to integrate a differential equation.
    -dQ/dt = I = V/R = Q/RC
    -dQ/dt = Q/RC
    dQ/Q = -dt/RC​
    after integration:
    lnQ = -t / RC - lnQ0
    Q/Q0 = EXP(-t/RC) = V/V0 = I/I0 ~ LED brightness/starting brightness​

    The product of RC is called the time constant, since both R and C are assumed constant and their product is in units of inverse time, eg. sec^-1. When the elapsed time t is equal to one time constant, Q/Q0 will be 37%. Each successive time constant will shave off 63% of the remaining voltage. The time constant resembles the "half life" commonly used to describe radioactive decay, but is a bit longer.

    After 3 time constants, the remaining charge, voltage and current will be just 5% of the starting values. That's about when things will fall apart and the assumption of constant resistance will become invalid.
     
  11. dannyf

    Well-Known Member

    Sep 13, 2015
    1,835
    367
    The voltage rise or decline across a capacitor is proportional to the current going into or out of it, divided by the capacitance. With those two numbers you can estimate how long it takes to get to the desired voltage.

    Linear approximation will typically get you into the ball park.
     
  12. MrChips

    Moderator

    Oct 2, 2009
    12,449
    3,368
    The problem is the TS (and anyone else) does not know the discharge current.

    Look at the example shown in the video.

    The supply voltage is 9V. The series resistor is 22kΩ. Hence the maximum allowable current is 9/22k = 0.4mA.
    If we assume the voltage drop across the LED is 2V, we revise our current estimate to 7/22k = 0.3mA. But this is only a guesstimate. In order to determine the exact current one would have to know the I-V characteristic (which is an exponential equation) of the LED.

    The full charge on the capacitor is Q = C x V = 1000μF x 9V = 0.009Coulombs
    If we were to discharge the capacitor completely by drawing 0.3mA constantly, the time taken = 0.009/0.0003 = 30 sec.
    So let's say we discharge the capacitor to 33%, that would take 20sec.

    If we were to simply apply time-constant = R x C = 22000 x 0.001 = 22sec.

    But note that R = 22kΩ does not include the effective resistance of the LED.

    The LED resistance continues to increase as the current falls. Another guesstimate is the LED resistance is 2V/0.3mA = 7kΩ.

    Hence our revised time-constant = 29000 x 0.001 = 29 sec.

    This is called the "Art of Electronics" versus the "Science of Electronics".

    Now check how long the LED appears to be visible in the video. Note that when the camera is pointing straight on at the LED it appears bright where as in reality (from a side view) the LED is barely lit. At what point in time do we conclude that the LED is no longer lit?

    Your guess is as good as mine.
     
  13. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,546
    1,252
    Some of the stuff in this thread's earlier posts come from me in another thread:

    http://forum.allaboutcircuits.com/threads/help-led-delay-off.122498/

    I started off with the constant current equation because it is much easier for a newbie to understand and manipulate while still conveying the various direct and inverse relationships among the components. It gives good enough results for a first step into transient circuit analysis, without scaring the crap out of someone by hitting them with natural logarithms and fractional exponents first thing in the door.

    To the TS - the real answers to your questions involve natural logarithms and fractional exponents. No way around then, it's just the way the physics works. Up to you if you want to go forward.
    https://en.wikipedia.org/wiki/Exponentiation - sections 1 to 3.3
    http://hyperphysics.phy-astr.gsu.edu/hbase/electric/capchg.html
    http://hyperphysics.phy-astr.gsu.edu/hbase/electric/capdis.html

    ak
     
    Last edited: Mar 31, 2016
  14. Guest3123

    Thread Starter Member

    Oct 28, 2014
    312
    18
    Sorry for being rude. I'll try harder.
     
    Last edited: Mar 31, 2016
  15. Guest3123

    Thread Starter Member

    Oct 28, 2014
    312
    18

    I try to be more patient.
    I'll try to expect less of people.
    Sorry, I'll learn to ignore, and be more patient, and await further assistance and help.
     
    Last edited: Mar 31, 2016
  16. blocco a spirale

    AAC Fanatic!

    Jun 18, 2008
    1,440
    368
    I didn't say anything about money. My point is; you cannot expect help from anyone on a forum so be grateful to all those who offer something even if it does not exactly fit your requirement. If you really don't like a reply, ignore it.

    If answers come in an apparently cryptic form it's not because the responder doesn't want to help, on the contrary, it is to encourage the TS to think a little for themselves because that is how we achieve real understanding. Unfortunately, this often offends those who expect quick answers.
     
    cmartinez likes this.
  17. MrAl

    Well-Known Member

    Jun 17, 2014
    2,440
    492
    Hi Guest,

    Back on topic...


    A linear approximation is probably the best place for you to start because it's the simplest view and we can only approximate anyway.

    For a capacitor the definition is often given as:
    dv/dt=i/C

    So, ok bye :)
    (Just kidding)

    Let's look at this little equation a little bit...

    dv/dt means the change that the voltage is making with time. We like to know this because this tells us how much it changes in a given time, like 1 second. Then we might estimate how long it will take to reach a certain voltage level where the LED does not light anymore.

    What we really want to know though is how much time it takes, so we solve for the "dt" in that equation:
    dv/dt=i/C
    or:
    dt/dv=C/i
    or:
    dt=C/(i*dv)

    All we did was solve for "dt" algebraically.

    Now that we have that, we need to know the starting current "i". We can estimate this by looking at the circuit for an LED in series with a resistor driven by a constant voltage source. The current is:
    i=(Vcc-vLED)/R

    The reason for this is because the LED drops a roughly constant voltage and Vcc is constant, and so when we subtract the two we get the voltage across the resistor R and then we use Ohm's Law:
    I=V/R

    and that gives us the current.

    Now that we have the current, we can substitute that into the original equation:
    dt=C/(i*dv)

    and get:
    dt=C/(dv*(Vcc-vLED)/R)

    and multiply top and bottom by R and get:
    dt=R*C/(dv*(Vcc-vLED))

    and we are partly done. Next we need to determine what "dv" is. This is the decrease in cap voltage where the LED gets too dim to see much, but is kind of subjective to whatever we think is too dim. We'll set a limit on the current through the LED just for an example, let's say 0.2ma is low enough to make the LED dim by our standards of what dim is. That means when the cap discharges, the current will drop to:
    i2=(Vcc-dv)/R

    where i2 is the dim level set point current we choose for our liking. If we dont know this yet, we test for it with a small circuit.

    Solving that for dv, we get:
    R*i2=Vcc-dv
    dv+R*i2=Vcc
    dv=Vcc-R*i2

    Next we substitute that into the previous equation:
    dt=R*C/(dv*(Vcc-vLED))

    and get:
    dt=R*C/((Vcc-R*i2)*(Vcc-vLED))

    and now we have an equation that gives us the time before the LED gets too dim, by our own standard of what dim is.
    The Vcc here is the voltage that the cap is first charged up to. i2 is the LED current level we choose by previous experiment which is the current level where we think the LED is too dim. vLED is the characteristic voltage of the LED, often 1.8v to 3.5v depending on the particular LED part being used, and this can also be tested for via previous experiment. R is the series resistor, C is the capacitance.

    If there is anything you dont understand here, just ask about that particular thing to stat with. We can take it one step at a time too if you like.

    Once you see how this works if you would like to move on to the more exact solutions we can look at that next. That involves a little more math but not too much more.
     
    Last edited: Mar 31, 2016
    Guest3123 likes this.
  18. MrChips

    Moderator

    Oct 2, 2009
    12,449
    3,368
    @Guest3123, if you want to speak your mind, so can I.
    You are behaving like a spoiled brat. Yes, you are being rude.
    If you want to learn some electronics, shaddup, pay attention and listen.
    If you continue with that attitude, no one will be willing to help you.
    If you come to AAC to really learn something, get down to it and stop complaining.
    I would have expected you to read the numerous posts and tell us what you understand and don't understand.
    Instead you waste your time whining.
    Do you want to learn or not? Make up your mind.
     
  19. Guest3123

    Thread Starter Member

    Oct 28, 2014
    312
    18

    Just got back from picking up my vehicle from being worked on. Needed a new radiator. I'm back, and I'm going to start working on the questions you gave me to answer. So I will not be done drawing up the chart and graph until probably a little bit latter. I actually have most of it done already, so just be patient. My graphs and drawing are usually pretty nice, seeing how I use InkScape to draw everything up, etc.

    I understand. I'll try harder to ignore or to wait for others to help me, or for the person who replied to clarify. Or just wait..

    Thanks for the words of wisdom, it's appreciated.
     
  20. Guest3123

    Thread Starter Member

    Oct 28, 2014
    312
    18
    I have to answer MrChips reply and the assignment he gave me first, then I'll take a closer look at what you gave me to look over. Thanks for the reply, I appreciate the help, thank you.
     
    Last edited: Mar 31, 2016
Loading...