Hello guys.
Sorry for very noob question, but I'm fighting with this issue several days and can not find solution. Reason seems to be very simple, but I really can not find it. I definitely need one more pair of eyes :)
Here is a link to simple project, using PC817: [https://oshwlab.com/AlexeyL/mosfet-key-simulation](https://oshwlab.com/AlexeyL/mosfet-key-simulation)
**Story**: I have mosfet key module, which doesn't work on frequencies more than 1 kHz. I don't have oscilloscope and would prefer not to spend money on it (at least for now). That's why I wanted to run simulation to better understand what's going on and how to fix issue. Schematics of mosfet key is optional for this question, but it can be found on page "Mosfet key simulation" in my project.
When I met problems with simulation, I started reading simulation tutorial. I didn't finish it on 100% yet, but I'm in progress :) So, I created simplified version of schematics, which has only optocoupler PC817. It can be found on page "PC817 simulation"
**What is the problem? **By some reason I see that input current 12.6 mA of optocoupler causing only 59 uA (yes, uA, not mA) collector current. In real circuit it is definitely not like that. According to datasheet, collector current (Ic) should be much higher.
**Question**: what I did wrong? Are there any issues in schematics? Or may be Spice model of PC817 is wrong?
**What I tried**:
1\. I tried all available spice models of PC817 \(user\-provided\) in Easy EDA\, but some of them has issues\, another have similar behavior\.
2\. I exported netlist for LTspice and found this spice model for PC817:
`.subckt PC817C 1 2 3 4 Igain=2.3m`
`R1 N003 2 2`
`D1 1 N003 LD`
`G1 3 N004 N003 2 {Igain}`
`C1 1 2 18p`
`Q1 3 N004 4 [4] NP`
`.model LD D(Is=1e-20 Cjo=18p)`
`.model NP NPN(Bf=1200 Vaf=140 Ikf=100m Rc=1 Cjc=19p Cje=7p Cjs=7p C2=3e-15)`
`.ends PC817C`
I tried to find3rd party spice models. Unfortunately it is not that easy for PC817. I found only 2 forums where people are sharing this model and model is almost 100% the same. I tried that models - my results didn't change
3\. I decided to check\, if it is issue of Easy ADA simulator\. I installed LTSpice and run exported netlist there\. Results were the same\.
So, now I'm completely lost. Help me please :) What I'm doing wrong?
Chrome
87.0.4280.141
Windows
10
EasyEDA
6.4.14