# SPICE models for LEDs?



## lymph (Oct 18, 2004)

Does anyone have spice models for various LEDs? ie. Luxeons, standard red, white, etc. etc. Or, could someone tell me how to determine one?

Thanks.


----------



## MrAl (Oct 18, 2004)

Hi there,

If you'd like to try making your own, you could start with
a diode. The diode should have at least parameters
N, IS, and RS, and maybe capacitance.

You then measure several points on the curve of your
LED (or look up the curve at the manufacturers site)
and plot these points using spice, then run your
diode with a current source and change N, IS, and Rs
until you get a curve that fits pretty good.

Actually, i use a curve fitting program, which optimizes
the three parameters, but even one done by hand turns 
out pretty useful and it's informative to try this too.

If you prefer i can post a few models i've used with
good success in the past. You'll note that in
the EE Course the latter 'lessons' have one model
for a Nichia which works out very well for constant
current (not necessarily a 'circuit' that puts out
cc) running LED's.

Take care,
Al


----------



## lymph (Oct 18, 2004)

Forgive my ignorance (I'm new to this), but I don't know how to measure the curve of an LED. How do I determine what the emission coefficient (N) and the other peramaters are?


----------



## MrAl (Oct 19, 2004)

Hi there lymph,

To get the curve of an LED you can look on the data sheet,
or you can measure it using two meters. One meter 
measures current, the other the voltage across the LED.

If you run the LED from a voltage power supply, you can use
a resistor in series with the LED to limit current as
you adjust the voltage up little by little. You measure
the voltage across the LED and current through the LED
and record these on paper or text editor.
You do this for current levels of say...
100ua, 200ua, 500ua, 1ma, 2ma, 5ma, 10ma, 20ma, 30ma
and for each current value measure the voltage and
record. After you're done, you have the curve.

To find the parameters N, Is, and Rs, you have to have the
equation of a diode and then you 'guess' the three values
and then compute V for each one of your current set points
(above). You then subtract the real V (measured) from
the computed V (with the equation) and call this the
error. You then square the error and add it to all the
other squared errors with the other current set points.
When you're done, you end up with a total sum-of-squared
errors that represents the total error for that set of
guessed parameters. You then systematically change
the parameters (you could actually try this by hand too)
and run through the equations again generating another
sum-of-squared errors. If the second sum is lower than
the first sum, you accept the new parameters and try
again. If the second sum is higher than the first sum,
you reject the new parameters and try to find new
ones (sometimes by reducing the increment in the parameters
used to get the new parameters).

In any case, it's best done using a program, so what i'll
do is post some models you can use and that might make it
easier. I should be able to get back here later tonight
or tomorrow morning with some decent models.

Note that in the EE Course sticky the model used isnt
'really' the spice type model, but it's still possible
to use this one in spice also using a function source.
I'm in a bit of a hurry today, but i should be able to
get back later tonight or tomorrow late morning/early
afternoon with some models you can use.

Take care,
Al


----------



## lymph (Oct 19, 2004)

Thanks MrAl! I look forward to seeing the models. Thanks also for the instructions on testing an LED. I will give it a shot when I have the time and see what I can come up with. Honestly, being the lazy person I am, I had hoped the manufacturers would have the models available for download like some of the IC/Op Amp makers do.


----------



## MrAl (Oct 20, 2004)

Hi there again lymph,

Here's two models for two popular LED's.
I have simpler ones posted somewhere here on CPF but
cant seem to find them. I didnt update my spice models
either so i'll either have to search for them again
or else redo them.

In any case, i've used these two with great success
in the past. They are both implemented as subcircuits.


.subckt LuxStar-1watt a c
* 06/2002 MrAl
d1 a c dx
.model dx d is=2e-17 n=3.40 RS=0.1 RL=1e6 cjo=100p
.ends


.SUBCKT LED-Nichia pos neg
*MrAl
VM pos 1 0
BX 1 2 v = -i(VM)*i(VM)*29.98
D1 2 neg DX
.MODEL DX D(IS=7.61384e-013 N=4.9954 RS=17.14)
.ENDS

If your spice environment cant handle an RL (not all can)
you can simply add a resistor in parallel to the 
part once you go to use it instead.

Take care,
Al


----------



## vicbin (Oct 20, 2004)

Hi Lymph & Al, /ubbthreads/images/graemlins/smile.gif

Let me help you Al, but again this one created by you for the Linear Switcher CAD years ago ! Ony LS 1W and 5 Watter, no 3 watt.

Credits goes to Al ! /ubbthreads/images/graemlins/grin.gif
[ QUOTE ]

.model LuxStarW1w D(Is=2.52144e-017 Rs=0.769946 N=3.33836 Cjo=100p Iave=350m Ipk=500m mfg=Luxeon type=LED)
.model LuxStarW5w D(Is=3.2946e-017 Rs=0.774809 N=6.5979 Cjo=200p Iave=700m Ipk=1000m mfg=Luxeon type=LED)


[/ QUOTE ]

This one is for Nichia White Led (quoted from Linear library)
[ QUOTE ]

.model NSPW500BS D(Is=0.27n Rs=5.65 N=6.79 Cjo=42p Iave=30m Vpk=5 mfg=Nichia type=LED)


[/ QUOTE ]

Hope this help.

Vic


----------



## MrAl (Oct 20, 2004)

Hi again Vic,

Thanks much Vic /ubbthreads/images/graemlins/smile.gif
I have to start organizing my information a little better
i think, but people dont ask for this much.

Take care,
Al


----------



## lymph (Oct 20, 2004)

Thanks MrAl and vicbin!


----------



## Ralf (Jun 17, 2005)

Hello

just tried this:

.model NSPW500BS D(Is=0.27n Rs=5.65 N=6.79 Cjo=42p Iave=30m Vpk=5 mfg=Nichia type=LED)

with cadence spectre simulator in spice mode and get some warnings
iave, type, vpk and mfg are not supported by the diode primitiv.

Does this happen with the native Bercley Spice as well? 

It seems not to be very important, but its always interesting, where
warnings come from ...

Cheers
Ralf


----------



## MrAl (Jun 17, 2005)

Hi there Ralf,

Yeah, those four parameters seem to be specific to
Linear Tech's idea of spice, but i havent tried every
version of spice out there so there may be others that
accept those params too.

Im sure you've already found out you can leave out those
params in the definition, but keeping them in mind would
still help when it comes time to evaluate the design for
the LED...if any of those params become higher than 
specified then you know the circuit might burn out the
LED so it should be redesigned.


Take care,
Al


----------



## juanlara (Jan 13, 2009)

there is a webpage of a company specialized in led modelling. they provide models with a third pin for the relative output flux. All the models are temperature dependant. They are very accurate models.
The link is: www.electro-designs.ucoz.com

I wish this helps.


----------

