You need to use EasyEDA editor to create some projects before publishing
Looking for PS2501 optocoupler spice model
2610 10
witor 4 years ago
I want to simulate a circuit with PS2501 optocoupler. There is no spice model for this particular optocoupler in easy eda library.  Any idea where could I find spice model that can be imported to easy eda and which would be compatible with easy eda simulation?
Comments
andyfierman 4 years ago
Just added: PS2501A ![image.png](//image.easyeda.com/pullimage/Gq8GnTzwb9lTOKvYZeDmxta7D3aNsXKGfiQdUhyt.png) Please post back if you need more help. :)
Reply
witor 4 years ago
@andyfierman Thank you very much for your amazing and quick help. Just a small thing, diode on the diagram symbol is wrong way around. Optocoupler that I actually have is a PS2501-1 ([http://www.cel.com/parts.do?command=load&idRootPart=121](http://www.cel.com/parts.do?command=load&idRootPart=121)) not the PS2501A-1 which you have added. There are some small differences between the two, like max collector emiter current for example. Do you think that I can use your model to simulate my PS2501-1? I want to make an electromagnet switching circuit: [https://easyeda\.com/editor\#id=\|995958f6bbfa4a568ad6e5a5e4f3e293\|1f9c04d111e5432ba710a08c31bebfc0](https://easyeda.com/editor#id=|995958f6bbfa4a568ad6e5a5e4f3e293|1f9c04d111e5432ba710a08c31bebfc0) V1 is just to simulate switching on and off. Ammeters helped me to chose the values for the resistors (that was one of the main reasons why I wanted to simulate this circuit) The purpose of L1 and R3 is to simulate XRN-XP20X15 electromagnet which resistance is 57 ohms, but I have no idea what is it's inductance... Is there any way to simulate this electromagnet being switched on and off to see how much back emf is induced? Again many thanks for adding this optocoupler.
Reply
andyfierman 4 years ago
Had a cheeky idea. Turns out that the PS2501 and PS2505 specs are identical except for the fact that: 1. the PS2505 is for a bipolar (AC) and the PS2501 unipolar (DC) input;  2. the PS2501 has half the input capacitance of the PS2505 (presumably because there are two diodes in anti-parallel across the input of the PS2505 and only one in the PS2501). So I modified the PS2505 model to turn it into a PS2501. * There are now symbols with associated spice models for both the PS2501 and the PS2501A in the library. And they have the LED shown the right way round now. :)
Reply
andyfierman 4 years ago
"XRN-XP20X15 electromagnet which resistance is 57 ohms, but I have no idea what is it's inductance" I wouldn't worry too much about the inductance and the back EMF. The actual back EMF is irrelevant because the flyback diode clamps it to a diode drop above the +ve supply. What you do care about is the peak current through the diode during the back EMF pulse which is simply `(5V-Q1_Vce_sat)/57R`. where Q1\_Vce\_sat is the saturation voltage of Q1 with the given base current \(which needs to be \>\> than the collector current divided by the beta of Q1 at that desired operating point\)  and a collector current of approximately 5V/57R\. If you are using a lifting magnet then your duty cycle is likely to be quite low so I'd guess that the period between flyback pulses will be in the order of 0.1s. So the average current through the diode will be low. If that's true then all you need to do is choose the flyback diode with a pulsed current rating of at least that value. You might want to think about replacing the 2N2222 with a logic level MOSFET and a gate to ground pulldown resistor. * When designing with optocouplers you must always design for the extreme values for CTR. You should copy and paste two copies of the model into the schematic. Rename one PS2501minCTR and set the BF parameter to {550*CTRmin/CTRnom} in the line: `.model detector NPN IS=100p ` BF=550 ` NF=1.3 BR=50 TF=2n TR=1.5n` `+ CJE=15p CJC=20p VAF=100 ISS=0 CJS=1p` Rename the other PS2501maxCTR and set the BF parameter to {550*CTRmax/CTRnom} where: CTRnom = the nominal value of CTR (you may have to work this out from the datasheet as the mean or geometric mean of the given min and max CTRnomvalues); CTRmin = the min value of CTR given in the datasheet; CTRmax = the max value of CTR given in the datasheet. Then change the name on the symbol to each different model and run sims with each in turn. The process of assigning models like this is described in the Simulation Tutorial.
Reply
witor 4 years ago
Once again thank you for your effort and work. Unfortunately when I try to run my simulation with the new PS2501 I get an error. Simulation works fine with PS2501A. Please have a look at my circuit. [https://easyeda\.com/editor\#id=\|995958f6bbfa4a568ad6e5a5e4f3e293](https://easyeda.com/editor#id=|995958f6bbfa4a568ad6e5a5e4f3e293)
Reply
witor 4 years ago
I have changed my circuit a little bit. The purpose of this circuit is to power an electromagnet and when switch is open the electromagnet needs to release a metal ball and a step of at least 50mV needs to be produced to start the fast timer. On my circuit the connector goes to the fast timer (this one: [https://www.philipharris.co.uk/product/physics/forces-and-energy/motion-and-acceleration/fast-timer/b8h28573).](https://www.philipharris.co.uk/product/physics/forces-and-energy/motion-and-acceleration/fast-timer/b8h28573) Electromagnet's resistance is 57 ohms so with 5V powering it there should be 87mA going through the transistor. Is a mosfet really necessary? I could add a resistor in series with the magnet to further reduce the current through the electromagnet an the transistor. 60mA is sufficient to hold the ball which should be ok for 2N2222 which I already have. Electromagnet will not be kept on for very long. Somehow I have the feeling that I over complicated the whole thing... I wanted to use the optocoupler to electrically insulate the timer from the magnet to make sure that back emf induced by the electromagnet will not mess up with starting of my fast timer. But maybe there is a better way. In general what do you think about my idea? I don't fully understand what you said about optocouplers and CTR. I will try to learn more about it later today so hopefully it will make more sense to me. Sorry for my lack of knowledge. I still have a lot to learn and I really appreciate your help.
Reply
andyfierman 4 years ago
@witor, First point: sorry about the simulation problems. I have no idea what is going on! The PS2501 model is basically the same as for the PS2505 and has the same basic structure as the PS2501A but EasyEDA is completely failing to parse and run it properly. It is the same issue that another user has already raised a Bug report about. I then raised it further with support and we are investigating but at the moment we can't find the cause. Second point: I assumed that you had some sort of galvanic isolation requirement that meant that you needed an optocoupler. If all you're concerned about is the back emf of the electromagnet then forget it: there's absolutely no benefit in using an opto. Just use a simple logic or switch controlled input directly to your 2N2222 or mosfet switch transistor. Here's an example of a simple low side switch of the sort you want: [https://easyeda\.com/andyfierman/Low\_side\_NMOSFET\_switch\_\-wu0ictL3l](https://easyeda.com/andyfierman/Low_side_NMOSFET_switch_-wu0ictL3l) If I understand your application correctly (measuring G by a ball drop?) then I suspect that you should debounce the switch signal to the electromagnet driver so that the fast timer gets a clean signal into it. How about this for a quick and simple solution... [https://easyeda.com/andyfierman/electromagnet-driver-with-debounced-control-switching](https://easyeda.com/andyfierman/electromagnet-driver-with-debounced-control-switching)
Reply
witor 4 years ago
Yes measuring g by free fall is exactly what I want to do with my students. I have already designed and printed a mount for the electromagnet but I couldn't get it to work with the fast timer. Then I realised that fast timer needs nice and clean increase in voltage to start it. Your circuit looks great and seems to do exactly what I want (looking at the simulation). I don't fully understand how it is doing what it is doing and as the result I am not sure about the brake before make switch. I presume that In the simulation the switch is flipped from one contact to another in zero time, but in reality flipping the switch from one contact to the other will take some time. Will this not cause the stopwatch to be started at the time which is not exactly the same as the time when the ball is released? Will the overall time measured by the fast timer not depend on how quickly the switch is flipped? My objective is to achieve simultaneous release and timer start (to within few tenths of a millisecond) which should lead to the repeatability that I am after. Small delay in release (few miliseconds) would be acceptable as long as it is the same every time the ball is released.
Reply
andyfierman 4 years ago
"Will the overall time measured by the fast timer not depend on how quickly the switch is flipped?" No. Look closely at the rising edge of the V(trig) and the current in the fly back diode. You'll see that the steps are simultaneous. The only timing error is that it does take a short time for the magnetic field to collapse and hence for the ball to be released. The time is hard to calculate because you don't have enough information about the inductance and the magnetic parameters of the core material but it should be small compared to the drop time. Almost all SPST switches are Break-Before-Make otherwise the two poles would momentarily short together, which could in many applications be disastrous. The use of the SPST switch with a bistable not only denounces the switch action but very accurately removes any effect of the time it takes for the switch to move mechanically. The bistable only changes state when the switch reaches the new position, not when it starts moving. And the Trig output rises only as the bistable flips into the emag off state so - apart from a few 10's of ns propagation delay - it is simultaneous with turning the emag off. Is good yes?
Reply
witor 4 years ago
I should have paid more attention in my electronics classes 25 years ago... Like I said in my previous post I didn't really understand how your circuit works. Now, after learning a bit more about bistable multivibrators I think I got it. I understand now that electromagnet will stay on when base of Q10 lose connection with GND and will be switched off when connection is made between base of Q9 and GND which will also switch on the voltage for the timer. That is exactly what I was looking for. Now i need to make a pcb, put it together and test it :) I hope that I will be finally able to do this experiment properly... Thank you very much for your help. By the way, EasyEDA is just amazing.
Reply
Login or Register to add a comment
goToTop
你现在访问的是EasyEDA海外版,使用建立访问速度更快的国内版 https://lceda.cn(需要重新注册)
如果需要转移工程请在个人中心 - 工程 - 工程高级设置 - 下载工程,下载后在https://lceda.cn/editor 打开保存即可。
有问题联系QQ 3001956291 不再提醒
svg-battery svg-battery-wifi svg-books svg-more svg-paste svg-pencil svg-plant svg-ruler svg-share svg-user svg-logo-cn svg-double-arrow -mockplus- -mockplus- -mockplus- -mockplus- -mockplus- -mockplus- -mockplus- -mockplus-@1x -mockplus-

Cookie Notice

Our website uses essential cookies to help us ensure that it is working as expected, and uses optional analytics cookies to offer you a better browsing experience. To find out more, read our Cookie Notice