This will work fine. The easiest way to do this is using IR Sensor Module.
This will give you a digital output of weatherwhether there is someone in front of sensor or not. Use can use it as an Edge Trigger to detect Humans passing by.
You can buy one. They are both cheap and easily available.
Or you can create your own.
