# Math Help with a Simple LED circuit

Thread Starter

#### fish4fun

Joined Feb 24, 2009
8
I am trying really hard to wrap my brain around what is going on in the very simple attatched schematic. I have two very conflicting models of behavior, and I am hoping someone can point out my errors! The goal is to model the current and power through the LED array with respect to time. Let me walk through the general set-up, then I will use specific values.

Using rms Averages and Static Xc and leaving the Diodes Out, the simple formula is derived as follows:
Xc = 1 / (2Pi * F * C)
Z = (Xc^2 + R^2)^.5
Irms = Vrms/Z
Pavg = Irms * Vrms
Using: C = 1.5uF Vrms = 120 Freq = 60hz and R = 200 nLEDs = 50 ohms Test Period = 3Pi Step = Pi/150 this model predicts:
Xc = 1/(2Pi * 60 * .0000015) => 1768
Z = (1768^2 + 200^2)^.5 = 1779.66
Irms = 120/1779.66 = 67.429mA
Pavg = .067429 * 120 = 8.09W

But obviously these calculations do not take the LEDs into account, but rather reflect what one would assume would be the maximum current/power of the series RC portion of the circuit.

Using a PC to plot V(t), I(t), P(t) for both the circuit and the LEDs I made the following assumptions:

1) No current flows through the LEDs when V(t) < (Vf * Number of Series LEDs).
2) V(t) = Vrms * 2^.5 Sin(t)
3) The Reactance of the transformer is not an influence on the circuit.

I derived two models:

Model 1: The change in voltage across Cs for any given period of time is related to the current flow by dQ = dV * C, and dQ/dT = Current. So, if we step through Vmax * Sin(t) for t=0 to 2Pi by Pi/Steps and calculate the change in charge on the Capacitor we should be able to determine the Current through the LEDs. This obviously is a discontinuous function as V(t) < Vf => Current = 0 (by assumption), but the current should "ramp quickly" after V(t) > Vf. From this point the current becomes continuous until V(t) = Vf again. I_LED = (V(t) - Vf)/R. If I_LED > I(t) (calculated from dV*C) then I_LED = dV*C/dT.

Using: C = 1.5uF Vrms = 120 Freq = 60hz and R = 200 ohms nLEDs = 50 Test Period = 3Pi Step = Pi/150 this model predicts:

Peak Led Power = 0.331W
Avg Led Power = 52.593mW
Avg Resistor Power = 0.103mW
Peak Led Current = 2.207mA
Avg Led Current = 0.351mA

These calculations DO NOT appear to correspond with actual circuit tests!

Model 2: The impedance, Z of the circuit should relate V(t) = Vmax * Sin(t) to the Current by calculating the phase angle as follows:

Xc = 1 / (2Pi * F * C)
Z = (R^2 + (Xc)^2)^.5
Phase Angle = - aSin(Xc/Z)

I(t) = (Vmax/R) * Sin(t - Phase Angle)

Using: C = 1.5uF Vrms = 120 Freq = 60hz and R = 200 ohms nLEDs = 50 Test Period = 3Pi Step = Pi/150 this model predicts:

Peak Led Power = 7.376W
Avg Led Power = 1282.819mW
Avg Resistor Power = 60.166mW
Peak Led Current = 49.171mA
Avg Led Current = 8.552mA

These calculations appear closer to observations of the actual circuit, but, sadly changing the capacitor to 0.2uF and repeating the calculations:

Using: C = 0.2uF Vrms = 120 Freq = 60hz and R = 200 ohms nLEDs = 50 Test Period = 3Pi Step = Pi/150 this model predicts:

Peak Led Power = 7.041W
Avg Led Power = 1257.589mW
Avg Resistor Power = 57.135mW
Peak Led Current = 46.940mA
Avg Led Current = 8.384mA

