From This simple projects If you want circuits with special features,can be set the program to the circuit works, when the input pluse signal is entered of 1-256 time, Consider the circuits Infra Red Receiver for larger version as described below.

This set can be divided into four main parts of the work are : the signal receiver and filter circuit, the set wave form, the frequency divider and the driver relay circuit.
The receiver signal and filter circuit
The component is receivered a signal is a photodiode D1, the signal that across D1 will be sended to the filter circuit that will allows the 5KHz frequency only can through it. Which consist of the feedback circuit R4,R5 and C2 that join with IC1.
The determening circuit will cause a low frequency, this circuit has gain equal to 1. But that frequency of 5 Khz will has the high gain as thousand times.
The 5Khz signal will be inserted to the duoble DC to DC converter include of D2,D3,R6,C4.

Figure 2 The special infrared receiver circuit.

The set wabe form.
Since the wave form that may be inappropriate. We must set a new wave, which has a range of up and down change quickly.
The set circuits consists of a wave which is compared IC1B. Input voltage with defined voltage at Pin 2. will set a high output. But if the voltage lower than pin 2 then the voltage output is “0”
This setting cause the noise signal that may be unusual to be eliminated.
The LED-D4 is display we know that The signal from the sender is entered the receiver to complete.
The IC2-CD4093 act set wave form, by two the schmit trigger set and the set 3 act as a inverter circuit for entered signal to the frequency divider-IC3-CD40103

The frequency divider circuit.
The frequency divider circuit works by using the divide frequency IC as a program types From the 2-256 number with setting voltage at the control input pin. Which has 8 pin is the pin 4,5,6,7,10,11,12,13.
The program is a binary base 2 by 1 = positive, 0 = ground.
LED-D5 is shown that the output pulse from the frequency divider circuits.
The output as above will is entered to the transistor TR1 to driver the relay to works as desired.

How to build
Equipment as circuits whole can be assembled onto the PCB. When you are sure all the wires and components are installed correctly.
Experimental enter the DC power 9 volt to the receiver. If has scope hold at pin 3 of IC will see is ?the frequency bands 5Khz. But if there is no scope to capture the notice of the diodes will feel warm.
To connect the voltage to set the receiver bring send the signal to the photo diode LED D4 will be, if not, adjust VR1 until brightness. Which is usually located in the center.
This receiver can be used in a range of about 3.5 m. If you want this far, you may use a combined optical blades.
In addition, the photodiode should be put in a sealed box. By allowing only the aperture only. Refunds to combat signs of natural light.
Setting counts number
As above that Setting counts possible input voltage at input pin counts to a decimal number by 2.