Optocoupler Circuit Design and Detailed Analysis

Actually, Optocoupler circuit design is not that difficult as some thought. It’s just like you are designing a BJT circuit. If a BJT has its beta or current gain, optocoupler has its CTR or current transfer ratio. Once you know what a CTR is and learn how to use it, then Optocoupler circuit design is that easy.

Current transfer ratio or just CTR is the ratio of the collector to the forward current which is expressed in percent.

CTR = ( Ic / If ) x 100%

Collector current is the current that will flow to the collector of the transistor side of the optocoupler. On the other hand, the forward current is the current that flow to the diode side of the optocoupler.

Optocoupler Circuit Design
Figure 1

Basically the diode side is linked to the transistor side by the device current transfer ratio. Apart from this information, Optocoupler circuit design is just like designing ordinary circuit wherein you are using KVL, KCL, ohms law and so on.

Optocoupler Circuit Design Steps

1. Select a Circuit Structure

Do not complicate your circuit. The lesser the parts count the better in two different ways. First reason is of course a lesser cost. The other reason is that with a lesser parts, the lower the total failure rate and the higher the circuit reliability.

Supposing you are only interested to
transmit signal from primary side controller to the secondary controller, your circuit must be simple as below.

Optocoupler Circuit Design
Figure 2

Above circuit configuration is an inverter. If you want a non-inverting signal, you can use below structure.

Optocoupler Circuit Design Example
Figure 3

The first circuit is normally an inverting one if you are going to saturate the transistor. However if you bias the circuit to operate in the linear region, you can get a voltage higher than zero at Vout node. The second circuit is a non-inverting configuration which is comparable to a common collector configuration of a BJT. But BJT common collector is more complicated than this circuit with the presence of the base current.

2. Select an Optocoupler Part

The next step in Optocoupler circuit design is to select an optocoupler part. In doing so, you must consider your application. If your application is a switch, you must select a device with a higher minimum CTR. If your application is linear, you can consider using the one with a tight CTR range. A tight CTR will correspond to a smaller variation.

If the design is to be exposed in high surrounding temperatures,
you better select an optocoupler with a CTR that will not much affected with the ambient temperature. Optocoupler CTR will decrease with increasing temperatures. For example in below graph, the relative CTR will decrease much at 100’C ambient temperature.

Optocoupler CTR versus ambient temperature
Figure 4

For long term product operation, you better consider also the life expectancy curve. As you see in the graph below, CTR will decrease as the device got aged.

Optocoupler Life
Figure 5

3. Set Circuit Operation

This time you have to set the operating point of the circuit. To make this more informative, we are going to refer to the circuit below.

Optocoupler Circuit Design
Figure 6

Define Output Level

The above circuit is can be configured to operate at linear or saturation regions. At saturation the Vout node is zero ideally while above zero but lower than Vcc in linear. When there is no bias in the diode side the level of Vout is simply the same to Vcc. So if you design the circuit as a switch, you must ideally assume a zero VCE or Vout when the Optocoupler is conducting. If the application is linear, you must define a particular level in the Vout node to be used in the design.

Define Rf Value

You can freely choose this value. However, in some applications you need to be careful. Most of the times, Vdd is derived from a digital circuit or device such as MCU or DSP. If so, set the value of Rf in such a way the current rating of the digital circuit or device is not exceeded. For MCU and DSP the sink and source currents are usually ranging from 4mA to 9mA (some other may reach higher than 9mA, you can always check in the datasheet). Supposing the current rating is only 4mA maximum, set actual forward current to at most 80% of it. So Rf would be

If = ( Vdd – Vf ) / Rf

Rf > ( Vdd – Vf ) / ( 80% x Irating )

(Vf is the forward voltage of the optocoupler)

Determine Rc

After defining Rf and the forward current, you can determine the value of Rc.

For Saturation Setting

( Ic / If ) < CTRdevice

Ic = ( Vcc – VCEsat ) / Rc

Rc > [ ( Vcc – VCEsat ) / ( CTRdevice x IF ) ]

For Linear Setting

( Ic / If ) = CTRdevice

Ic = ( Vcc – VCE ) / Rc

Rc = [ ( Vcc – VCE ) / ( CTRdevice x If ) ]

 

Design Example

