I'm using an optocoupler to measure a voltage, I'm making a current loop to control the current through the LED, so I'm using three op-amps: one to measure the voltage, one to set up a current offset because at very low currents the CTR is far from linear and finally a third one to make the actual current loop.

Circuit diagram

I measure the voltage with a uC in the points marked and get this characteristic

Graph of transistor current vs LED current

The saturation starts at a quite low current for the LED, about 5mA. The results I get playing with the operation point aren't bad - the right scale is for the error, both scales in volts.

Expected and real behaviour

But I wonder if its a better way to to this, for example I'm not using the base of the transistor externally, would be that a better option than the current offset? Would that increase the linear region?


Kevin White, do you mean doing this:

Circuit diagram

That's definitely a simpler solution and it allows to avoid the math for calculating the voltage through the op-amp transfer function and the linear regression.

  • 3
    \$\begingroup\$ Anyhow, this is my goto document for better (in various ways) linear optocoupler circuits: avagotech.com/docs/5954-8430E As for power supplies, the non-linearities are accounted for when designing the control loop (if I recall correctly) so it doesn't need to be very linear. You may want to ask that as a more focused question, e.g. "how do SMPS designs deal with optocoupler non-linearities?". The latter is dealt with in vishay.com/docs/83711/appn55.pdf (didn't yet read) \$\endgroup\$ – Fizz Oct 5 '15 at 2:09
  • 2
    \$\begingroup\$ The option of using voltage/frequency and frequency/voltage to take advantage of the digital optocouplers sounds like a good idea. \$\endgroup\$ – Luis Ramon Ramirez Rodriguez Oct 5 '15 at 2:26
  • 1
    \$\begingroup\$ Yes in more expensive designs, but SPMSes don't do that. After looking at it more detail, the last (vishay) document I indicated is actually pretty far from standard SMPS designs. You'll want to read one of Christophe Basso's books for that. The calculations that makes a simple TL431+opto SMPS possible are rather complex. \$\endgroup\$ – Fizz Oct 5 '15 at 2:39
  • 1
    \$\begingroup\$ Actually, I had to dig a 3rd article to get the gist of it: "By creating the error signal on the secondary side rather than trying to transfer a signal to the primary that is proportional to the output voltage, the effects of the optocoupler’s nonlinearity and high gain variation can be minimized." (This was really worthy of its own EE.SE question...) \$\endgroup\$ – Fizz Oct 5 '15 at 3:37
  • 1
    \$\begingroup\$ Yes, the way you have shown should give significant improvement over a single optocoupler. I used that arrangement successfully before the devices like the IL300 were available. \$\endgroup\$ – Kevin White Oct 5 '15 at 4:00

A method that I have used successfully to transfer a linear signal through an optocoupler is to use a second optocoupler to provide the negative feedback. This compensates for the non-linearities. The LED of the second optocoupler is put in series with the main one and the phototransistor from the second is used in the feedback path of the driving amplifier.

There are available opto-couplers such as this one (Linear Optocoupler) with two photodiodes illuminated from the same LED specifically for this purpose.

enter image description here


Since you are digitizing this signal anyway, I would consider this:

Abandon the micro's ADC and use a discrete one. Then isolate the digital lines instead. This gets you much better linearity at (possibly) a slightly higher BOM cost.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.