people counter

I am designing a bidirectional visitor counter using Arduino and IR sensor. The limitation of my circuit is that it cannot count simultaneously the number of the person coming and going out. Please help me out.

I think this is a good starting point. Do follow the instructions and your project will have a much better chance to come to a successful end.

Show us your work.

Choke point ?
Don't count legs/feet...

Put at least 60cm between the inside/outside sensors - to minimise the chance of mis-triggering, and remember to count & compare the number of hits at each sensor in case there are two targets within the gate are at one time. (add/subtract... zero = no-one is in the gate area).

You will need to occasionally recalibrate zero to elimiate stray trigger events - perhaps a 3rd sensor to reset the counter - if nothing is in the gate... (weight / longitudinal beam / timeout)

Consider if someone breaks one sensor, then backs out before completing the journey past the second sensor. What if they're carrying a shoulder bag, opr pushig a trolley/stroller?