Applying the Optocoupler circuit design steps above will make the discussion more informative. Now, let us provide values for the circuit below. The output should provide logic low and logic high level. A logic low level is any voltage below 0.8V while a logic high level is equal to Vcc. The supply Vcc is 5V provided by an MCU with a source and sink current capability of 4mA. The optocoupler CTR is 80% and the diode drop is 0.7V. Consider Vcc of 5V.

Optocoupler Circuit for switch application

Figure 7

 

Select Rf Value

Rf = [ ( Vdd – Vf ) / ( 80% x Irating ) ]

Rf > [ ( 5V – 0.7V ) / ( 80% x 4mA ) ] = 1.34 kohm

We can set Rf to 1.5k standard value.

Solve for If

If = [ ( 5V – 0.7V ) / 1.5 kohm ] = 2.87 mA

Determine Rc

Rc > [ ( Vcc – VCEsat ) / ( CTR x If ) ] = [ ( 5V – 0V ) / ( 80% x 2.87mA ) ] = 2.18 kohm

We assume VCEsat equals zero for worst case.

Now the final circuit with values is

Optocoupler as a switch
Figure 8

Design Check

We will verify if the forward current If is not exceeding the maximum source and sink current of the MCU.

If = [ ( 5V – 0.7V ) / 1.5 kohm ] = 2.87 mA

The computed current forward current is safe.

Check if the Optocoupler Can Output a Low Signal

To attain a low signal, the transistor side must saturate. To know if the transistor can really saturate we use below relation.

( Ic / If ) < CTRdevice

Compute of the collector current during saturation

Ic = 5V / 2.4 kohm = 2.08 mA

Ic / If = 2.08 mA / 2.87 mA = 72.47 %

The device CTR is 80%, so the transistor can saturate. In order to ensure a hard saturation, you can add more margins to the collector resistor; say by adding 50% to the computed value.

How about a high logic, will the circuit deliver? The logic high is not a problem because once Vdd is remove the transistor will cutoff, Vout node will see Vcc level

Another scenario where the operation is linear

Provide circuit values so that the Vout node will have 3V level. Use same supply levels and other given with the previous example.

Sample Optocoupler Circuit Design
Figure 9

Select Rf Value

Rf > [ ( Vdd – Vf ) / ( 80% x Irating ) ] = [ ( 5V – 0.7 ) / ( 80% x 4 mA ) ] = 1.34 kohm

We can set Rf to 1.5k standard value.

Solve for If

If = [ ( 5V – 0.7V ) / 1.5 kohm ] = 2.87 mA

Determine Rc

Rc = [ ( Vcc – VCE ) / ( CRT x If ) ]

The specified level of Vout is 3V which makes the VCE equal to 2V, so

Rc = [ ( 5V – 2V ) / ( 80% x 2.87 mA) ] = 1.31 kohm

Use a standard value very close to the computed value.  In this case we will use 1.3kohms.

Checking

Optocoupler Circuit Design
Figure 10

If = [ ( 5V – 0.7V ) / 1.5 kohm ] = 2.87 mA

Ic = CTR x If = 80% x 2.87 mA = 2.296 mA

Vout = Ic x Rc = 2.296 mA x 1.3 kohm = 2.984 V

The resulting Vout is not exactly equal to 3V because we are using 1.3k for the value of Rc instead of the computed 1.31k.

You can repeat the steps above in any Optocoupler circuit design. Once you use the techniques often, the task will become very easy. Another thing that makes it easier is that there is no base current as with BJT.

2 comments

  1. Thank you for your detailed analysis of the optocoupler. It is by far the most informative site I have seen on this neglected part of the power industry.

    Could you please tell me if there is reliable way to get the PC817 to operate in the linear region? I am asking this because I see that the CTR varies a lot for the PC817A/B/C/D optocouplers.

    Would it be better to use something like the IL300?

    My application is to use an optocoupler along with a TL431 in the control loop of forward converter.

    1. I agree that opto CTR is wide. For tighter requirement, select an optocoupler which CTR range is narrow.

      For opto in the loop, it is very recommended to use a very tight CTR. If you want PC817 part, use the “A” version as it has very narrow CTR range.

      Optos are usually linear once operated in the CTR range. However, you need to consider temperature variation. Select an opto with CTR is not well affected with the temperature, see the graph on the datasheet.

      Read this for more info:
      https://electronicsbeliever.com/how-to-determine-optocoupler-operation-saturation-or-linear/

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.