shamkhi

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.

Thank you for your time.

Lvothe

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.

Thank you for your time.

You should ask that at code forum.

shamkhi

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?

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.

That's not the way a PIR sensor works. It says "Yes, there is human body heat moving in my field of view" or "Nope, nobody's home". It does not say "97 people are here" or "22 people passed by in the last 12 seconds".

You need a different sensor to count people, if 0 and not 0 are not enough.

PIR sensors only tell you that there is something with a different temperature than the ambient in front of them. You cannot tell how many "somethings" there and IIRC they have binary outputs, 100 people or 1 person will give the same result.

If you are talking about reading the number of people in a room in very general terms, like "there are a lot" or "there aren't many" maybe you could use a thermal camera and count the hot bits.

PeterH

A PIR sensor can be used to detect movement, but unless you arrange things very carefully so that people are forced to move through 'turnstile' areas I don't see how it could be used to give any indication of how many people are moving into/through/out of an area. I would have thought that image recognition based on a webcam would be a more promising approach to try if you need to count people.

perhaps have another component that counts how many 0 or 1 the PIR detects per a time frame.

I don't think that will help, you could have people in and out all day and numbers varying from 1 to 1000 and all you would know is that there was at least 1 person in the room for the entire day and that that person didn't stand still or fall asleep.

Simplest thing I can think of would be to use two trip beams to see people passing in front, and depending which one is first, see which way they are going like a rotary encoder. But this would require that only one person fit through the entry way at a time.

A PIR sensor is not going to count people well, even if you have more than one and set it up well. They trip whenever there is any change so you never know if it will trip just when someone walks by, or if it will trip again as they leave the range or if it will untrip/retrip while they are still in the range.

The conditions by which people will be able to enter/leave will be very crucial to this project if you want to accomplish it without video recognition.

I don't think PIR will allow you to do this, my suggestion is to use openTSPS, it's an open source software that does video recognition, so you just use a webcam and it will do all the processing including counting number of person in front of the webcam. OpenTSPS uses OSC to communicate with other software, so you can use Processing to get this OSC value and transmit it to Arduino via serial or use the Firmata firmware so you can just do all the programming inside Processing. Seems to me that this is the easiest method. You'll need a computer for the installation though.