Skip to the content
2 layers70.5 × 76 mmPCB design, the printed circuit board in 3D

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.md

Secure Visitor Counter with Crowd Control

Arduino Language

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

ComponentArduino Pin
IR Entry Sensor (OUT)D2
IR Exit Sensor (OUT)D3
Servo Motor (Signal)D9
LCD SDAA4
LCD SCLA5
Keypad RowsD4, D5, D6, D7
Keypad ColumnsD8, 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

#ComponentQtyCost
1Arduino Uno (ATmega328P)1₹230
216x2 LCD Display with I2C module1₹150
3IR Obstacle Sensor (2–30cm range)2₹80
4Micro Servo Motor SG901₹40
54x4 Matrix Membrane Keypad1₹100
Total₹600

Libraries Used

LibraryPurpose
LiquidCrystal_I2CControls the 16x2 LCD over I2C protocol. Uses only 2 wires (SDA, SCL) instead of the standard 6–8 pin parallel interface, simplifying wiring significantly.
WireProvides 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.
ServoManages 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.
KeypadHandles 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

FileDescription
src/Code.cppMain Arduino source code — visitor counting logic
02_Visitor_simulation/sketch.inoWokwi online simulation sketch
02_Visitor_simulation/diagram.jsonWokwi circuit wiring diagram
02_Visitor_simulation/libraries.txtLibrary dependencies for simulation
03_PCB/Schematic.kicad_schKiCad schematic source file
03_PCB/PCB_design.kicad_pcbKiCad PCB layout source file

Default valid registration numbers:

text
1238 | 5678 | 9101 | 1121

To modify, update the validRegistrationNumbers[] array in 01_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 CaseInputResult
Power ON—Visitor Counter / Count: 0/4
Valid entryReg. No: 1238Count increments, door opens
Invalid entryReg. No: 0000Invalid Number shown
Max capacityCount = 4Max Count Reached / Entry Prohibited
Exit detectedIR Exit triggeredCount decrements, entry re-enabled
Incomplete inputLess than 4 digits + #Enter 4 digits! shown

License

This project is licensed under the MIT License.

Parts

8
QtyValueFootprintReferences
3Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_VerticalDoorServo, EntrySensor, ExitSensor
1Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_VerticalLCD
14x4Connector_PinHeader_2.54mm:PinHeader_1x08_P2.54mm_VerticalKeypad
1ArduinoModule:Arduino_UNO_R3Arduino_UNO

The 6 most common of 8 parts.

Similar boards

  • 2 layers20.5 × 24.8 mmPi interface, the printed circuit board in 3D

    Pi interface

    opulo-inc/lumenpnp

    The LumenPnP is an open source pick and place machine.

    8 parts3.7k
  • 2 layers59.9 × 25.7 mmBuffer, the printed circuit board in 3D

    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 mmUSB, the printed circuit board in 3D

    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 mm7 input macropad, the printed circuit board in 3D

    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 mmPicoMemcard pico, the printed circuit board in 3D

    PicoMemcard pico

    dangiu/PicoMemcard

    Emulating PSX Memory Card (or controller) using a Raspberry Pi Pico

    8 parts694GPL-3.0
  • 2 layers36 × 10 mmPCB4-PWR BTN Rev.A, the printed circuit board in 3D

    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).