I want to count how many people every day visits our store. In store has two entrances. Second entrance is not used often. Entrance gate is about 1.5m wide. I plan to attach some device to Raspberry Pi. What is best method to count people flow? I know that i can use laser. Witch is better and precise method? I also want to make counter electronic stuff myself :), not to buy already made device. Thanks.

Edit: looks like question is more like: what type of sensor i need to count visitors?

  • 3
    \$\begingroup\$ This question is a bit broad, but for a start I take it you don't really care if a person is entering or leaving so for example you could use total crossings of the doorway and divide by two at the end of the day? But getting any sort of accuracy is likely difficult because 1.5m is enough for two people to enter pretty much side by side. \$\endgroup\$ – PeterJ Nov 20 '13 at 12:20
  • \$\begingroup\$ Yes, two people can enter side by side. And its clear that if people enters, then also exits. So, results will be divided by 2. Also i know about accuracy. But for starting point it will ok. \$\endgroup\$ – Guntis Nov 20 '13 at 12:26
  • \$\begingroup\$ A solar calculator that doesn't have an automatic Off, makes a cheap counter. Automatic constant feature allows a "1++" then each time the "=" key is pressed, it counts. If you were counting in/out use a quadrature circuit to switch the "+/-" key before the "=" key and it will count down. \$\endgroup\$ – Optionparty Nov 20 '13 at 13:35

Irisys makes the best people counters (probably) - I designed the hardware for the first commercial version and ported the software to it:


They use a 16x16 passive IR sensor array with a germanium lens and each sensor has 256 levels.

| improve this answer | |
  • \$\begingroup\$ I left them several years ago. \$\endgroup\$ – Leon Heller Nov 20 '13 at 15:28
  • \$\begingroup\$ @Paul: Self-publicity is OK as long as it really does answer the question, as it does in this case. \$\endgroup\$ – Olin Lathrop Nov 20 '13 at 15:34
  • 1
    \$\begingroup\$ @Olin, it wasn't intended to be taken as a criticism, in fact I found Leon's link very informative. Bookmarked for future use. (even checked the vacancies board while I was at it) \$\endgroup\$ – paulkayuk Nov 20 '13 at 16:34

This answer probably isn't as complete / simple as you'd hoped for, but the best option that comes to my mind is to use a USB webcam. I've used a Microsoft LifeCam with a Raspberry Pi but there's a full list of supported cameras at RPi USB Webcams.

The RPi can run the OpenCV Open Source Computer Vision Library but I've never used it myself and you'll need to put some effort into developing the algorithm to detect people as they walk in. As far as image processing goes conceptually it might not be too complex and there are quite a few examples and places you can ask questions about it.

I guess the other thing to consider depending on the nature of your store is whether two people entering side by side are really two customers or just one partner dragging along another. In the latter case maybe using a simple infrared beam would suffice.

| improve this answer | |
  • \$\begingroup\$ I try to test ultrasonic sensor and PIR one. \$\endgroup\$ – Guntis Nov 20 '13 at 13:11
  • \$\begingroup\$ @Guntis, PIR based on body heat is normally wide angle and a bit different to what I was thinking of. This is more like what I was thinking of and it'll be a fairly narrow beam with a reflector on the other side of the door ebay.com.au/itm/… \$\endgroup\$ – PeterJ Nov 20 '13 at 13:25

Not the answer you're looking for? Browse other questions tagged or ask your own question.