Built to order

IoT-Based Smart Shop Footfall Counter

This project builds an IoT-based smart shop footfall counter using an ESP32 and two IR break-beam sensors across a shop doorway that counts entries and exits and shows live footfall on a cloud dashboard. The entrance-side sensor fires first on entry and second on exit, so the direction of every crossing is known, and the dashboard turns counts into hourly charts and a peak-hour summary. Owners can see busy hours and plan staffing from real counts instead of guesswork. Suitable for B.E./B.Tech final-year projects in Electronics, IoT and Computer Engineering.

Chat on WhatsApp — get a quotation

IoT & Embedded ESP32Arduino IDEMQTT over Wi-FiHTML · CSS · JavaScript dashboard16x2 LCD displayC++ Arduino frameworkMQTT brokerHybrid
IoT-Based Smart Shop Footfall Counter — project thumbnail preview
More project photos (2)

The problem

An IoT-based smart shop footfall counter is a doorway counting system that records how many people enter and leave a shop and displays the result on a dashboard. It uses an ESP32 with two IR break-beam sensors mounted across the doorway, one inside the other, so the order in which the two beams break tells the system whether a person walked in or out. Small shops usually have no idea how many visitors they get: till receipts count buyers, not browsers, and owners cannot tell how many people were inside at any moment. This project builds a doorway rig with a 45 cm wide frame, two 5 mm IR break-beam sensor pairs spaced 10 cm apart, a 16x2 LCD showing the counts, and a cloud dashboard with hourly charts and a peak-hour table. Every crossing is debounced and pushed to the dashboard over Wi-Fi, and a crossing is discarded if the second beam never breaks within 2 seconds.

SYSTEM FLOW

5 components 4 connections

Live flow
Drag to explore
100%
userShopper

Shopper walks through the shop entrance.

Follow the working sequence

How it works

The IoT-based smart shop footfall counter works as a short chain from doorway to dashboard: two IR beams watch the entrance, the ESP32 reads the order in which they break, and the counts travel over Wi-Fi to a cloud dashboard that draws hourly charts. A person walking in breaks the outer beam first and the inner beam second; walking out reverses the order, so direction comes from timing alone with no camera and no personal data. The ESP32 debounces each beam for 50 ms, waits up to 2 seconds for the second beam, and updates three totals — entries, exits and people inside — only when a full crossing completes. The totals appear on the 16x2 LCD at the door and are published over MQTT every 5 seconds, so the dashboard stays live without a page refresh. The dashboard stores the counts by hour, draws the hourly bar chart, and picks the peak hour from the day's totals.

  1. Two 5 mm IR break-beam sensor pairs mount across the demo doorway frame, 10 cm apart along the walking direction: the outer pair nearer the street, the inner pair nearer the shop floor.
  2. A person crossing the doorway breaks the first beam; the ESP32 notes the time and waits up to 2 seconds for the second beam (design target).
  3. If the outer beam breaks first and the inner beam second, the ESP32 adds one entry; if the order reverses, it adds one exit; a single-beam break with no second beam inside 2 seconds is discarded.
  4. Each beam signal is debounced for 50 ms (design target), so a flickering beam or a swinging bag edge does not create extra counts.
  5. The ESP32 updates the three running totals (entries, exits, people inside) and shows them on the 16x2 LCD at the door.
  6. Every 5 seconds (design target) the ESP32 publishes the totals over Wi-Fi via MQTT; the dashboard stores them by hour and redraws the hourly chart and the peak-hour table.

Tech stack:

  • ESP32 (dual-core microcontroller · Wi-Fi)
  • IR break-beam sensor · 5 mm · 50 cm range
  • 16x2 LCD display
  • Arduino IDE (ESP32 firmware)
  • MQTT over Wi-Fi (5-second publish)
  • HTML · CSS · JavaScript dashboard
  • MQTT broker (cloud-hosted)
  • Arduino framework · C++
