This is an old revision of the document!
Smart Barrier Access System is an embedded system project that simulates an intelligent access control barrier, similar to those used in parking systems, restricted access areas, or automated gates. The project is built around an Arduino microcontroller and integrates multiple hardware and software modules to provide a secure and interactive access experience.
The system uses two proximity sensors to detect the presence and movement of a user around the barrier. When a person approaches the entrance area, the first sensor triggers the authentication sequence. The user must then enter a valid PIN code using a 4×4 membrane keypad within a limited time interval.
If the authentication is successful, the barrier is lifted using a servo motor. After the user passes through the access point, the second sensor confirms the passage and the barrier automatically closes. If the user fails to authenticate or no movement is detected after opening the barrier, the system safely returns to its initial state.
The main purpose of the project is to demonstrate the implementation of a real-time embedded access control system by combining sensors, motors, and authentication mechanisms, and state-based software control. The project integrates multiple concepts studied during Embedded Systems laboratories, such as GPIO, interrupts, PWM, timers, ADC, and I2C communication.
I believe the project is useful both from an educational and practical perspective. It offers a clear example of how hardware and software modules can interact in order to create an automated and secure control system. At the same time, it provides hands-on experience with designing PCBs, integrating multiple peripherals, implementing finite state machines, and developing modular embedded applications.
The project combines security, automation, and user interaction that can later be extended with RFID, IoT connectivity, or wireless communication features.
• Arduino Nano - Main control unit. It coordinates all hardware modules, processes sensor inputs, validates the PIN code, and controls the barrier state.
• Proximity Sensor 1 - Detects the presence of a user in front of the barrier and initiates the authentication sequence.
• 4×4 Membrane Keypad - Allows the user to enter the authentication PIN code.
• Servo Motor (SG90) - Controls the physical position of the miniature barrier (open/closed).
• Proximity Sensor 2 - Detects whether the user has successfully passed through the access point.
• LCD 16×2 with I2C Interface - Displays system states and user messages such as:
• LEDs - Provide visual and audio feedback depending on system state and authentication result.
1. User approaches the barrier
-> Proximity Sensor 1 detects movement -> System transitions from IDLE to WAIT_FOR_CONFIRM -> LCD prompts user to enter PIN
2. User enters authentication code
-> Keypad input is processed -> Hardware timer starts countdown for timeout protection -> PIN is validated
3. If PIN is correct
-> Barrier opens using servo motor -> Green LED indicates successful access -> System enters WAIT_FOR_PASS state
4. User passes through the barrier
-> Proximity Sensor 2 confirms passage -> Barrier closes automatically -> System returns to IDLE
5. Error handling
-> Invalid PIN or timeout triggers error state -> Red LED indicates failure -> Barrier remains closed -> System resets safely
The software is implemented using a finite state machine (FSM) with the following states:
Legend:
The hardware architecture of the project is centered around an Arduino Nano microcontroller integrated on a custom PCB designed in KiCad. The system combines multiple peripherals used for user detection, authentication, visual feedback, and motion control.
The access control mechanism is based on two IR proximity sensors positioned before and after the barrier. The first sensor detects the presence of a user near the access point and triggers the authentication process, while the second sensor confirms that the user successfully passed through the barrier.
User authentication is performed through a 4×4 membrane keypad connected to multiple digital GPIO pins of the microcontroller. The entered PIN is processed by the firmware and validated before allowing access.
The physical barrier is controlled using an SG90 servo motor driven through a PWM signal generated by the Arduino Nano. In addition, the project includes a DC motor controlled through an L298N H-Bridge motor driver, allowing bidirectional movement of the conveyor belt mechanism.
A 16×2 LCD display connected through the I2C interface is used to display system states, authentication messages, and user instructions in real time.
Two LEDs are used as visual status indicators:
The project also includes a custom-designed PCB containing routing, connectors, protection components, and dedicated headers for all external modules.
The electrical schematic was designed in KiCad and includes all hardware connections used in the project, such as the Arduino Nano, IR sensors, LCD module, keypad interface, LEDs, and power circuitry.
| Component | Arduino Nano Pin(s) | Type | Description |
|---|---|---|---|
| Proximity Sensor 1 | todo | Digital Input | Detects user before barrier |
| Proximity Sensor 2 | todo | Digital Input | Detects user after barrier |
| Servo Motor SG90 | todo | PWM Output | Controls barrier movement |
| Keypad 4×4 | todo | Digital I/O | Reads user PIN input |
| LCD 16×2 I2C | todo | I2C Interface | Displays system messages |
| Green LED | todo | Digital Output | Access granted indicator |
| Red LED | todo | Digital Output | Access denied/error indicator |
| Component | Description | Quantity |
|---|---|---|
| Arduino Nano | Main microcontroller board | 1 |
| SG90 Servo Motor | Barrier actuation | 1 |
| 4×4 Membrane Keypad | PIN authentication input | 1 |
| IR Sensors | User detection | 2 |
| LCD 16×2 with I2C | User interface display | 1 |
| LEDs | Visual feedback | 2 |
| Breadboard | Prototyping platform | 1 |
| Jumper Wires | Electrical connections | ~30 |
| Resistors | Current limiting | Multiple |
The software is divided into several logical modules:
Handles all transitions between system states:
Displays:
The project integrates concepts from multiple laboratory sessions:
Used for:
Interrupts are used for:
Used for:
Used for:
Used for:
The final system successfully demonstrates:
The barrier responds reliably to user interaction and correctly manages all implemented states.
The project successfully combines multiple embedded systems concepts into a practical and interactive application. It demonstrates how sensors, actuators, timers, communication protocols, and state machines can work together to create a functional access control system.
The implementation achieved all proposed objectives while also providing opportunities for future improvements such as: