1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Electronics Formula for Capacitors/LEDs

Discussion in 'Modding' started by whiteagle, 5 Mar 2004.

  1. whiteagle

    whiteagle What's a Dremel?

    Joined:
    28 Aug 2003
    Posts:
    117
    Likes Received:
    0
    I am wanting to have an LED that fades out when power is taken away. (Look at the power LED on the big mac LCDs if you want to know what I'm talking about) Anyway, I figure the easiest way is with a capacitor, but I was wondering if there is a formula that would tell me how long it would take the power to the LED to fade after the power from the capacitor is gone.

    Thanks,
    Daniel
     
  2. mattg2k4

    mattg2k4 What's a Dremel?

    Joined:
    4 Jun 2003
    Posts:
    61
    Likes Received:
    0
    There is a pretty simple formula for calculating voltage across a cap given time and a resistance. I don't know it offhand, but any textbook will have it and you can google it quickly enough I'm sure. Since the led incorporates it's own voltage drop in addition to the series resistor, just use supply voltage divided by the current for your resistance. The led will go out when the cap voltage goes below the voltage drop.

    However, assuming you have a variety of caps on hand, some experimentation will probably be a faster way to get what you're looking for.

    Just a tip I read somewhere, if you want the fade to be longer, instead of using a big cap, just use a small cap on the base of a transistor, then it can be much smaller.
     
  3. evil_t

    evil_t What's a Dremel?

    Joined:
    30 Sep 2003
    Posts:
    21
    Likes Received:
    0
    A cap is fully charged after 5 tau (timeconstant). Tau = R*C.
    C = (fadeouttime/5tau) / Rled

    I.e. 1 sec fadeouttime and R=470ohm

    Code:
    C= (1sec/5tau) / 470ohm
    C= 0.2 / 470
    C= 425uF
    [​IMG]
     
  4. cpemma

    cpemma Ecky thump

    Joined:
    27 Nov 2001
    Posts:
    12,328
    Likes Received:
    55
    ln(Vc) = ln(Vmax) – t/tau

    or ln(Vmax) – ln(Vc) = t/RC

    So a cap discharging from 12v to 2v would take about 1.8 time-constants. :geek:
     
  5. whiteagle

    whiteagle What's a Dremel?

    Joined:
    28 Aug 2003
    Posts:
    117
    Likes Received:
    0
    Thanks y'all. I knew there had to be some simple formula for it, but I haven't had much experience with choosing my own caps for projects. Usually I'm either just replacing them while fixing something, or repeating something I've seen done before.

    Thanks again! :thumb:

    P.S. Also, mattg2k4, that trick using the transistor is pretty slick, I can think of lots of uses for that.
     
  6. mattg2k4

    mattg2k4 What's a Dremel?

    Joined:
    4 Jun 2003
    Posts:
    61
    Likes Received:
    0
    I can't take credit... I read it somewhere else.
     

Share This Page