Maker Pro
Maker Pro

PC817 circuit not working with relay

steve_venkat

May 22, 2017
30
Joined
May 22, 2017
Messages
30
I'm trying to use PC817 in relay circuit.This is my circuit which I tired the PC817...
This circuit connected with an PIC16F877A controller for switching operation.I checked the controller output with LED which going to switch the relay.The LED is working fine,but the relay not switching ON,their is no response in relay....If the relay is directly ON by direct supply of +12VDC means working...
Is this circuit is correct or have to change in something..?
 

Attachments

  • iMAGE_1.png
    iMAGE_1.png
    9.6 KB · Views: 12

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,700
Joined
Nov 17, 2011
Messages
13,700
The G2R DC 12V relay requires ~40 mA coil current.
The LED of the photocoupler is driven by ~3.5 mA (assuming a 5 V drive signal on R6). The PC817 has a min. current transfer ratio (CTR) of 50%. Even if we assume twice that value, the output of the photocoupler will deliver 3.5 mA, not the 40 mA required for the relay.
You'll have to add a driver stage to boost the current for the relay. Note that the circuit(s) shown here are inverting, sou you'll have to connect the photocoupler from 12 V (instead to ground as in your current circuit) to the base of the driver transistor to ensure correct operation.
 

steve_venkat

May 22, 2017
30
Joined
May 22, 2017
Messages
30
Is this circuit is OK with values for resistor...
I'm going to make an flash light by using this circuit.The light will take nearly 2A,12VDC power.
If I switched the optocoupler frequently means,any damage will occur to optocoupler..?

while (1) {
flash_light= 1;
DelayMs(50);
flash_light = 0;
DelayMs(50);
}

this the code for flashing light.
 

Attachments

  • Image_2.png
    Image_2.png
    11.5 KB · Views: 14

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,700
Joined
Nov 17, 2011
Messages
13,700
Won't work. The emitter of OK2 needs to be connected to R9, collector of OK2 to 5V.
In addition is is favorable to add another resistor (e.g. 10 kΩ) from the base of T1 to GND.

If I switched the optocoupler frequently means,any damage will occur to optocoupler..?
No, but the relay will not last long. Electromechanical relays in general are not meant to be switched rapidly. The datasheet for the GR2 relay states an electrical lifetime of min. 100000 operations. If you switch it 10 times per second (period 100 ms as in your code), this number has been reached after less than 3 hours. Even if the relay is 10 times as good as the minimum value, it will last 30 hours only.

For this application a solid state relay or a different circuit altogether is better suited.
 

steve_venkat

May 22, 2017
30
Joined
May 22, 2017
Messages
30
Won't work. The emitter of OK2 needs to be connected to R9, collector of OK2 to 5V.
In addition is is favorable to add another resistor (e.g. 10 kΩ) from the base of T1 to GND.


No, but the relay will not last long. Electromechanical relays in general are not meant to be switched rapidly. The datasheet for the GR2 relay states an electrical lifetime of min. 100000 operations. If you switch it 10 times per second (period 100 ms as in your code), this number has been reached after less than 3 hours. Even if the relay is 10 times as good as the minimum value, it will last 30 hours only.

For this application a solid state relay or a different circuit altogether is better suited.
This is circuit is ok..? Harald Kapp
 

Attachments

  • Image_3.png
    Image_3.png
    13.5 KB · Views: 16

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,700
Joined
Nov 17, 2011
Messages
13,700
Basically yes.
R6 should be 10 kΩ or more, not 1 kΩ.
And the relay will still not last very long.
 

steve_venkat

May 22, 2017
30
Joined
May 22, 2017
Messages
30
Ok
Basically yes.
R6 should be 10 kΩ or more, not 1 kΩ.
And the relay will still not last very long.
I will do something for relay..
Actually the power supply is common for both side of optocoupler....At this condition is it worthy of using optocoupler or shall we use transistor instead of optocoupler..?
 
Top