

Description: Smart visitor counter with automated crowd control using Arduino. Features real-time counting, threshold alerts & relay-based access control. Tools: Arduino · Embedded C · PCB Design · Proteus Simulation Topics: arduino · visitor-counter · crowd-control · embedded · iot · automation
- Size
- 70.5 × 76 mm
- Copper layers
- 2
- Thickness
- 1.6 mm
- Parts
- 8
- Nets
- 32
- Pads
- 53
- Tracks, vias
- 46, 1
- Pours
- 1
- Routed
- Yes
- KiCad
- KiCad 10.0 (file 20260206)
- Created
- 31 Mar 2026
- Updated
- 31 Mar 2026
Overview
PCB design is an open-source printed circuit board by Pritika-2024, from the Pritika-2024/Visitor_counter_crowd_control repository on GitHub, published under the MIT licence. It is a 2-layer board of 70.5 × 76 mm with 8 parts on 32 nets, routed with 46 tracks and 1 via.
It belongs with the home automation and IoT boards of this library.
README
README.mdSecure Visitor Counter with Crowd Control
An automated visitor monitoring and crowd control system using IR sensors, servo motor, 16x2 LCD and a 4x4 keypad — built on Arduino Uno. The system restricts entry once maximum occupancy is reached and allows access only through registration number verification.
Table of Contents
- How It Works
- Circuit
- Hardware Implementation
- PCB Design
- Components
- Libraries Used
- Source Code
- Results
⚙️ How It Works
The system uses two IR sensors — one at the entry and one at the exit — to detect movement and maintain an accurate real-time visitor count. The Arduino Uno processes all sensor signals, manages the door mechanism, and enforces the maximum occupancy limit.
Block Diagram
Step-by-step flow:
1. System Initialization — On power-up, the Arduino initializes all peripherals. The LCD displays Visitor Counter | Count: 0/4 and the servo motor holds the door in the closed position.
2. Entry Detection — When the IR entry sensor detects a person (output goes LOW), the system checks if the current count is below the maximum limit (4). If within limit, it prompts Enter Reg. Number on the LCD.
3. Registration Verification — The user enters a 4-digit number via the 4x4 keypad. The Arduino compares this against a stored list of valid registration numbers. If valid, the count increments and the door opens. If invalid, Invalid Number is shown and entry is denied.
4. Door Control — On successful verification, the servo motor rotates to 90° (door open), holds for 3 seconds, then returns to 0° (door closed). A doorMoving flag prevents any new sensor triggers during this operation.
5. Exit Detection — When the IR exit sensor detects a person leaving, the count decrements automatically. No verification is needed for exit. A debounce delay of 1000ms prevents false triggers.
6. Crowd Control Enforcement — If visitor_count == maxVisitors, the system sets maxCountReached = true and displays Max Count Reached | Entry Prohibited. The door will not open for new entries until the count drops below the limit.
7. Continuous Monitoring — The main loop continuously polls both sensors in real time, handling all entry and exit events without any manual intervention.
Circuit
The Arduino Uno is the central controller. Both IR sensors connect to digital input pins D2 and D3. The servo motor PWM signal goes to D9. The LCD communicates over I2C using A4 (SDA) and A5 (SCL), which reduces wiring to just 4 wires. The 4x4 keypad uses 8 digital pins — rows on D4, D5, D6, D7 and columns on D8, D10, D11, D12.
Circuit Diagram
| Component | Arduino Pin |
|---|---|
| IR Entry Sensor (OUT) | D2 |
| IR Exit Sensor (OUT) | D3 |
| Servo Motor (Signal) | D9 |
| LCD SDA | A4 |
| LCD SCL | A5 |
| Keypad Rows | D4, D5, D6, D7 |
| Keypad Columns | D8, D10, D11, D12 |
Hardware Implementation
The system was physically assembled and tested using a cardboard door model named "Mondini Hall." The LCD and keypad were mounted on the front panel for user interaction. The Arduino, servo, and IR sensors were wired behind the frame. The servo arm was mechanically linked to a door flap to simulate real door open/close operation.
Hardware Implementation
PCB Design
The schematic and PCB were designed in KiCad to convert the breadboard prototype into a production-ready layout. The schematic captures all component connections and net assignments. The PCB consolidates these into a compact single-layer board with clearly labeled pads for each peripheral.
Schematic Diagram
PCB layout
The 3D view confirms component placement and checks for mechanical clearance before fabrication.
3D view
Components
| # | Component | Qty | Cost |
|---|---|---|---|
| 1 | Arduino Uno (ATmega328P) | 1 | ₹230 |
| 2 | 16x2 LCD Display with I2C module | 1 | ₹150 |
| 3 | IR Obstacle Sensor (2–30cm range) | 2 | ₹80 |
| 4 | Micro Servo Motor SG90 | 1 | ₹40 |
| 5 | 4x4 Matrix Membrane Keypad | 1 | ₹100 |
| Total | ₹600 |
Libraries Used
| Library | Purpose |
|---|---|
LiquidCrystal_I2C | Controls the 16x2 LCD over I2C protocol. Uses only 2 wires (SDA, SCL) instead of the standard 6–8 pin parallel interface, simplifying wiring significantly. |
Wire | Provides I2C communication support for Arduino. Required as a dependency by LiquidCrystal_I2C to handle the low-level data transmission between Arduino and the LCD module. |
Servo | Manages PWM signal generation for the SG90 servo motor. Allows precise angle control (0°–180°) using simple servo.write(angle) commands without manually handling PWM timing. |
Keypad | Handles 4x4 matrix keypad scanning using row-column multiplexing. Detects key presses by sequentially pulling rows low and reading column states, reducing 16 buttons to just 8 pins. |
Install via Arduino IDE:
Sketch → Include Library → Manage Libraries → Search each library name
Source Code
| File | Description |
|---|---|
src/Code.cpp | Main Arduino source code — visitor counting logic |
02_Visitor_simulation/sketch.ino | Wokwi online simulation sketch |
02_Visitor_simulation/diagram.json | Wokwi circuit wiring diagram |
02_Visitor_simulation/libraries.txt | Library dependencies for simulation |
03_PCB/Schematic.kicad_sch | KiCad schematic source file |
03_PCB/PCB_design.kicad_pcb | KiCad PCB layout source file |
Default valid registration numbers:
1238 | 5678 | 9101 | 1121To modify, update the
validRegistrationNumbers[]array in01_src/03_a.cpp
Results
The system was tested across multiple scenarios and performed accurately in all cases.
When the system powers on, the LCD initializes with Visitor Counter | Count: 0/4. Upon entry detection, the system successfully prompts for a registration number. Entering a valid number increments the count, opens the servo door for 3 seconds, and updates the display. An invalid number shows Invalid Number for 2 seconds before returning to idle.
The exit sensor correctly decrements the count each time a person leaves, and the maxCountReached flag resets automatically, re-enabling entry. When all 4 slots are occupied, the LCD switches to Max Count Reached | Entry Prohibited and the door remains locked regardless of sensor triggers.
The debounce mechanism successfully prevented false triggers on both entry and exit sensors during rapid movement testing.
| Test Case | Input | Result |
|---|---|---|
| Power ON | — | Visitor Counter / Count: 0/4 |
| Valid entry | Reg. No: 1238 | Count increments, door opens |
| Invalid entry | Reg. No: 0000 | Invalid Number shown |
| Max capacity | Count = 4 | Max Count Reached / Entry Prohibited |
| Exit detected | IR Exit triggered | Count decrements, entry re-enabled |
| Incomplete input | Less than 4 digits + # | Enter 4 digits! shown |
License
This project is licensed under the MIT License.
Parts
8| Qty | Value | Footprint | References |
|---|---|---|---|
| 3 | Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_Vertical | DoorServo, EntrySensor, ExitSensor | |
| 1 | Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Vertical | LCD | |
| 1 | 4x4 | Connector_PinHeader_2.54mm:PinHeader_1x08_P2.54mm_Vertical | Keypad |
| 1 | Arduino | Module:Arduino_UNO_R3 | Arduino_UNO |
The 6 most common of 8 parts.
Similar boards
- 2 layers20.5 × 24.8 mm

