Tri-state switch uses opto-isolator for high voltage isolation.
Fig. 1 Tri-state switch uses opto-isolator for high voltage isolation.

Tri-State Switch Circuit uses Optocouplers


By adding optocouplers to a tri-state switch we isolate 5-volt logic from high voltage output transistors.

For information on the digital gates see Review Connecting Digital Logic and Transistors.

The circuit example in Fig. 1 does two things. Q2 bipolar transistor was replaced with a N-channel power MOSFET.

To get above the 5-volt limit created by the 5-volt digital logic, I've used an optocoupler. This consists an LED infrared emitter and in this case a NPN photo transistor.

When the optocoupler transistor is switched on current flows though Rb1 turning on Q1.

+Vcc is the motor voltage limited by the collector-emitter voltage of the optocoupler. Rb1 is calculated to limit base current of Q1 and optocoupler circuit.

PC817 optocoupler pin connections.
Fig. 2

Fig. 2 is the PC817 optocoupler. I bought 50 for $5 from Ebay. It has a transistor voltage limit of 80-volts and a collector current of 30mA.

The formula to calculate Rb1 is +Vcc - 2V / 25mA. I chose 25mA to stay under the 30mA limit of the optocoupler transistor. Q1 is a TIP120 NPN Darlington with a gain of 1000.

See Tutorial Using TIP120 and TIP125 Power Darlington Transistors.

For the power MOSFET Q2 see:

N-Channel Power MOSFET Switching Tutorial.



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

Fig. 3 shows the outline of the 4N25, 4N26, 4N27, 4N28 type optocouplers. The transistor has a collector-emitter breakdown voltage of 70V and a maximum current of 50mA.

For more information on optocoupler circuits see:

Truth table for tri-state non-inverting switch.
Fig. 4

Fig. 4 is the truth table for Fig. 1.

View all of my You Tube Videos
Also visit and subscribe to My YouTube Channel