Passing People Counter

Passing People Counter cover

One of my clients (I'll call it Joe) needed to monitor how many people/vehicles entered and exited his shop

He works in the retail industry and wants to better understand his advertising ROI and in-store conversion rate.

This case study outlines how I helped him achieve his goal with a lightweight, cost-effective solution.

Key issues

Commercial solutions already exist at an affordable price for single installations. But Joe wants to install tens of devices without spending a fortune.

Key findings

If you don't need extreme detection precision, you can setup a people counting system leveraging 10$ hardware and machine learning.

Problem statement

This project is about deploying a cheap camera device that monitors h24 his field of view and counts how many people cross it from top-bottom and bottom-up (or left-right, depending on the rotation).

The camera is not bounded to only detect people. You can recognize any sort of objects (e.g. vehicles in a warehouse) after proper training.

Also, due to the low resolution of the camera, you don't incur risks of privacy infringement, since faces would not be recognizable. 

How To

As simple as it is, the system continuously takes frames and applies computer vision and machine learning to detect moving objects. 

Once it starts detecting one, it follows it across the few next frames to infer the direction of motion. This way you can know if it is entering or exiting the field of view. 

There are two steps involved:

  1. a fast motion detection algorithm checks if something is moving in the frame
  2. an object detection algorithm checks if that something is an object of interest

This means that the camera can detect if e.g. a person entered the shop vs a pet, to keep the detection count as clean as possible from noise.

Which hardware is required?

The detection runs on an ESP32S3 camera.

How much does it cost?

Apart from my development cost, you can purchase an ESP32S3 camera for around 10$.

Commercial solutions are available from 200$+.

Now, if you only need a single device, go buy a commercial product - it will cost you less than my work.

But if you need many devices, you can consider amortize my fixed cost by drastically reducing hardware costs.


If you're looking for a solution similar to the one described here, feel free to book a call with me using the following button. You'll tell me more about your specific needs and we'll see if I'm a good fit for you.

Book a call

Subscribe to my newsletter

Join 1023 businesses and hobbysts skyrocketing their Arduino + ESP32 skills twice a month