How to design for opto-couplers if the output can be so different? - Page 1
Forum section: electronics / projects

author: MathWizard
author_rank: Super Contributor
timestamp: January 15, 2022, 10:36:41 pm
content: I was looking at the datasheet of a common K817 opto, and they list typical Iout/Iforward . And they are about min 0.5x to max 6x, no typical value.https://pdf1.alldatasheet.com/datasheet-pdf/view/26344/VISHAY/K817P.htmlIn ltspice I used a K817A, and it has a beta around 1.29 across a fairly wide forward current. I've never really used or measured any that I own. But down the road I will.If I was making a 3904 circuit, using 20uA of base current, and the beta was 200 or 300, that's still not that bad or unexpected, 4mA vs 6mABut with these opto's, if you planned on some 10mA Iforward, how or why would you want to deal with having possibly 5mA to 60mA output ??And I see lots of K817 used in lots of computer SMPS.........are these more akin to JFET's where you really have to measure each 1 before hand, or order a big batch of ones that are all about the same, which is what the SMPS makers must doSo how bad are opto-s really? And why don't they make them with a tighter, better defined tolerance ?

author: Benta
author_rank: Super Contributor
timestamp: January 15, 2022, 11:12:21 pm
content: So?What's your problem?Bipolar transistors or other devices have similar spreads. No issue when designing properly.If you expect that a simple optocoupler should act like a precision isolation amplifier, well...

author: T3sl4co1l
author_rank: Super Contributor
timestamp: January 15, 2022, 11:56:26 pm
content: They have tighter bins -- if not for that exact part, then other families offer it.Pay attention to minimum CTR: the LED ages over time, reducing this. You generally want to design to this, and deal with the effect this has on bandwidth or switching speed (i.e., turn-on being faster than turn-off).And, at that, switching speed is not usually something to worry about as there are better devices to use; plain phototransistor types aren't good for much over 10kbps, or a bit more using a three-terminal type with B-E resistor (e.g. 4N35).Tim

author: MathWizard
author_rank: Super Contributor
timestamp: January 16, 2022, 12:05:45 am
content: Ok so in general then you actually have to measure it ? I've never had an opto failure yet, but I would have just grabbed 1 from my shelf and put it in (I only have k817)Here's part of a real sensing control circuit from a 750W PSU, the Vc of the opto is sensed by an op-amp which compares it with the PWM duty cycleYeah I'm not designing anything with them, but yeah, I'll have to find some literature on them, probably nothing in my books on them.

author: magic
author_rank: Super Contributor
timestamp: January 16, 2022, 12:11:39 am
content: Nobody measure anything, they deal with it by feedback.TL431 will sink increasingly more current until the primary chip notices and the voltage falls enough to make the 431 happy.For TL431 it's only a few mV increase in feedback voltage to go from zero to 10mA or more pulled from the opto.

author: MathWizard
author_rank: Super Contributor
timestamp: January 16, 2022, 12:18:46 am
content: Ok but in some non high gain feedback case, I can't just assume it would work

author: T3sl4co1l
author_rank: Super Contributor
timestamp: January 16, 2022, 12:21:56 am
content: Right. R3 sets TL431 minimum current, R1 sets opto maximum current. Stuff on the right is whatever; usually much compensation is not needed, nor very desirable. (What is this, a voltage mode supply? Feed-forward at the feedback divider too (C1+R6), yech.)CTR affects the loop gain, so you should do such a design accounting for loop stability at both extremes. CTR range can be simulated by selecting other load resistors (RN1 and such). I don't know that most designers even bother with this, as the design shouldn't be so close to instability that the CTR spread threatens to break anything.Tim

author: magic
author_rank: Super Contributor
timestamp: January 16, 2022, 12:25:46 am
content: Quote from: MathWizard on January 16, 2022, 12:18:46 amYep, CTR is all over the place and an individual unit isn't very linear either. Basically,Quote from: Benta on January 15, 2022, 11:12:21 pm

author: MathWizard
author_rank: Super Contributor
timestamp: January 16, 2022, 12:57:05 am
content: Here's what got me going today, I was going to practice a mosfet example, and it has an opto, so it's about time I tried an opto againFor some semi-conductor instruction I've been watching this guy, good lectures

author: David Hess
author_rank: Super Contributor
timestamp: January 16, 2022, 04:08:47 am
content: Quote from: T3sl4co1l on January 15, 2022, 11:56:26 pmPease used the example shown below.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: January 16, 2022, 04:19:29 am
content: I've used 4N35 with 47 to 100k B-E myself; note this significantly reduces CTR, and they rarely show min CTR vs. Rbe in datasheets so you're kind of on your own there. 2.2M sounds like enough not to reduce CTR much (at typical drive currents), but also at least take the edge off the slowness.Tim

author: MathWizard
author_rank: Super Contributor
timestamp: January 16, 2022, 06:44:22 am
content: Well I made the opto/mosfet/lamp circuit, and similar to his video I used a 28V, 2.24W bulb, and for the calculations I assumed the Vce was saturated, and the mosfet in ohmic region, and said the bulbs were like 350R each, and hey it works, I got the same answer as ltspice.Now I'm trying the TL431 circuit, w/ 12V as the rail being watched, but I see the Vref would be 57mV less than the internal 2.495V ref, so doesn't that mean the op-amp would be driven low and the BJT offBut right that's the point, it is supposed to be off, it's looking for a slight over-voltage.

author: ajb
author_rank: Super Contributor
timestamp: January 18, 2022, 05:33:00 am
content: The isolated switch circuit is insensitive to CTR because you only need to get enough current at the output to pull the FET's gate up against that pulldown resistor. Since the resistor is 15kΩ, it'll only take 800μA to get the gate all the way up to 12V (less the opto's VCE). With something like 17mA of forward current you need a CTR of only ~21% for it to work. Actually lower CTRs will work as well, depending on the threshold voltage of that FET and how much Rds you're willing to tolerate. Higher CTRs won't hurt anything, because the opto can't pull the gate up higher than the supply voltage. So it hardly matters what the precise CTR is. Higher CTRs can switch the FET on somewhat faster, but turnoff will be determined by the pulldown resistor regardless--and if you cared about switching speed you wouldn't be using this circuit anyway. This generally holds for all digital applications of optocouplers, it's pretty easy to design a circuit that works across the whole CTR range when it only needs to count to one.Analog applications, as others have noted, require some sort of feedback. There are (or used to be?) some optocouplers that have one LED and two phototransistors in the same package that are designed for general-purpose analog isolation. The idea is that you'll get about the same output current from both phototransistors for a given input current, so you can use one of them as feedback on the sending side to adjust the LED drive current to ensure the signal on the other one is what you want. In practice the matching isn't necessarily great, though, so it's hard to get any degree of accuracy out of them.One one project I tried setting an input threshold on the transistor side of an AC-input optocoupler, which is sort of the inverse of the above with two LEDs and one phototransistor, but even on those the CTR could be significantly different between the two polarities. Which polarity had the higher CTR varied between specimens, so it wasn't even just the construction (like one LED having slightly worse optical coupling to the phototransistor) that caused that difference.