Community
EAGLE Forum
Welcome to Autodesk’s EAGLE Forums. Share your knowledge, ask questions, and explore popular EAGLE topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

led simulation

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
chiefenne
3260 Views, 6 Replies

led simulation

Hi,

 

I am trying to simulate an EAGLE 8.6 schematic containing some leds. The suggested model for an led is DMOD, though it seems to me that it rather fits a "standard" diode than a led. This I conclude from the calculated voltage drop (~0.8V).

 

How do I add a spice model for a "standard" led like a red led?

Do I need to download a model (for sure there exist plenty) and adjust some parameters?

What is the approach that I should follow?

 

Same question for Zener diodes ...

 

Andy

 

6 REPLIES 6
Message 2 of 7
rachaelATWH4
in reply to: chiefenne


@chiefenne wrote:

Hi,

 

I am trying to simulate an EAGLE 8.6 schematic containing some leds. The suggested model for an led is DMOD, though it seems to me that it rather fits a "standard" diode than a led. This I conclude from the calculated voltage drop (~0.8V).

 

How do I add a spice model for a "standard" led like a red led?

Do I need to download a model (for sure there exist plenty) and adjust some parameters?

What is the approach that I should follow?

 

Same question for Zener diodes ...

 

Andy

 


Hi Andy,

 

The best thing to do is to download a SPICE model for the LED you wish to simulate and add it to the particular LED device you are using in the your library. When you open the library and go into the device on the left side you will find a button to allow you to add a SPICE model. Once it's added, save your library and then update your library in your schematic to ensure the model is associated with the part in there. Now when you run the simulation you should see the expected results.

 

Best Regards,

 

Rachael

Message 3 of 7
chiefenne
in reply to: rachaelATWH4

Thank you for your answer.

This is more or less what I tried to do already. I have somehow difficulties to find the correct workflow.

 

I found a spice model like:

 

*Typ RED,GREEN,YELLOW,AMBER GaAs LED: Vf=2.1V Vr=4V If=40mA trr=3uS
.MODEL DLED2 D (IS=93.1P RS=42M N=4.61 BV=4 IBV=10U
+ CJO=2.97P VJ=.75 M=.333 TT=4.32U)

I do not know if this is the correct syntax. I stored it as LED_RED.mdl. Then I loaded the library ngspice-simulation.lbr from the folder EAGLE 8.6.0 /cache/lbr

There I opened the LED device and used the symbol on the left as you suggested and loaded (mapped) the model to the led. So far that seemed to work.

 

Then I updated the library in my schematic and tried to simulate again.

 

Following error came up (for each led):

Error on line 15 : d_d3 n_18 n_6 led_red
  Unable to find definition of model led_red - default assumed 

These are the devices and models in the netlist tab:

 

* --------- devices ---------
D_D3 N_18 N_6 LED_RED 
R_R8 N_17 ACCU+ 1 
D_D8 N_6 N_3 LED_RED 
V_V2 N_2 0 DC 5V AC 0 
R_R5 N_15 N_17 33 
D_D1 N_4 N_3 LED_RED 
D_D7 N_7 N_11 LED_RED 
Q_Q1 N_3 N_5 0 QNPN 
R_R7 N_9 N_17 33 
D_D5 N_9 N_8 LED_RED 
D_D6 N_8 N_10 LED_RED 
D_D4 N_15 N_7 LED_RED 
R_R4 N_18 N_17 175 
D_D10 N_10 N_3 LED_RED 
D_D9 N_11 N_3 LED_RED 
V_V1 ACCU+ 0 DC 12V AC 0 
D_D2 N_14 N_4 LED_RED 
R_R3 N_14 N_17 175 
R_R6 N_2 N_5 1.4k 

* --------- models ---------

* model file: D:/Dropbox/Elektronik/EAGLE_Schaltpläne_und_Platinen/Simulation_Test/QNPN.mdl
**********************
* Autodesk EAGLE - Spice Model File
* Date: 9/17/17
* basic npn intrinsic model
**********************
.MODEL QNPN NPN


* model file: D:/Dropbox/Elektronik/EAGLE_Schaltpläne_und_Platinen/Simulation_Test/LED_RED.mdl
*Typ RED,GREEN,YELLOW,AMBER GaAs LED: Vf=2.1V Vr=4V If=40mA trr=3uS
.MODEL DLED2 D (IS=93.1P RS=42M N=4.61 BV=4 IBV=10U
+ CJO=2.97P VJ=.75 M=.333 TT=4.32U)

Is this the way how it should work?

Message 4 of 7
edpataky
in reply to: chiefenne

Andy, 

 

 Rachael gave the right advice, thank you. The issue seems to be that model name in the file does not match the filename . 

 

* model file: D:/Dropbox/Elektronik/EAGLE_Schaltpläne_und_Platinen/Simulation_Test/LED_RED.mdl
*Typ RED,GREEN,YELLOW,AMBER GaAs LED: Vf=2.1V Vr=4V If=40mA trr=3uS
.MODEL DLED2 D (IS=93.1P RS=42M N=4.61 BV=4 IBV=10U
+ CJO=2.97P VJ=.75 M=.333 TT=4.32U)

 

Your model should have ".MODEL LED_RED" not ".MODEL DLED2"

 

Change that and it should work.  🙂 

Message 5 of 7
chiefenne
in reply to: edpataky

That worked and I understand the workflow now.

 

Thank you and thanks to rachaelATWH4 as well.

I would like to accept both answers as solution.

 

Andy

Message 6 of 7

Where can I find spice models for the leds

Message 7 of 7
edpataky
in reply to: chiefenne

We currently do not provide libraries of spice models.  Typically LED models would be the same as standard diode models (assumming the characteristics are the same), so any manufacturer's models like those from Diodes inc (or other) would work.  Of course the best model is the one that matches the device you actually want to use, and the manufacturer website would be the best place to find those.    

 

Note that a diode models is typically easy to fill in .. the format from the ngspice manual is here with a basic example:  

.model DIODE1 D (bv=50 is=1e-13 n=1.05)

and the various options you can add are in a table in the manual under "Diode Models".  These values can be found on the datahsheet for the device you are using .. This is a manual process for sure, but it is definitely doable .. we may improve this in the future but this is how you would do it today.  The best route would be to find a model that is similar to the device you want to use, and use that model.  Depending on how you use them (normal on/off, low frequency usage, or maybe high frequency sensing) you may need more or less parameters so again, unless you are an expert making models, it is best to just find a proper model from a manufacturer.  Unfortunately they do not all provide them, so similar device models are usually the way to go when you cannot find them.  In other words, if you have a standard LED (not high brightness, not high freq use) that you intend to use then just use any standard mdoel, and maybe just cross reference the  basic specs like sat current and reverse breakdown voltage, resistance, etc. from the datasheet, to the model parameters.  Hope that is helpful.   

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report