The optocoupler operation as switch is similar on how to configure BJT as switch. For a BJT to operate as switch it must be set to function in saturation and cut-off. Optocoupler as well. However in BJT circuit the base current must be high enough to drive the transistor into saturation; but in Optocoupler it is the forward current. In BJT the base and collector currents are link to each other by the current gain of the transistor or simply beta. In Optocoupler circuit, the forward and the collector current are link to each other with the current transfer ratio or simply CTR.
To set optocoupler operation as switch; it must be driven into saturation. To saturate, the forward current must be big enough compared to the collector current. But is this possible? The collector current is always a function of the forward current and the device CTR.
Going back to BJT circuit; at saturation the transistor is no longer gaining thus the dependency of the collector current to the base current is no longer valid. It is the same scenario in Optocoupler. At saturation the circuit collector current is no longer link to the forward current through the device CTR. So in determining the collector current at saturation the above equation is no longer valid. Take note on this.
Optocoupler operation as switch is can be checked or set correctly by comparing the circuit CTR and the device CTR (CTR method). Circuit CTR is the ratio of the circuit collector to forward current.
The device CTR is the current transfer ratio of the device specified in the datasheet. At linear operation the circuit CTR is always following the device CTR. However, at saturation, the CTR demand of the circuit is very low compared to the CTR that can be provided by the device; thus the circuit will saturate. Just like you are asking a glass of water but someone gives you a jar of it; you cannot intake all of it.
Therefore at saturation the circuit CTR must be less than the device CTR.
Another way of checking an Optocoupler operation as switch is by computing the collector-emitter voltage (VCE method). At saturation its level is always zero or equal to the device VCEsat.
Therefore collector-emitter voltage below this level is making the optocoupler operates in saturation. In this technique you can still use the device CTR. Do not be shocked if you can get a negative VCE level despite the circuit supply has no negative value. It’s only implying that the device is operating at saturation. Then compute for actual collector current without using the device CTR value.
Verify the circuit below if it can operate as a switch. Vdd and Vcc are both 5V. Consider 80% device CTR and the forward voltage of the diode is 1V.
For Optocoupler operation as switch the collector-emitter voltage must be zero or just equal to the maximum saturation voltage specified in the datasheet. So in above circuit the node Vout must be zero since no specified VCEsat value.
Proving Optocoupler Operation as Switch using CTR Method
Solving for the forward current
KVL at loop 1
Solving for the collector current
The maximum collector current is
Solve for the circuit CTR
Comparing circuit CTR to device CTR
CTRcircuit is less than CTR device. No doubt the Optocoupler will saturate.
Proving Optocoupler Operation as Switch using VCE Method
No need to solve for the forward current, it’s the same with above result.
Solving for the collector current
Solving for collector-emitter voltage
From loop 2
The computed VCE is -14.2V. How come it becomes negative that the supply has no negative? Do not be confused, the negative sign means that the Optocoupler is at saturation. This is also indicating that the device CTR is no longer valid in solving for the collector current. The true collector current is only dependent to the collector resistor.