Optocoupler Relay Driver with PC817 & 2N3904

65,001 views

In this tutorial, we are going to make a circuit of the Optocoupler Relay Driver. Optocouplers are electronic components that are used to transfer electrical signals between two isolated circuits by using light.
They prevent high voltages from affecting the circuit receiving the signal. They contain an LED and a phototransistor and are manufactured in different packages. The simple optocoupler just has one LED and one phototransistor which we are using in this circuit today.

The optocoupler relay driver circuits are used in various electronic projects. In this tutorial, we have made two types of circuits. The first circuit will drive the relay through an optocoupler in the same circuit with the same power supply. Whereas the second circuit is completely isolated from the trigger source. The relay is powered with a separate circuit or power source.

pc817-optocoupler-opto-isolator

Hardware Components

The following components are required to make Optocoupler Relay Driver Circuit

S.noComponentValueQty
1.Optocoupler PC8171
2.Resistor120R1
3.Transistor 2N39041
4.Relay1
5.Diode1N40071
6.Battery1
7.Breadboard1

PC817 Pinout

pc817-optocoupler-pinout

For a detailed description of pinout, dimension features, and specifications download the datasheet of PC817

2N3904 Pinout

2N3904-Pinout

For a detailed description of pinout, dimension features, and specifications download the datasheet of 2N3904

Optocoupler Relay Driver Circuit

Working Explanation

The working of both circuits is simple, they are using only a few components. They can operate at a wide supply voltage ranging from 3.6V to 12V DC.

Optocoupler PC817 used here has an LED and a phototransistor in it. So when this circuit is powered the LED will receive the voltage and light up. This light will turn the phototransistor on and the optocoupler switches on. The output coming from this optocoupler will not activate the relay directly. that’s why we have used a 2N3904 NPN transistor at the output of this optocoupler. This transistor will receive current at its base and will be activated which drives the relay.

The voltage of the relay should be the same as the operating voltage of this circuit.

Applications and Uses

  • Microcontrollers I/O switching
  • VoIP phones
  • Signal isolation
  • PC communications