This is an old revision of the document!


Mall Counter


Introduction


Mall Counter is a project that aims to count the number of people that entered a room using an analog sensor and the approximated time between sending wave and returning wave of some frequency. This provides valuable information that can be used to measure the degree of agglomeration, optimize the staff at peak hours, assess which offers were attractive. In order to do that, a counter for the people entering and a counter for the people leaving can be used to find the number of people in the room at a certain moment. I came with this idea after seeing at Parndorf Outlet that some shops have a guard that limits the number of people in a shop to improve the customers experience. The project uses I2C, ADC and GPIO.

Description


Hardware Schema:

Software Schema:


- Battery/Charger: powers the system with a certain voltage
- HW-131: regulator for the ESP8266, and also a test for the components functionalities
- ESP8266: microcontroller where the code goes
- Voltage Divider: the analog sensor is not necessarily designed for this kit, thus the voltage should be normalized for A0
- Distance sensor: measures the distance by calculating time between sending and receiving wave
- OLED: the display where the number of people will be showed
- SD Card: used for storing information (extension of current features)

Hardware Design


Components list: DBGOLD 6F22 battery, HW-131 power supply platform, ESP8266 Wi-Fi microcontroller, Breadboard, Distance sensor GP2Y0A21YK0F, OLED GME12864-14, SD card, wires, resistors, USB/USB-C cable

Electrical Schema (KiCAD):

Signals (Canva):

Digital: SCK, SDA, CS, DC, RES, USB UART TX/RX, VIN
Analog: sensor_VO, A0

Software Design


Mediu de dezvoltare:

- PlatformIO and Arduino on Visual Studio Code
- Board platform: Espressif 8266
- Program upload: USB

Libraries:

- adafruit/Adafruit GFX Library
- adafruit/Adafruit SSD1306
- Adafruit_GFX.h, Adafruit_SSD1306.h, Arduino.h

Algorithms and Data Structures:

- threshold distance for the counter
- basic interfaces for SPI, GPIO, ADC
- OLED number display

Pseudocode:

count = 0
while True:
    d = ADC_detect_with_low_delay()
    if d <= threshold:
        count++
    
    clear_display()
    SPI_display(count)

Results


A device that counts the people passing at a threshold distance from the sensor

Conclusions


1) Before starting implementation, all components should be verified for correct functioning

Resources

Bibliography

pm/prj2025/eradu/toma.dumitrescu.1746356456.txt.gz · Last modified: 2025/05/04 14:00 by toma.dumitrescu
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0