And these calculations ABSOLUTEY do not match observations of the actual circuit. I am at a loss. Perhaps I need to model the diodes using variable Vf? Perhaps I have missed something even more fundamental. Any thoughts would be helpful!

Using the 1.5uF Capacitor and the other common elements except connecting two strands of 50 series leds in parallel, there is no visible difference in the brightness of the strands. That is both strands appear to the eye to be "X bright". When one of the strands is disconnected, the other does not appear to "brighten"; this suggests that the "shared current" is similar to the "Un-shared current", which suggests that the circuit current is limitted purely by resistance; however, this theory does not hold, because when 1 strand uses 1 100 ohm resistor and the other strand uses a 200 ohm resistor, again, there is no visible difference in brightness.

Thanks in advance for any help.

Fish

#### thingmaker3

Joined May 16, 2005
5,084
Have you accounted for using real-world components instead of "ideal" components? Do you know the tolerance of your capacitor and resistor? Are they plain vanilla 20% and 5% respectively?

Last edited:
Thread Starter

#### fish4fun

Joined Feb 24, 2009
8
Thingmaker3,

I am aware of the difference between "ideal" components and "real" components. My problem is my math doesn't seem to accurately predict reality. Large changes in the math input (+/- 60% or greater) do not accurately account for observed conditions. I am ASS-U-MEing that the problem is my math, and not my components; however, the components are as follows:

DigiKey:
BC1776-ND CAP FILM MKT 1.5UF 250VDC 10%
495-3126-ND CAP FILM .1UF 250V METALPOLY
DB103-BPMS-ND RECTIFIER BRIDGE 1A 200V DB-1

General:
Resistor: 1/4W 200 ohm 5%

LEDs:
http://cgi.ebay.com/100-5mm-White-L...66954QQcmdZViewItemQQ_trksidZp1742.m153.l1262

Thanks for the Input!

Fish

Thread Starter

#### fish4fun

Joined Feb 24, 2009
8
Here is an output of the math simulation of the second method for the previously mentioned parameters.

NOTE: The Scale is
Red: V(t) = +/- 85V = 10V/Div
Back I(t) = I(t) * 100 = +/- 850mA = 100mA/Div
Green P(t) = +/- 85W = 10W/Div
Blue = Led_Power * 10 = +/- 8.5W = 1W/Div

Again, this is PREDICTED behavior, and I think it is WRONG. I just can't figure out why.

The code that produces the output/graph (with non-math removed) is:

Rich (BB code):
    Do
Vt = Vdc * Sin(Cnt)
It = (Vdc / R) * Sin(Cnt - PA)
Vp = Vt
Pt = Vt * It
If Abs(Vt) > Vd / 2 Then
Ir = (Abs(Vt) - (Vd / 2)) / R
Il = Ir
If Vt < 0 Then
'                Stop
Ir = -Ir
Pr = (Vt + (Vd / 2)) ^ 2 / R
Pr = Ir ^ 2 * R
Else
Pr = (Vt - (Vd / 2)) ^ 2 / R
End If
If Abs(Ir) > Abs(It) Then
Ir = It
Pr = Ir ^ 2 * R
End If
If Vt < 0 Then
Il = -Il
Pl = Vd * Il
Else
Pl = Vd * Il
End If
If Abs(Il) > Abs(It) Then
Il = It
Pl = Vd * Il
End If
Else
Pr = 0
Ir = 0
Il = 0
Pl = 0
End If

If Abs(Il) > Ipeak Then
Ipeak = Abs(Il)
End If

If Abs(Pl) > Ppeak Then
Ppeak = Abs(Pl)
End If

IledT = IledT + Abs(Il)
PledT = PledT + (Vd * Abs(Il))
IrT = IrT + Abs(Ir)
PrT = PrT + Abs(Pr)
Cnt = Cnt + Stp
nCnt = nCnt + 1
Loop Until Cnt > 3 * Pi
Thanks for the interest!

Fish

Similar threads