Parameter Value
Doorway frame width 45 cm (demo build)
Sensor pairs 2 pairs · 5 mm IR break-beam (demo build)
Sensor spacing 10 cm between pairs along walking direction (design target)
Beam range Up to 50 cm at 5 V (datasheet)
Controller ESP32 dual-core · 240 MHz (datasheet)
Beam response time Under 2 ms (datasheet)
Debounce 50 ms per beam (design target)
Crossing timeout 2 seconds (design target)
Dashboard update Every 5 seconds via MQTT (design target)
Display 16x2 character LCD · live entries · exits · people inside
Demo-sample day totals 342 entries · 318 exits · 24 inside (demo-sample measurement)
Peak hour (demo-sample) 18:00–19:00 · 52 entries (demo-sample measurement)
Power supply 5 V DC · 2 A for logic (design target)

Project features

The IoT-based smart shop footfall counter combines four capabilities that a manual headcount cannot offer: direction-aware counting from two IR beams, a live inside-count, hourly footfall charts, and a peak-hour summary on a cloud dashboard. Two 5 mm IR break-beam sensor pairs sit 10 cm apart across the doorway: the order in which the beams break decides entry or exit, a 50 ms debounce filter (design target) ignores flicker, and a 2-second crossing timeout discards incomplete crossings when someone turns back in the doorway. The ESP32 keeps three running totals — entries, exits and people inside — shows them on a 16x2 LCD at the door, and publishes them over Wi-Fi via MQTT every 5 seconds (design target). The dashboard draws an hourly bar chart, lists entries and exits per hour, and names the peak hour with its count, so the owner can compare today with yesterday and plan staff for the busiest hours.

  • [Direction-aware entry/exit counting] Two IR break-beam sensor pairs mounted 10 cm apart across the doorway record the order in which the beams break, so an outer-then-inner sequence counts one entry and the reverse sequence counts one exit.
  • [Live inside-count] The ESP32 keeps entries minus exits as a running total of people currently inside, shown on the 16x2 LCD at the door and on the dashboard.
  • [Debounce and crossing timeout] Each beam signal is debounced for 50 ms (design target) and a crossing is discarded if the second beam does not break within 2 seconds (design target), so flicker and turn-backs do not create false counts.
  • [Hourly footfall chart] The dashboard draws a bar chart of entries for each trading hour, with the peak hour highlighted, so busy and quiet hours are visible at a glance.
  • [Peak-hour summary] The dashboard names the busiest hour of the day with its entry count; in the demo-sample day the peak hour is 18:00–19:00 with 52 entries.
  • [MQTT cloud updates] The ESP32 publishes the three totals over Wi-Fi via MQTT every 5 seconds (design target), so the dashboard stays live without a page refresh.
  • [16x2 LCD at the door] The LCD shows live entries, exits and people inside at the doorway itself, so the count is visible without opening the dashboard.

What is included

  • Working doorway footfall-counter prototype (ESP32, 2 × IR break-beam sensor pairs, 16x2 LCD, demo doorway frame)
  • Complete firmware source code with direction logic, debounce and crossing timeout
  • Cloud dashboard web app (live counters, hourly chart, peak-hour table)
  • Circuit and wiring diagrams with terminal-by-terminal connections
  • Component list with part numbers and datasheet references
  • Setup and calibration instructions, including the beam-alignment check
  • Project report PDF (background, methodology, direction logic, demo-sample results)
  • PPT presentation for final review
  • Viva Q&A preparation document (IR sensing, ESP32, MQTT, dashboard)

Limitations & prerequisites

  • Demo-scale doorway: the 45 cm frame is matched to the 5 mm sensors' 50 cm rated range, so a real shop doorway of roughly 90 cm needs longer-range beam sensors before the same logic can be used.
  • One person at a time: two people walking in side by side break both beams together and count as a single crossing, and tailgating merges counts the same way.
  • Strong direct sunlight on the receiver can swamp the IR beam, so the demo is built for indoor doorways away from direct sun.
  • No accuracy percentage is claimed: counts are exact only under the single-file crossing condition, and the page states that condition instead of a measured accuracy figure.
  • Wi-Fi is needed for the cloud dashboard; counting and the LCD display continue offline, but remote updates pause until the connection returns.
  • This is an academic prototype, not a certified people-counting system, and it must not be used for billing, safety or occupancy-compliance decisions.

