The project of “bidirectional visitor counter "is based on the interfacing of some components such as sensors, motors etc. with Arduino micro controller. This counter can count people in both directions. This circuit can be used to count the number of persons entering a hall/mall/home/office in the entrance gate and it can count the number of persons leaving the hall by decrementing the count at same gate or exit gate and it depends upon sensor placement in mall/hall. It can also be used at gates of parking areas and other public places. This project is divided in four parts: sensors, controller, counter display and gate. The sensor would observe an interruption and provide an input to the controller which would run the counter increment or decrement depending on entering or exiting of the person. And counting is displayed on a 16x2 LCD through the controller When any one enters in the room,IR sensors will get interrupted by the object then other sensor will not work because we have added delay for a while
Circuit working :-
There are two ir sensors used in this circuit
Figure 1:- Black one is photo diode and the blue one is ir diode
IR diode emits ultraviolet ray which human eyes cant see and photo diode is used to detect ir light after detection resistance of the photo diode decreased so which we feed to the non-inverting terminal of the opamp 741 as show in fig 2 (opamp here is used as an comparator ) nd we provide reference voltage through the potentiometer or variable resistor
Figure 2:-ir sensor using 741
.To understand the basic working of this circuit lets take look at the example (this is what i faced while building this ) so when opamp is in comparator mode it compares both input values and give output according to the higher input present at opamp terminals. so if positive input is high compare to the negative the output will postive and if negative high output voltage is negative

Figure 3:-applying Higher voltage to non-inverting terminal
As you can see in figure 3 i have applied an higher voltage to the non-inverting and getting positive output
Figure 3:-applying Higher voltage to inverting terminal
As you can see its giving the -ve voltage which will do nothing but here is an problem and that problem is we are not going to use 2 batteries and also we dont need any negative voltages so here we will remove the battery and instead of providing negative voltage to pin 4 we connect this too the ground and now there will be no negative voltage also because we have removed the negative supply (but things never work as we expect specially in electronics first attempt ),hence we get some output about of 1.5v but its totally safe to not to count as the high input for arduino which is 2v.
Circuit Diagram:-
In this link i have posted the circuit diagram and pcb which i designed by myself using circuit maker so anyone interested can email me.