People Count

Hello,

Obviously from my query; i am new at this. I need to have a PIR sensor, sensing a very general and rough count of people, then that count per a defined time interval (e.g 3 sec) will affect the output voltage. So the more people pass through a space, the higher the voltage (which in turn will activate another circuit).
I can not seem to find a code that combines all those features, specially one that generates the output i need. Is there any link for that or tutorials i've missed on the web?

Thank you for your time.