If I would give my job interview answer then it would look like something like Tomorokoshi’s after pointing out that this should not be built like this in practice.

...except (1.3 should be) I=Is*(exp(V/VT/n)-1)
Since the current at zero voltage should be zero (otherwise I could just get a bunch of diodes and generate current… though I would need a lot since Is is really small)
Since we assume ideal and identical diodes we can use n=1 and calculate Is from the given data point Vf=2V, If=20mA and rearranging (1.3)
(1.5) Is = I/(exp(V/VT)-1)
Where
(1.6) VT = k*T/q
k=1.380649e-23; // J/K = C*V/K
q=1.602176634e-19; // C
T=300; //K
Note: Because we don’t know anything about the temperature or cooling it’s easy to assume constant identical temperatures (T=300), but it will not be the case in real world.
From 1.3 we can calculate V by rearranging the terms and taking the natural logarithm of both sides
(1.7) I/Is+1=exp(V/VT)
(1.8 ) V=ln(I/Is + 1)*VT
There are multiple ways solving this.
The quickest to do without a computer is to take the voltage difference between diode B and C
(3.2) dV = V2-V1 = VT*(ln(I2/Is+1) - ln(I1/Is+1)) = VT*ln((I2/Is+1)/(I1/Is+1))
Because we know that I1>>Is (I1 is much greater than Is) and I2>>Is, therefore I1/Is>>1 so we can simplify with little error
(I2/Is + 1)/(I1/Is + 1) ~~ (I2/Is)/(I1/Is)=(I2/I1)
and we get
(3.1) dV = VT*ln(I2/I1)
Because I2=2*I1,
(3.3) dV=VT*ln(2) = 17.919241 mV
We know that V1+V2 = Vcc and V2=V1+dV (from 3.2), so V1+V1+dV=Vcc and therefore
(3.4) V1=(Vcc-Vd)/2 = 1.9910404 V
(3.5) V2=(Vcc+Vd)/2=Vcc-V1= 2.0089596 V
Substituting the results to (1.3) we get the currents:
IC=I1=Is*(exp(V1/VT)-1)=
14.142136 mAIB=I2=Is*(exp(V2/VT)-1)=
28.284271 mASince we calculated the currents from voltages it’s not surprising that V1+V2=Vcc with zero error (V1+V2-Vcc=0). The only error of our calculation we can notice is in the currents. While I2/I1=2.0000000 is true, I2-2*I1 should also be 0, but it is not. It’s -3.504e-16, but it is close enough to 0, it’s unmeasurebly small (-0.0003504 pA). The error is likely comes from floating point precision rather than the simplification we made at (3.1). I1/Is = 2.805e+33 so adding 1 does not make a difference, cannot be represented in float or double precision. (I1/Is+1)-(I1/Is) does give 0 as result (instead of 1).
I used SciLab to solve the problem in other ways.
We can get an idea by graphing either the voltages over currents or the currents over voltages.
Or we can solve it numerically by either way: reducing the voltage error or the current error.
First define the diode functions:
function I=diodeI(V)
I=Is*(exp(V/VT)-1);
endfunction
function V=diodeV(I)
V=ln(I/Is + 1)*VT;
endfunction
Then we can graph the Voltages over an interval (10mA..20mA) of currents of C. The solution is when VB = Vcc-VC (while IB=2*IC)
I=linspace(10,20,4000)/1000; // 10mA to 20mA
figure;
plot(I*1000, diodeV(I*2) ); // VB =
plot(I*1000,Vcc-diodeV(I) ,'r'); // Vcc-VC
Or we can graph the currents (IB and 2*IC) over a range of voltages.
V=linspace(1.9,2.1,4000);
figure;
plot(V,diodeI(V)); // IC =
plot(V,diodeI(Vcc-V)*2,'r'); // 2*IC
To solve it numerically we can also use these two approaches:
We minimize the voltage error as a function of current:
function Verr=diodeVErr(I)
Verr = diodeV(I)+diodeV(I/2) - Vcc;
endfunction
Isol = fsolve(20e-3, diodeVErr); /// start from 20 mA
Isol =
0.0282843Or we minimize the current difference as a function of voltage:
function Ierr=diodeIErr(VB)
Ierr = diodeI(VB) - 2*diodeI(Vcc-VB);
endfunction
Vsol = fsolve(Vcc/2, diodeIErr); /// start from 2V
Vsol = 2.0089596
Thankfully the results match the one we got earlier. (Which does not mean it’s correct, but at least consistent ; )
It’s also nice that it matches the simulation result of hadibaria and Wytnucls.
I was curious how would temperature change effect the result. It’s likely that higher current will result higher temperature (unless there is significant different in cooling or environment between B and C). Obviously we don’t have any data on this, so it’s complete guesswork…
A diode at 2V and 20mA consumes 40mW, some of it will become heat (60%..95% of it). Checking the datasheet referenced in the video has 60mW power dissipation (I guess assuming non typical forward voltage and calculating it with the max 3V) but more importantly 500K/W thermal resistance. That would mean 20K increase @ 40mW heat generation. Obviously we don’t know how well the diode is insulated from the ambient environment so lets just assume total 500K/W resistance and that all the dissipated power becomes heat eventually. So around 2V operation voltage dT=Rth*P=Rth*U*I=500*2*I, or dT/dI=1 K/mA. Which means there should be around 14K difference between the parallel and series diodes on the right side.
We can still solve it with ease (to not have to recalculate Is at a higher temperature to make it easier to compare with previous results, we will still assume 2V, 20mA @ 300K operation, which would mean a bit cold 280K ambient temperature)
function V=diodeVT(I)
T=300+(I-20/1000)*1000; //1 K/mA
VT = k*T/q;
V=ln(I/Is + 1)*VT;
endfunction
function Verr=diodeVErrT(I)
Verr = diodeVT(I)+diodeVT(I/2) - Vcc;
endfunction
IsolT = fsolve(20e-3, diodeVErrT); /// start from 20 mA
Now we get
26.888 mA instead of 28.284 mA around 1.4 mA difference.
Note that this is still using an ideal diode model. And it’s clear from the pdf that real LEDs are not ideal because I-V log-lin graph is not linear. They have at least serial resistance.
We could use a model that includes serial resistance like this:
Rs=10;
function V=diodeVR(I)
V=ln(I/IsR + 1)*VT+Rs*I;
endfunction
And solve it like this:
function Verr=diodeVErrR(I)
Verr = diodeVR(I)+diodeVR(I/2) - Vcc;
endfunction
IsolR = fsolve(20e-3, diodeVErrR);
But here we have to recalculate the Is for Vf=2 @ 20mA to remain true.
function Is=diodeIsR(V, I)
Vd=V-Rs*I;
Is = I/(exp(Vd/VT)-1);
endfunction
IsR = diodeIsR(Vf,If);
With this we get a similar curve as in a real LED in the pdf.
I=linspace(0.1,100,4000)/1000;
plot("ln",I*1000, diodeVR(I));
The solution gives
26.846 mA current.
Using both temperature and resistance could give us more realistic result (
26.769 mA), but it’s still not gonna be perfect. Even if we use real word measurement data of I-V curve of a LED it's not going to solve everything. Because of manufacturing variances the 2 diode in parallel will not be perfectly matched, so the currents will not be evenly distributed. We haven’t mentioned resistor tolerances and their temperature dependency…
...Or the voltage supply tolerance. The difference between currents we got was small at 4.00V Vcc (within 2 mA), but they get much larger as Vcc changes.
At Vcc=4.2 (+5%) we get
1353 mA for the ideal diode
44 mA with T
39 mA with Rs
34 mA with T and Rs.
It is interesting how complicated calculations can get with a seemingly simple circuit like this.
