Looking for an Optocoupler

I have been searching the library for an Optocoupler similar to CNY17

Is this available in QSpice or do I need to start looking for a spice model?

Thanks
/Jonas

Vishay offers spice model for CNY17

https://www.vishay.com/docs/80016/spicebjt10ma.zip

Kelvin

2 Likes

@JonasF

## Generic Symbol for Optocoupler
These are generic symbols for 4-pins and 5-pins optocoupler model, pin sequence is A K C E or A K C E B. Following examples are built based on these generic symbol. You may reuse these symbols for other optocoupler spice model.
Optocoupler-AKCE.qsym (1.6 KB)
Optocoupler-AKCEB.qsym (1.8 KB)

Vishay offers a 4-pins CNY17 spice model (BJT_10mA.txt) and LTspice with a 5-pins CNY17 spice model (CNY17.sub)

## Vishay CNY17 model
This is simulation file with Vishay CNY17 spice model
Parent.LTspice.CNY17 - Ic vs Vce Characteristic.qsch (4.4 KB)
BJT_10mA.txt (4.4 KB)

## LTspice CNY17 model
This is simulation file with LTspice CNY17 spice model. I rename CNY17.sub to CNY17.txt for file can upload to forum. LTspice CNY17 uses Igain to define CNY17-1, CNY17-2 and CNY17-3, which is included in this schematic example.
Parent.LTspice.CNY17 - Ic vs Vce Characteristic.qsch (4.4 KB)
CNY17.txt (305 Bytes)

5 Likes

Hi, How should I do to include the library .lib CNY17.txt in qspice?

There are multiple way to include library, and this procedure assume you didn’t add library folder into global path,

  • Copy library file into same folder of your Qspice schematic (.qsch). Library can have extension .txt, .lib, .sub etc… (
  • In schematic, type “T” to place a text box, input “.lib [library name]”. For example, your library name is CNY17.txt, you input .lib CNY17.txt

Hi
I have some questions about model references by followed pic


But I saw that their syntax is the same, so what exactly is the setting that causes the parameters of CN17-3 to be referenced?

For optocoupler, they normally have suffix to identify their Current Transfer Ratio (CTR). For example, CNY17 with -1, -2, -3 and -4 for four group of CTR.
This post ask for CNY17 model, and LTspice standard library contain .subckt of this model, and I took that and import to Qspice.
This .subckt with a parameter {Igain}, to control CTR; LTspice standard library assign Igain=.724 for CNY17-1, Igain=1.39m for CNY17-2 and Igain=2.44m for CNY17-3.

I just simply created one symbol, and decide to include these three choice. You can comment any two of them and uncomment one to make that Igain active. You can right click on text, select “this text is a comment” OR hover mouse on text, type " ; " to toggle comment.

Thanks so much
Got it!

Hi,

Maybe a stupid question, but how did you come up with the gain parameters for this device? Specifically the CNY17. I can’t seem to come up with the same Gain Parameter

You have to be curious

1 Like

Is Igain being derived from the datasheet or is it from some test methodology. If Igain is the CTR, then I would expect these transfer ratios to be what is presented in the datasheet, but that does not seem to be the case. Can you please explain?

Here is explanation above:

Best regards