Help required for IL300 simulation model

Hello members,

I am facing some issues with IL300 simulation model.
I’ve downloaded the SPICE model from the official site and edited it to simplify my understanding.

  • IL300 Optocoupler Model
  • Pinout:
  • 1: LED Anode (LEDA)
  • 2: LED Cathode (LEDC)
  • 3: Photodiode 1 Cathode (PD1_C)
  • 4: Photodiode 1 Anode (PD1_A)
  • 5: Photodiode 2 Anode (PD2_A)
  • 6: Photodiode 2 Cathode (PD2_C)

.SUBCKT IL300 LEDA LEDC PD1_C PD1_A PD2_C PD2_A

  • Parameters
    .PARAM K1=0.012
    .PARAM K3=1

  • LED Model
    D1 LEDA N1 LED_MAIN
    VLED N1 LEDC 0

  • Photodiode 1 Model
    GPD1 PD1_C PD1_A N1 LEDC {K1}
    CPD1 PD1_A PD1_C 12P
    RPD1 PD1_A PD1_C 15G

  • Photodiode 2 Model
    GPD2 PD2_C PD2_A N1 LEDC {K1*K3}
    CPD2 PD2_A PD2_C 12P
    RPD2 PD2_A PD2_C 15G

  • Diode Model for LED
    .MODEL LED_MAIN D(IS=1.51E-16 N=1.495822 RS=2.624361 BV=5 IBV=1U CJO=15P VJ=1 M=0.5 EG=1.424 TT=500N)

.ENDS IL300

I’ve also created a symbol based on the model’s pin declaration
But the problem is when I am adding the model from the file, the Model dropdown shows nothing.


If I press OK with the model empty it doesn’t load.
When I again open the Edit Simulation Model it throws an error
and Kicad crashes.
I’ve also tried some other SPICE models from different vendors. But they show some models in the dropdown.
I have also tried this solution but nothing helped.
I’m very new to the kicad8 ngspice simulation.
Where I’m doing it wrong? Help!

Best Regards
Subhadeep

This is probably the correct modification of the model to make it ngspice-compatible:

.SUBCKT IL300  LEDC LEDA PD1_C PD1_A PD2_C PD2_A PARAMS: K1=0.012 K3=1

DLED LEDA 10 DEMIT
VV1  10 LEDC 0

BFPD1 PD1_C PD1_A I = {K1}*I(VV1)
CPD1 PD1_A PD1_C 12P
RD1  PD1_A PD1_C 15G

BFPD2 PD2_C PD2_A I = {K3*K1}*I(VV1) ;K2=K3*K1
CPD2 PD2_A PD2_C 12P
RD2  PD2_A PD2_C 15G

.model DEMIT D IS=1.51E-16 N=1.495822 RS=2.624361 BV=5 IBV=1U
+ CJO=15P VJ=1 M=0.5 EG=1.424 TT=500N
.ENDS

Replace the LTSPICE F source (using ‘value’) by a B source. I will check if this can be done automatically in a future ngspice version.

VV1 is used to measure the current through the LED. This is then coupled to the photodiodes by controlling the diode current. In your version there seems to be no coupling. There seems to be no limit to the output voltage in the Vishay model when the optocoupler is run with output open, somewhat weird indeed.

Put the model (and only the model) into a file and attach it to the symbol.

Thank you for the help. I’m now able to load the model to the symbol.

.SUBCKT IL300  LEDC LEDA PD1_C PD1_A PD2_C PD2_A PARAMS: K1=0.012 K3=1

DLED LEDA 10 DEMIT
VV1  10 LEDC 0

BFPD1 PD1_C PD1_A I = {K1}*I(VV1)
CPD1 PD1_A PD1_C 12P
RD1  PD1_A PD1_C 15G

BFPD2 PD2_C PD2_A I = {K3*K1}*I(VV1) ;K2=K3*K1
CPD2 PD2_A PD2_C 12P
RD2  PD2_A PD2_C 15G

.model DEMIT D IS=1.51E-16 N=1.495822 RS=2.624361 BV=5 IBV=1U
+ CJO=15P VJ=1 M=0.5 EG=1.424 TT=500N
.ENDS

I have saved this as IL300.sub and it loaded.

This topic was automatically closed after 90 days. New replies are no longer allowed.