A people counter is a device that, well, counts people. People counters are very useful for shops and restaurants that want to keep track of how many people have come and gone throughout the day. That data is valuable and can help proprietors staff their establishments efficiently. For example, if the data shows that only a few people come into a restaurant in the early afternoon, then the management can schedule fewer employees to work during those hours. There are commercial devices on the market, but a more affordable option is to follow this guide to build your own DIY laser people counter.
For a people counter to work as intended, it needs to determine how many people enter through a doorway and how many exit. By keeping a simple tally, it can calculate the current number of patrons with a reasonable level of accuracy. There are several ways to accomplish this task and computer vision is one method that is becoming popular. But computer vision systems tend to be expensive. This laser-based technique is quite cheap, but still dependable. It uses a ToF (Time of Flight) laser sensor with two zones to detect people. If the outer zone triggers before the inner zone, the device knows that someone is entering the building. If the opposite is true, then it knows that someone is exiting.
You will only need a handful of inexpensive components to build this people counter. An ESP8266-based Wemos D1 Mini board controls the device. That has a built-in WiFi adapter, so it can send data over a local network. The all-important sensor is a VL53L1X ToF module. Power comes from a generic USB battery bank. A 3D-printable enclosure houses those components. You should mount the device above a doorway using double-sided tape or the kind of specialty mounting tape intended for lightweight picture frames. The code you need to flash to the ESP8266 is provided with the guide.
There are a few configuration options in the code that you will need to set, such as your WiFi credentials and the maximum number of people that can occupy the room. Once the device starts up, you can enter its IP address into any web browser on the local network. That will pull up a website with a simple interface that shows you the people count. This device isn't perfect and there are certain scenarios that will result in an inaccurate count, such as someone walking through the doorway very quickly. But it should be more than good enough for most small businesses with owners who want a general idea of how many customers are present at any given time.