π¨βπ©βπ§βπ¦ Estimate the number of people using WiFi emanations
π‘ Inspired by Makerfabs/Project_WiFi-Statistics and ESP-EOS/ESP32-WiFi-Sniffer
π‘ Counts unique MAC addresses
π Great for tracking busyness over time
β¨ Complete project, not a library
π¨βπ» Make as a class project for Embedded Systems at UW-Whitewater
This is a physical project, as well as a software project! You'll need...
- An ESP32 chip. Preferrably a development board. If you want something that you can reuse for other projects, the Adafruit HUZZAH32 is a good choice. If you just want a cheap $10 board for this project only, you can snag one of the many ESP32 boards on Amazon.
- A way to power your ESP32. This is most likely a USB charging brick. If you are truly dedicated to wireless deployment, you can use your own battery solution. But for the intended deployment case of an indoor stationary spot, a wired-to-wall solution is probably the most sensible. Your charging brick doesn't need to be fancy. As long as it can supply ~500mA of current, that's sufficient. You can find cheap $4/pc chargers on Amazon.
- An LCD screen. This will be used to display the count of how many people are estimated to be in the area (by MAC addresses). This project's code expects a 16x2 display, but you can probably fiddle with the code to get it to work with other sizes. You can find 16x2 LCD screens on Amazon.
In my own experimentation and development, I used the DOIT ESP32 DEVKIT V1.
To configure the hardware, you should match this circuit:
You'll also need to install the "FreeRTOS" library from the Arduino Library Manager. We need this library to use the vTaskDelay()
function.
π Getting started: Installing ESP32 in Arduino IDE (Windows, Mac OS X, Linux) | Random Nerd Tutorials
Once you've downloaded the application code to your ESP32, you just need to deploy it someplace! The easiest spot is, of course, right where you're sitting. Plug in the ESP32 to the power brick, make sure you've got the OLED output screen hooked up, and see how many WiFi MAC addresses are in your area!
I am not qualified to remark on whether or not this MAC address sniffing is legal or not in your area. This is not legal advice. With that said, here are some discussions and other resources about the legal side of tracking people with WiFi signals:
- What is legality of monitoring traffic for mac addresses Β· Issue #4 Β· schollz/howmanypeoplearearound
- Wi-Fi location analytics | ICO
- 18 U.S. Code Β§ 2511 - Interception and disclosure of wire, oral, or electronic communications prohibited | U.S. Code | US Law | LII / Legal Information Institute
There's some other interesting projects dealing with WiFi person detection that are pretty cool! π²
- schollz/howmanypeoplearearound: Count the number of people around you by monitoring wifi signals
- cyberman54/ESP32-Paxcounter: Wifi & BLE driven passenger flow metering with cheap ESP32 boards
- ESP-EOS/ESP32-WiFi-Sniffer: Simple WiFi sniffer for boards based on the Espressif Systems ESP32 module
- Makerfabs/Project_WiFi-Statistics
This project was developed using the Arduino IDE and an ESP32. You can get the project running locally using git clone
and then opening the main mac-addr-counter.ino
in the Arduino IDE. You'll need an actual ESP32 to run the code!