5

I'm trying to work through an iterative solution for the forward voltage of a diode in series with a voltage source and a current limiting resistor.

schematic

simulate this circuit – Schematic created using CircuitLab

Normally I'd just use the sim for it, but I figured it was worth learning how to do by hand.

The model from the CircuitLab simulator used by EE SE (click "simulate this circuit" above) provides the following parameters for the 1N4148 diode:

  • \$I_S = 2.52 \times 10^{-9} \text{A}\$
  • \$n = 1.752\$
  • \$R_S = 0.568 \Omega \$

Assuming a default temperature of 27°C in a SPICE sim, we should have \$V_T=0.025865\$ for the thermal voltage.

First, I used the diode voltage drop equation with an Ohm's law substitution to determine a starting point for \$V_D\$ without knowing \$I\$:

$$V_D = nV_T \times \text{ln} \left( \frac{V_S-V_D}{R I_S} + 1 \right)$$

For this initial step I set \$R\$ to \$R_S\$, ignoring \$R_1\$, so that my starting point is unaffected by external components. (Note: I also tried starting with \$R=R_S+R_1\$, but it didn't make much of a difference to the converged result)

With the given parameters and a \$V_S\$ of 5V this solves to \$V_D \approx 0.9858 \text{V}\$ using Wolfram Alpha.

We know that \$I = \frac{V_S-V_D}{R_1}\$, so we can substitute our value for \$V_D\$ in and get \$I = \frac{5-0.9858}{100}=0.040142\text{A}\$.

The diode equation then gives us:

$$V_D = nV_T \times \text{ln} \left( \frac{I}{I_S} + 1 \right)$$

Plugging the numbers back in, we get \$V_D = 0.751497V\$.

The initial equation is then iteratively evaluated with \$V_D\$ on the right initially set to 0.751497V and \$R=100 \Omega\$, feeding the resulting \$V_D\$ back in until it converges on a solution.

The converged value I got was \$V_D=754 \text{mV}\$, and therefore \$I=42.46\text{mA}\$.

This looks reasonable. However, it diverges from the in-browser simulation for the circuit above, which gives me 772mV and 42.27mA. I tried again on Falstad (circuit-js) with the 1N4148 model parameters there (even verifying the \$V_T\$ value in the circuitjs GitHub) and also didn't get the same result.

Why doesn't it match up? Did I mess up my model calculations?

Polynomial
  • 10,562
  • 5
  • 47
  • 88
  • Can you post the diode full model? Maybe there is some series resistance included in the model. – G36 Jul 06 '23 at 16:55
  • 1
    for a diode, both 754 and 772 mV are reasonable. It all depends on exactly what parameters are used for the model - residual series resistance, ideality factor, temperature, Is. – Neil_UK Jul 06 '23 at 16:58
  • @G36 Click "Simulate this circuit" under the diagram in the question, then double click the 1N4148 to get the full parameter set. The series resistance (Rs) is the 0.568Ω I listed in the model parameters. – Polynomial Jul 06 '23 at 17:00
  • @Neil_UK The exact model parameters are the ones I listed. It's from the circuit simulator built into this site. When I did the same analysis for Falstad I used the model parameters [from GitHub](https://github.com/sharpie7/circuitjs1/blob/dd47cf43a1baa91e2d6ae0f5884ccf0f589989bf/src/com/lushprojects/circuitjs1/client/DiodeModel.java#L95). – Polynomial Jul 06 '23 at 17:01
  • I know that the number I got is a pretty close ballpark; what I don't know is why running the calculations on the exact 1N4148 model parameters from CircuitLab and Falstad got me a different result to the simulation both times. In both cases I found that the simulation gave a slightly larger Vd than my calculations returned. – Polynomial Jul 06 '23 at 17:09
  • 1
    Did you include that Vd = 754mV + 42.46mA*0.568 = 778mA – G36 Jul 06 '23 at 17:40
  • @G36 That _sounds_ like it might be the source of the error, but isn't the diode \$V_D\$ equation supposed to tell me the drop of the whole diode, not just the nonlinear element excluding \$R_s\$? – Polynomial Jul 06 '23 at 17:42
  • 2
    Of course not. VD equation gives you only the voltage drop across the PN junction nothing more. – G36 Jul 06 '23 at 17:45
  • @G36 Aha, now that I didn't know! Now that I'm looking at the equations again it does make a lot more sense that \$R_S\$ isn't included in the result. If you wanna write a quick answer explaining that, I'll accept :) – Polynomial Jul 06 '23 at 17:47

