A photo relay or light activated relay is a circuit which opens and closes the relay contacts according to the light.
Here a photo diode (LED) is used to sense the light. A potentiometer is used to simulate the photo diode operation.
The photo diode (LED) offers a high resistance when there is no light falling on it.
In this example, the photo diode (LED) is connected in reverse biased condition. The only current flowing through it will be due to the minority carriers.
When light falls on it, the current due to the minority carriers increase and the diode offers a low resistance.As a result the voltage across the diode will not be sufficient to make the transistor Q1 forward biased and the relay will OFF.
When there is darkness the photo diode resistance increases and the voltage across it will become enough to forward bias the transistor Q1 making the relay ON.
The diode D2 is used as a freewheeling diode to protect the transistor from transients produced to the switching of relay.
By this way the load connected through the relay contacts can be switched ON and OFF according to the light falling on the photo diode.