Two way sensor counting humans for Raspberri PI

Looking for help in identifying the right type of sensor to go with my Rasperri PI 4.
a) Count humans only
b) Count both ways.
i.e. if a human goes “right” to “left”, have the counter " +1 "
and if a human goes “left” to "right, have the counter " -1 "
Thanks in advance.

Hi Segul
I think “human only” type sensor would nearly have to be a beam that is interrupted or reflected by an object. Mounted as high as needed to detect required “human” size. Motion detectors would probably be triggered by dogs, cats etc.
To sense direction you would need 2 sensors mounted side by side fairly close together. Treat the resulting signals like a rotary encoder.
Another exotic method would be video with some sort of object recognition software. Probably a bit over the top and expensive.
I think has all been done before so shouldn’t be too difficult to get the info you need.
Cheers Bob

1 Like

Majid, Can they be RFID carrying humans or do you need to cover all humans?
Cheers, Vaughan

Hi Bob,
Thanks for the suggestions. In regards to sensing direction, have currently set-up the way you have, i.e. 2 sensors next to each other facing away. This is working

On the human sensor, yes, haven’t got a solid solution as yet. However, will update here should the camera work.

Hi Vaughan,
These are normal humans at work. They will not be swiping any RFID.

Hey Majid,

Another potential option (you’ll need to provide CCTV warnings) would be to use a camera with image recognition running on the Pi, doesn’t need to be too complex, just identify an object as a human when there’s motion greater than a certain size on a certain part of the image.

(Here’s a good project to start looking at options from)

All the best with your project!

Core Electronics | Support

Haven’t got any set up. Figured this is just the way you would have to go to sense direction. If using 2 sensors to detect direction you would probably have to have each transmitter and corresponding receiver on opposite sides of the detection point or there is a very real chance of each transmitter illuminating both receivers. There is a vast amount of information on this out there. Google “thru beam optical sensors” and look at some of the manufacturers sites such as Omron, Panasonic etc for some very comprehensive (and sometimes bewildering) info.
I have only had some experience with reflective types set up to detect mis-winds on coil winding machines.
Cheers Bob

Hey Majid,

There unfortunately aren’t too many ways to do this reliably with a low-cost solution.

Implementing something like Bryce’s option above and having some really thorough programming to make sure your counter is working as designed (e.g. not picking up people multiple times, picking up a number of people if they are in the frame at once, etc.) is possible, but it will be a very long and demanding task and will likely be inhibited by the capabilities of the Pi.

The break beam sensors could work reasonably well too, but you’d need to have two separate corridors or channels for the entry and exit and again, you may get unreliable results from things like multiple people passing through at once.

For the most reliable solution, I’m going to suggest you look into some commercial product consultants/developers. We recommend SAPHI, especially if you are in the Newcastle or surrounding area. You can check out some more details regarding them here!

All the best with the project!