Frequently Asked Questions

Is this project suitable for a final-year project?

Yes — for Electronics, IoT and Computer Engineering programs, because it combines embedded sensing, direction logic, wireless communication and a working cloud dashboard in one build a team can explain end to end, from the IR beam breaking at the doorway to the peak-hour chart on the screen. The viva has concrete things to discuss: sensor spacing, debounce timing, the 2-second crossing timeout, and the demo-sample day totals. The demo-sample day totals of 342 entries and 318 exits with a peak hour of 18:00–19:00 at 52 entries give the viva concrete numbers. The build also shows honest limits, such as two people entering side by side counting as one crossing, which is a genuine limitation to discuss in the viva.

How does the counter know whether someone entered or left?

From the order in which the two sensor pairs break, because the outer pair sits nearer the street and the inner pair nearer the shop floor, so a person walking in breaks the outer beam first and the inner beam second, while a person walking out breaks them in the reverse order. The ESP32 discards the crossing if the second beam never breaks within 2 seconds. No camera is involved, so no images or personal data are captured at any point.

How accurate is the count?

The count is exact for one person crossing at a time, because each completed crossing adds exactly one to entries or exits, but no accuracy percentage is claimed, since two people walking in side by side break both beams together and are counted as a single crossing. The demo-sample day recorded 342 entries and 318 exits, leaving 24 inside at close. Wider doorways, faster crowds and tailgating all reduce reliability, so the page states the single-file-crossing condition instead of a measured accuracy figure.

Does it work without Wi-Fi?

Counting and the LCD display keep working without Wi-Fi, because the ESP32 counts locally and shows entries, exits and people inside on the 16x2 LCD at the door, while only the cloud dashboard and hourly charts pause until the connection returns. When Wi-Fi returns, the ESP32 resumes publishing over MQTT and the dashboard picks up from the latest totals. The hourly history for the offline period is rebuilt from the hourly buckets the ESP32 kept in memory, so a short outage does not lose the day's counts.

Can this be fitted to a real shop doorway?

Not directly, because the demo rig uses a 45 cm wide doorway frame matched to the 5 mm sensors' 50 cm rated range, while a real shop doorway is roughly 90 cm wide, so a real installation needs longer-range beam sensors or a retroreflective pair. The counting logic, debounce, timeout and dashboard need no change for a wider doorway — only the sensor hardware changes. The build documentation includes a doorway-sizing note that lists the beam range against the frame width so the buyer can check the fit before ordering.

What will I receive with the project?

A working doorway footfall-counter prototype with the ESP32, two IR break-beam sensor pairs, a 16x2 LCD and the demo doorway frame, plus the firmware, the cloud dashboard, wiring diagrams, a component list, setup instructions, the project report, a PPT and a viva Q&A document. The dashboard is delivered as the working demo shown on this page, with live counters, the hourly bar chart and the peak-hour table. The demo-sample day (342 entries, 318 exits, peak hour 18:00–19:00) is included so the buyer can see the dashboard with realistic data before the first real crossing.

Components & software requirements
  • ESP32 (dual-core microcontroller · Wi-Fi)
  • IR break-beam sensor · 5 mm · 50 cm range
  • 16x2 LCD display
  • Arduino IDE (ESP32 firmware)
  • MQTT over Wi-Fi (5-second publish)
  • HTML · CSS · JavaScript dashboard
  • MQTT broker (cloud-hosted)
  • Arduino framework · C++
Delivery information

Built-to-order project. Delivery timeline is shared after order confirmation based on current queue.

Support terms

Complete documentation, setup guide, and viva preparation included. Support for setup and explanation provided.

Download free synopsis (PDF)

Enter your name and WhatsApp number — the synopsis PDF downloads immediately. We may send occasional project updates on WhatsApp; no spam.

Get a quotation