
Initially, when the circuit is just powered on, the Q0 output of the CD4017 decade counter goes high. The counter increments for each low-to-high going pulse arriving at its CLK pin (14). When the first pulse arrives, Q0 goes Low and Q1 is turned High. This activates the relay and the AC appliance connected to it is turned on. The status LED connected to Q1 also glows to indicate the appliance is switched on. When the user presses a key again, the second pulse arriving at the CLK line increments the counter by 1. This makes Q1 back to Low (which means the relay is deactivated and the appliance is turned off) and Q2 is pulled High. Since Q2 is wired to the Reset input, the second key press actually brings the CD4017 IC back to the power-on-reset conditions with Q0 High. Thus, it basically operates as an ON/OFF toggle switch controlled with any key of an infrared remote.
The power supply for the circuit can be derived from the mains AC itself using a step down transformer and a bridge-rectifier circuit. For +5 V power supply, the LM7805 regulator IC is used.