Electronic – Simple LED model for circuit simulation

ledsimulationspice

I'm new to electronics and I'm learning the basics for a small home project involving LEDs, fiber optics, and microcontrollers.

I'd like to simulate the circuit I plan to build to get a better understanding of the different V drops and I values in each node as I change the structure of the circuit. I've experimented with various free tools and so far 5Spice (Win, desktop) and Circuitlab.com proved to be the best ones for me.

However, I'm stuck when trying to simulate the simple 5mm 24mA LEDs I bought (manufacturer link here). Both tools support adding LEDs, but I need to set values such as N, TT, M_J, I_S, R_S, C_J0, and V_J.

Even after reading the basics of Spice and reading this other StackExchange question, I'm not sure what values I can use, and the procedures described there are beyond my current (basic) understanding, at least for the time being. Can anybody help me providing these values?

My power source will be a constant 4.5V and the LEDs Voltage is in the range 1.9v-3.2v (depending on the color) What values should I use for a basic simulation? I can't find the datasheet in the manufacturer site.

Thanks,

Best Answer

An LED typically has a voltage/current relationship like this:

graph of current vs voltage

A resistor's voltage/current relationship is a straight line, passing through the origin, with the slope defined by the resistance (from Ohm's law: \$ I = \frac{E}{R} \$).

The LED's curve is not unlike a straight line, once you get above 1.8V or so. So, at least for the LED's operating region between "current starting to flow" and "overheating", an LED is not unlike a resistor, with the voltage pushed to the right.

What's the value of this imagined resistor? Well, in this graph it looks like the curve goes through \$(2V, 5mA)\$ and \$(2.2V, 20mA)\$. If you rearrange Ohm's law, you can see that an Ohm is a volt-per-amp:

\$ R = \dfrac{E}{I} \$

We will deal with shifting this curve to the right later, so for now we can consider only the change in voltage and current between the two points we picked:

\$ R = \dfrac{\Delta E}{\Delta I} \$

\$ R = \dfrac{2.2V - 2V}{20mA - 5mA} \$

\$ R = \dfrac{0.2V}{15mA} \approx 13 \Omega \$

So that gives us the straight line. How do we shift it to the right? Simple: all simulation packages have a voltage source: a component that has a voltage you define across it under all conditions. To get the value, we can simply look at our graph and extend the line to see where it would intersect the Y axis (\$0A\$). Looks like about 1.8V. So here's our simple LED model, a voltage source and LED in series:

LED model schematic

This model breaks down if the current becomes very small. A real LED turns off, and blocks current like a diode, but in this model you start getting a reverse current, like a resistor would do. You can improve this by adding an ideal diode in series, if you like.

There are finer details that this also doesn't simulate: it doesn't simulate that smooth "knee" where the LED just starts to turn on. It doesn't simulate reverse leakage current, or temperature effects, or photocurrent. However, most of this is not significant in practical LED circuits.

On that practical note: there is a simpler model most engineers use day-to-day: just a voltage source. For this LED, if you just assume the voltage across it whenever it's on will be \$2V\$ whenever its on, you are probably close enough. If you are going to include a \$1k\Omega\$ current-limiting resistor in series, then the \$13\Omega\$ from the LED hardly matters. If the current gets high enough to deviate significantly from that \$2V\$ estimate, the LED is probably destroyed.