Pages: [1] 2   Go Down
Author Topic: Basic maths: 10kΩ resistor, 5V voltage, 100µF cap=0.76 second LED fadeout  (Read 1281 times)
0 Members and 1 Guest are viewing this topic.
Helsinki
Offline Offline
Newbie
*
Karma: 0
Posts: 31
A librarydude
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

As an exercise in basic EE and basic maths, i want to fade out a LED with a capasitor. I wonder if anybody could peer-review my calculations?



Given i am using a 10kΩ resistor and a standard LED in series, and in parellel with a 100µF cap, all in a 5V circuit, shouldn't my timeout be 0.76 seconds?

  • Mr. Ohm (V=IR), thus I=V/R
  • Mr. Kirchhoff (V=V1+V2), thus a 1.2V front voltage LED turns off at 5V=1.2V+VacrossCap=VacrossCap=3.8V.

Charge C = F*V
Charge C = I*t
Time t = F*V/I = 0.0001F*3.8V/(5V/10000Ω) = 0.76s

+=?
Logged

Offline Offline
Edison Member
*
Karma: 33
Posts: 1290
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Take a look at this page.

Have you had calculus yet?   A capacitor discharging through a resistor is an exponential function.  (Since the current is not constant, you cannot use C = I x t except for "one instance" in-time.)

The non-linear LED further-complicates things.    ...It's over my head, and it's been long time since I've had calculus.   It might be as simple as a discontinituity when you hit the LED cut-off voltage (with an "ideal" LED) and the current suddenly drops to zero, but I'm not sure.   Or, it might involve two simultaneous equations until you hit the discontinuity????
Logged

Helsinki
Offline Offline
Newbie
*
Karma: 0
Posts: 31
A librarydude
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Take a look at this page.

That was good, thanks. Stack Exchange is fantastic.

Have you had calculus yet?

LOL i admit my calculus is rubbish, after so many years since highschool. That's why i'm doing such basic math now, and also looking for peer support here. Thanks for it DVDdoug, i appreciate it! This is great exercise.

Now that the day is drawing to night, and it's getting darker, i can empirically see that the 0.76 seconds is too short a time for my LED's fadeout; it seems to be above 1 second.

A capacitor discharging through a resistor is an exponential function.  (Since the current is not constant, you cannot use C = I x t except for "one instance" in-time.)

That's right, it makes sense; the LED is fading, and that is exactly the reason why it's getting less and less bright; the current is dropping... and thus it's bleeding the charge in the cap slower and slower.

My amended calculation, assuming an exponential decay of current, is -10000Ω*0.0001F*ln(1.2V/5V)=1.43s. That seems to correlate better with sense-based observations. Next, maybe i should build a tool, using Arduino, a light-dependant-resistor and millis(), that would measure the time it takes for the LED to fade smiley-cool
Logged

Leighton Buzzard, UK
Offline Offline
Edison Member
*
Karma: 21
Posts: 1339
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

suggest build it and just try a few values!
Logged

there are only 10 types of people
them that understands binary
and them that doesn't

Offline Offline
Edison Member
*
Karma: 58
Posts: 2078
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I agree what mmcp42 wrote.

Some leds are very well visible with only 0.5mA or even less.
I think that one led can be 10 times longer visible than an other led.
Logged

New England
Offline Offline
Sr. Member
****
Karma: 7
Posts: 295
Natural Semiinductor
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The circuit schematic is too far away, but let me guess :
The capacitor is in parallel with the LED.
The switch is in parallel with the LED.
The resistor is not used.
Logged

I am going to get going.

Helsinki
Offline Offline
Newbie
*
Karma: 0
Posts: 31
A librarydude
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The circuit schematic is too far away, but let me guess :
The capacitor is in parallel with the LED.
The switch is in parallel with the LED.
The resistor is not used.

@AmbiLobe: Do you mean how my circuit was built? The resistor was used; the cap is in parellel with LED and the resistor, which are in series together. See the attached schematic.

* led fadeout with a cap.fzz (5.27 KB - downloaded 6 times.)
* led fadeout with a cap_schem.svg (45.04 KB - downloaded 10 times.)

* led fadeout with a cap_schem.png (174.56 KB, 2223x2070 - viewed 36 times.)
Logged

