You want to use a pair of counters like the ones shown here for a basic example. They show "cascading" the counters. The binary outputs would drive a BCD to 7 segment display driver. The input clock signal would be pulses derived from your IR beam interrupts. Maybe someone here has a ready made circuit.
There have been threads in the past for a similar project which counted the number of people entering a room by detecting IR beam interruption. Here are some links:
OK, what you need to do is not use Open and Close but rather High and Low. If you look at the people counter thread(s) you will see how the signal from the IR receiver makes pulses. The IR receiver can be a IR photo transistor. The output is pulses which go from low to high.
A counter would count these pulses that could go from 0 volts to 5 volts when the beam is broken and return to 0 volts when the object breaking the beam has passed. Each time the beam is broken and made again a pulse is generated and the pulses move along to a counter and are counted. Each pulse can increment (increase) or decrement (decrease) the count.
Also this link will bring up many count6er threads within these forums.
Will I'm trying to make a project for the professor here I'm in the first year Electrical and communication Enginnering So I didn't have many Experience
the schematic is in attachement
I'll replace the the short between IC"555" and IC "4510" with an infrared
So are this circuit good ??
The idea is that you replace the clock input of the 4510 (555 output - pin 3) with a circuit consisting of an IR emitter and detector. Something like this:
You would place the detector on one side of the doorway and the emitter on the opposite side. You would have to make sure that the emitter was aligned just right so that the light from it shines on the detector. The output of the detector could be connected to a comparator circuit with some hysteresis. Google Schmitt trigger. When someone walks through the doorway, the IR beam would be broken, the detector would no longer be able to see it and its output would transition from high to low, or low to high depending on how you wire it. The output of the comparator would then feed into the clock input of the 4510 (what is now connected to the 555 output). Whether the comparator output transitions from low to high or high to low when a person walks through the doorway would determine whether the counter increments when the beam is broken or when it is restored.