1 Answers1

9

It seems that you forgot to include the voltage drop across the \$R_S\$ resistor. \$V_D\$ equation will only give you the voltage drop across the "ideal diode".

schematic

simulate this circuit – Schematic created using CircuitLab

So, the total voltage drop is equal to:

$$V_D = V_{IDEAL} + I_D*R_S$$

And lets us check it

$$ V_D = nV_T \ln\left(\frac{I_D}{I_S}\right)$$

And the first iteration current is

$$I_D(1) = \frac{5V - 0.7V}{100.568\Omega} = 42.7571mA$$

$$ V_D(1) = 45.31548mV *\ln\left(\frac{42.7571mA}{2.52nA}\right) = 754.357mV$$

$$I_D(2) = \frac{5V - 754.357mV}{100.568\Omega} = 42.2166mA$$

$$ V_D(2) = 45.31548mV *\ln\left(\frac{42.2166mA}{2.52nA}\right) = 753.780mV$$

$$I_D(3) = \frac{5V - 753.780mV}{100.568\Omega} = 42.2223mA$$

$$ V_D(3) = 45.31548mV *\ln\left(\frac{42.2223mA}{2.52nA}\right) = 753.786mV$$

$$I_D(4) = \frac{5V - 753.786mV}{100.568\Omega} = 42.2223mA$$

$$ V_D(4) = 45.31548mV*\ln\left(\frac{42.2223mA}{2.52nA}\right) = 753.786mV$$ As you can see we are getting the same numbers, so we can conclude that.

$$I_D = 42.2223mA$$ And the voltage drop across the real diode is:

$$V_D = 753.786mV + 42.2223mA*0.568\Omega = 777.769mV$$

The LTspcie result is

enter image description here

Looks good to me. Nothing to complain about.

G36
  • 13,642
  • 1
  • 18
  • 33
  • 1
    Perfect! Thanks :) – Polynomial Jul 06 '23 at 18:33
  • 3
    Added bonus: I was wondering why Falstad and LTspice both get 777mV but CircuitLab slightly disagrees at 772mV. On a hunch I checked how the numbers work out if CircuitLab was setting their environmental temperature to 25°C instead of 27°C like LTspice and Falstad do. 27°C translates to a \$V_T\$ of 25.865mV, whereas 25°C translates to a \$V_T\$ of 25.69mV, and if you scale 777mV by a factor of 25.69/25.865 you get 772mV. So the disagreement is purely down to temperature. – Polynomial Jul 06 '23 at 19:08
  • @Polynomial But lower temperature means higher VD voltage not lower. To get 772mV temperature needs to be higher than 27°C. Somewhere around 31°C. – G36 Jul 06 '23 at 19:22
  • \$V_D\$ scales up with \$V_T\$ though? And \$V_T\$ @ 25°C is 25.69mV, whereas at 27°C it's 26.865mV. – Polynomial Jul 06 '23 at 19:26
  • Ok I see, you have assumed constant \$I_S\$ current (not temperature dependent). But in the real world the higher the temperature the lower the diode forward voltage. https://electronics.stackexchange.com/questions/377861/temperature-coefficient-of-diode – G36 Jul 06 '23 at 19:48
  • Less "I have assumed" and more "this is what LTspice does" :) – Polynomial Jul 07 '23 at 08:13
  • No, LTspice does not assume constant \$I_S\$ current. It's assumed that the \$I_S\$ is for T_nom = 27°C only. So if you change the temperature the \$I_S\$ will also change. – G36 Jul 07 '23 at 15:28