Need help with concept of Occupancy counter

Need to implement an Occupancy counter.

I thought of using tow 1738 IR sensor so that I can detect entry and exit of people to a room. And can increment or decrement a register in arduino. Working: ---IR Led1 : ---------->1st 1738

---IR Led2 : ----------->2nd 1738

So if the 1st led is blocked and then the 2nd, then we can label the motion as say "Entry" and viceversa "Exit"

But the problem I seem to have is 1738 needs to have bursts of 38 Khz signal. Is that correct? For my application wouldn't a continuous 38 khz wave be required?

Please help.

How robust do you need this to be? Doing this accurately with real people is difficult, because they come through doorways in groups, change their mind half way through, and stand in the doorway nattering. Unless you have a turnstile type system, I don't think it'll be feasible to get a really reliable figure. But if you only need to show something working with cooperative test subjects, that wouldn't be an issue.

yes, i only need it working with cooperative subjects. So do you know about the continuous/burst issue of the sensor in question?

Yes the TSOP1738 sensor is designed for IR data and so will not work as a beam breaking detector. What you need is the TSOP4038 sensor.

How about the VS1838b sensor, just asking because I have it with me.

Wouldn't using a motion sensor and creating Occupancy sensor instead of a counter be a better approach?

I just need to switch on/off lights in case occupancy/vacancy.

Wouldn't using a motion sensor and creating Occupancy sensor instead of a counter be a better approach

Yes if all you want to know if the room is empty.

That's indeed the purpose. Thanks for all your help.