- 2 layers14.4 × 10.5 mm

OSO SWAB B1-00 Sensor Watch Accelerometer
joeycastillo/Sensor-Watch
A board replacement for the classic Casio F-91W wristwatch
8 parts2.1k - 2 layers7.9 × 39.1 mm

Brain board STM32F407 SD wing it
rusefi/rusefi
rusefi - GPL internal combustion engine control unit
8 parts1.2k - 2 layers59.9 × 25.7 mm

Buffer
hoglet67/RGBtoHDMI
Bare-metal Raspberry Pi project that provides pixel-perfect sampling of Retro Computer RGB/YUV video and conversion to HDMI
8 parts1kGPL-3.0 - 2 layers52 × 12.6 mm

USB
shanteacontrols/OpenDeck
A platform for building interactive control and sensing devices using MIDI and OSC built with Zephyr RTOS.
8 parts960Apache-2.0 - 2 layers87.5 × 48.5 mm

7 input macropad
hackclub/OnBoard
💡 Join 1,000 teenagers and make your first PCB with a $100 grant!
8 parts915 - 2 layers36.2 × 63.1 mm

PicoMemcard pico
dangiu/PicoMemcard
Emulating PSX Memory Card (or controller) using a Raspberry Pi Pico
8 parts694GPL-3.0 - 2 layers36 × 10 mm

PCB4-PWR BTN Rev.A
OLIMEX/DIY-LAPTOP
Do It Yourself Open Source Hardware and Software Modular Hacker's Friendly Laptop
8 parts578Apache-2.0
Questions
How big is the PCB design PCB?
It measures 70.5 × 76 mm and has 2 copper layers, 1.6 mm thick.
What parts does the PCB design use?
8 parts. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.
Where can I download the PCB design KiCad files?
From the Pritika-2024/Visitor_counter_crowd_control repository on GitHub, at the commit this page was made from: the board is 01_Visitor_counter_using_ArduinoUNO/03_PCB/PCB_design.kicad_pcb and its schematic 01_Visitor_counter_using_ArduinoUNO/03_PCB/Schematic.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Can I use the PCB design design in my own project?
Its repository publishes it under the MIT licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).