New England
Offline Offline
Sr. Member
****
Karma: 7
Posts: 295
Natural Semiinductor
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The RC time constant is 1 second.

Thank you for the schematic diagram. The math is like this after the switch is released:
There are three nodes : S1 Anode GND
The LED Anode has about 2v as a diode drop. Treat it as a voltage source of 2v.
The resistor has 3 volts time = t = 0 seconds
The peak current at t=0 is i(0) = v/r = 3/10k = 0.3mA
The current decays exponentially

i(t) = i(0) * e^(-t/rc)
rc = 10k * 100uF = 10^4 * 10^-4 = 1 second
e = 2.7182 a constant from science education

e^-1 = 1/e = .632

e^-2 =  1/(e*e) = .632 * .632 = .40
e^-4 = .16
e^-8 = .0256

after 1 second i = .3mA * .632 = .189 mA
after 2 seconds i = .3mA*.16 = 48 micro amps (uA)
after 8 seconds i = .3mA*.0256 = 8uA

Conclusion : your math was wrong. The LED will be dim with .3mA.
Its power is 2v*.3mA = 0.6 milliwatts
This is a dim bulb.
« Last Edit: August 21, 2013, 05:36:52 am by AmbiLobe » Logged

I am going to get going.

0
Offline Offline
Shannon Member
****
Karma: 201
Posts: 11744
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
See the attached schematic.

You short the supply into the capacitor - add a small value resistor in series with the
switch if you want to avoid welding it shut and resetting the Arduino!
Logged

[ I won't respond to messages, use the forum please ]

Helsinki
Offline Offline
Newbie
*
Karma: 0
Posts: 31
A librarydude
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
See the attached schematic.

You short the supply into the capacitor - add a small value resistor in series with the
switch if you want to avoid welding it shut and resetting the Arduino!

Oh, so it's not good to let caps suck in energy as they please, without controlling it? As explained f.ex. here. Hmm i guess (V=IR) if at the beginning time t0 the voltage jumps to 5V, the resistance is (theoretical) 0, then the current is infinite, until the capasitor starts to build resitance as it's charge increases. Is this it?

Thanks MarkT for bringing this to my attention!

I love these little electronics and Arduino, it's such a great way to get (back) into math and so many other wonderful things smiley
Logged

0
Offline Offline
Sr. Member
****
Karma: 4
Posts: 329
KC4MM
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This discussion reminds me of this classical problem.

The charge on a capacitor is given by q=CV
The energy stored in a capacitor is 1/2 C*V*V (one half C Vsquared)

Assuming perfect capacitors, perfect wires (0 resistance), and a perfect switch.

We charge a 1 farad capacitor to 1 volt and disconnect it from the charging source.
Its charge is then C*V = 1 coulomb and its energy is .5 * 1 * 1 * 1 = .5 joules.

Now we use a switch to connect the capacitor in parallel with another 1 farad capacitor. Since charge must be conserved our 1 coulomb of charge is now divided between the two capacitors. So the voltage on each is q/C or .5 volts and the energy stored in each is then .5 * 1 * .5 * .5 = .125 joules. So the total energy in the two capacitors is .125 * 2 = .25 joules.

Question is what happened to the missing .25 joules of energy?
Logged

Atlanta, USA
Offline Offline
Edison Member
*
Karma: 53
Posts: 1777
AKA: Ray Burne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The math is all fun, but when you need to quickly play, you need SPICE

http://www.falstad.com/circuit/

Logged

New England
Offline Offline
Sr. Member
****
Karma: 7
Posts: 295
Natural Semiinductor
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

"Question is what happened to the missing .25 joules of energy?"

During the time that current flowed from one capacitor into the next capacitor, a magnetic field was changed. The energy went into that magnetic field during an impulse. A resonance then occurs without damping, and the oscillation lasts forever. The missing energy is tossed about forever, outside of the capacitive energy.
Logged

I am going to get going.

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 525
Posts: 26570
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The ESR of the capacitor also comes into play, which limits the current flow out of the cap to some extent.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Edison Member
*
Karma: 29
Posts: 2376
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

How come you're not using a transistor ?  You can make it fade out nicely then!
Logged

Pages: [1] 2   Go Up
Jump to: