Tri-state switch using optocouplers.
Fig. 1


Optocouplers for TTL-CMOS Logic Level Shifting

by Lewis Loflin


Here I'll illustrate using optocouplers to perform voltage logic shifting between TTL and CMOS devices. Optocouplers also isolate output transistor voltages from low-voltage digital logic.

See the following related pages:

PC817 Optocoupler.
Fig. 2 PC817 Optocoupler.


An optocoupler is usually an infra-red LED emitter on the input and a photo detector on the output. Here I'm concerned with the most common type with a photo transistor.

Fig. 2 is the PC817 optocoupler. Transistor rating is 80-volts at 30mA. The collect-emitter voltage and current ratings are the main limitation of the device.

4N25, 4N26, 4N27, 4N28 outline.
Fig. 3


Fig. 3 is pin connection for 4N25, 4N26, 4N27, 4N28 optocouplers. The output transistor rating is 70-volts at 50mA.

Functionally it is no different from PC817 other than lower collector current.

When calculating current limit the current to 75% of maximum.

4N25 optocoupler to form non-inverting TTL to CMOS logic level shifter.
Fig. 4


Fig. 4 uses a 4N25 optocoupler to form non-inverting TTL to CMOS logic level shifter.

One should understand the concepts of source and sink.

The switching device will either sink the current, or create a path to ground. The other end of the load if connected to the often positive supply voltage or +Vcc.

In the source configuration the switching device will connect the load to +Vcc.

In Fig. 4 the input is a TTL 5-volt source connection. The output is also a source switching setup.

A HIGH or 5-volts on the input produces a HIGH 15-volts on the output. This is non-inverting - HIGH in is HIGH out. We merely shifted the voltage level.

4N25 optocoupler to form non-inverting CMOS to TTL logic level shifter.
Fig. 5


Fig. 5 uses a 4N25 optocoupler to form non-inverting CMOS to TTL logic level shifter.

Here we have a source input from a 15-volt CMOS circuit to source 5-volt TTL circuit. Again this is non-inverting - HIGH in is HIGH out.

Input is source, output is source.

4N25 optocoupler to form non-inverting CMOS to TTL logic level shifter.
Fig. 6


Fig. 6 uses a 4N25 optocoupler to form non-inverting CMOS to TTL logic level shifter.

We have a sink CMOS input that when LOW turns on the LED. The output is 5-volt TTL goes LOW when the transistor is turned in. This is non-inverting - LOW input is a LOW output.

Input is sink, output is sink.

4N25 optocoupler to form inverting TTL to CMOS logic level shifter.
Fig. 7


Fig. 7 uses a 4N25 optocoupler to form inverting TTL to CMOS logic level shifter.

Fig 7 is identical to Fig. 6 other than output circuit we changed the resistor and photo transistor. The logic level is inverted - LOW input produces a HIGH output.

The input is sink, output is source.

4N25 optocoupler to form inverting TTL to CMOS logic level shifter.
Fig. 8


Fig. 8 uses a 4N25 optocoupler to form inverting TTL to CMOS logic level shifter.

Input is source and output is sink.


© Copyright 2019 Lewis Loflin E-Mail