Differences

This shows you the differences between two versions of the page.

Link to this comparison view

pm:prj2026:bianca.popa1106:andreea.peiu [2026/05/09 20:35]
andreea.peiu [Bill of Materials (BOM)]
pm:prj2026:bianca.popa1106:andreea.peiu [2026/05/25 13:17] (current)
andreea.peiu [Github Repository]
Line 147: Line 147:
   * Sensors are continuously monitored for event-driven transitions.   * Sensors are continuously monitored for event-driven transitions.
  
-| Component | Description | Quantity | +==== Bill of Materials ​(BOM) ====
-|---|---|---| +
-| [Arduino Nano](https://​www.optimusdigital.ro/​ro/​compatibile-cu-arduino-nano/​1686-placa-de-dezvoltare-compatibila-cu-arduino-nano-atmega328p-i-ch340.html?​search_query=Arduino+Nano&​results=19) | Main microcontroller board | 1 | +
-| [SG90 Servo Motor](https://​www.emag.ro/​servomotor-sg90-180-de-grade-ai156-s297/​pd/​D33V1GMBM/​) | Barrier actuation | 1 | +
-| [4x4 Membrane Keypad](https://​electronicmarket.ro/​16-butoane-4x4-membrana-tastatura-matrice?​gad_source=1&​gad_campaignid=21513542058&​gbraid=0AAAAA-D1O9a6AT7ETNQlq5EpyCwTGwRHL&​gclid=Cj0KCQjws83OBhD4ARIsACblj1_IyhkLjqcV-garzFP1366gORaBYienDHeu3pn_nMsB-EiJ_qn3PNIaAsvhEALw_wcB) | PIN authentication input | 1 | +
-| [IR Sensors]| User detection | 2 | +
-| [LCD 16x2 with I2C](https://​www.optimusdigital.ro/​ro/​optoelectronice-lcd-uri/​867-modul-lcd-1602-cu-backlight-galben-verde-de-5v.html?​search_query=lcd+16+x+2&​results=167| User interface display | 1 | +
-| [LEDs](https://​www.optimusdigital.ro/​) | Visual feedback | 2 | +
-| Breadboard | Prototyping platform | 1 | +
-| Jumper Wires | Electrical connections | ~30 | +
-| Resistors | Current limiting | Multiple | +
-===== Software Design =====+
  
-==== Development Environment ====+^ Component ^ Description ^ Quantity ^ 
 +| Arduino Nano | Main microcontroller board | 1 | 
 +| SG90 Servo Motor | Barrier actuation mechanism | 1 | 
 +| DC Motor | Conveyor belt movement | 1 | 
 +| L298N Motor Driver | H-Bridge motor controller | 1 | 
 +| 4x4 Membrane Keypad | PIN authentication input | 1 | 
 +| IR Proximity Sensors | User detection | 2 | 
 +| LCD 16x2 with I2C | User interface display | 1 | 
 +| LEDs | Visual feedback indicators | 2 | 
 +| Custom PCB | Hardware integration board | 1 | 
 +| Jumper Wires / Connectors | Electrical connections | ~20 | 
 +| Resistors | Current limiting and pull-up resistors | Multiple | 
 + 
 +====== Software Design ====== 
 + 
 +===== Development Environment ====
 + 
 +The firmware was developed using:
  
   * Arduino IDE   * Arduino IDE
-  * Language: C/C++ +  * Programming ​Language: C/C++ 
-  * Platform: Arduino ​Uno+  * Target ​Platform: Arduino ​Nano (ATmega328P)
  
-==== External Libraries Used ====+The software architecture is based on a finite state machine (FSM) implementation that manages all transitions between authentication,​ barrier control, and user detection states.
  
-  * Servo.h +===== External Libraries Used =====
-  * Keypad.h +
-  * LiquidCrystal_I2C.h +
-  * Wire.h+
  
-==== Code Components ====+The following third-party libraries were integrated into the project firmware:
  
-The software is divided into several logical modules:+^ Library ^ Purpose ^ 
 +| Wire.h | I2C communication support | 
 +| LiquidCrystal_I2C.h | LCD 16×2 display control | 
 +| Keypad.h | 4×4 keypad scanning and input processing | 
 +| Servo.h | Servo motor PWM control |
  
-=== State Machine Logic ===+These libraries simplify peripheral integration and allow modular firmware development.
  
-Handles all transitions between system states: +===== Software Architecture =====
-  * IDLE +
-  * WAIT_FOR_CONFIRM +
-  * OPENING +
-  * WAIT_FOR_PASS +
-  * CLOSING +
-  * ERROR+
  
-=== Authentication Module ===+The application firmware is divided into multiple logical modules responsible for different hardware subsystems and control mechanisms.
  
-  * Reads keypad input +===== Finite State Machine (FSM) =====
-  * Stores typed digits +
-  * Validates entered PIN +
-  * Handles timeout conditions+
  
-=== Barrier Control Module ===+The entire system behavior is controlled using a finite state machine.
  
-  * Controls servo position using PWM +Implemented states:
-  * Opens and closes the barrier +
-  * Ensures smooth transitions+
  
-=== Sensor Monitoring Module ===+^ State ^ Description ^ 
 +| ST_IDLE | Waiting for user detection | 
 +| WAIT_FOR_CONFIRM | User PIN input state | 
 +| OPENING | Barrier opening and conveyor activation | 
 +| WAIT_FOR_PASS | Waiting for user passage | 
 +| CLOSING | Barrier closing and conveyor stop | 
 +| EROARE | Error and timeout handling |
  
-  * Continuously checks both proximity sensors +The FSM implementation provides: 
-  * Detects user arrival and passage +  * modular control flow; 
-  * Triggers FSM state transitions+  * predictable ​state transitions
 +  * easier debugging and testing; 
 +  * scalable architecture for future extensions.
  
-=== LCD Feedback System ​===+===== Authentication Module =====
  
-Displays+The authentication subsystem is responsible for
-  * current state +  * keypad scanning; 
-  * authentication messages +  * PIN storage; 
-  * error messages +  * PIN validation; 
-  * timeout ​notifications+  * timeout ​protection.
  
-=== Audio & Visual Feedback ===+Main features: 
 +  * supports numeric PIN entry; 
 +  * supports character deletion using '​*';​ 
 +  * PIN confirmation using '#';​ 
 +  * automatic timeout reset after inactivity.
  
-  * Green LED → access granted +The authentication logic compares the entered PIN with a predefined secret code stored in firmware.
-  * Red LED → access denied +
-  * Buzzer → acoustic notifications+
  
-==== Implementation Details ​====+===== Sensor Monitoring Module =====
  
-The project integrates concepts from multiple laboratory sessions:+Two IR proximity sensors are continuously monitored:
  
-=== Lab 0 – GPIO ===+^ Sensor ^ Purpose ^ 
 +| Front IR Sensor | Detects user arrival | 
 +| Rear IR Sensor | Detects successful passage |
  
-Used for: +The sensors are read using analog inputs and calibrated automatically during system startup.
-  * LEDs +
-  * buzzer +
-  * keypad communication +
-  * sensor reading+
  
-=== Lab 2 – Interrupts ===+Calibration process: 
 +  * the firmware samples sensor values multiple times; 
 +  * computes average environmental baseline; 
 +  * dynamically generates detection thresholds.
  
-Interrupts are used for: +This improves ​detection ​reliability and reduces false triggering.
-  * fast event detection +
-  * responsive system behavior+
  
-=== Lab 3 – Timers & PWM ===+===== Barrier Control Module =====
  
-Used for: +The physical barrier is controlled using an SG90 servo motor.
-  * servo motor PWM control +
-  * authentication timeout +
-  * automatic barrier closing+
  
-=== Lab 4 – ADC ===+The firmware implements:​ 
 +  * smooth opening movement; 
 +  * smooth closing movement; 
 +  * gradual angle transitions using incremental PWM updates.
  
-Used for+Servo positions
-  * reading potentiometer values +  * 0° → barrier closed; 
-  * dynamic timing adjustment+  * 90° → barrier opened.
  
-=== Lab 6 – I2C ===+Movement timing is controlled through software delays to obtain smooth mechanical motion.
  
-Used for: +===== Conveyor Belt Control Module =====
-  * LCD communication +
-  * real-time status display+
  
-==== Optimizations ====+The conveyor mechanism is controlled through an H-Bridge driver.
  
-  * Non-blocking timing using millis() +Implemented operations: 
-  * Event-driven FSM implementation +  * conveyor start; 
-  * Reduced LCD refresh to minimize flicker +  * conveyor stop; 
-  * Stable sensor polling to avoid false triggers+  * motor direction control.
  
 +The conveyor starts only after successful authentication and stops automatically after user passage confirmation.
 +
 +===== LCD Feedback System =====
 +
 +A 16×2 I2C LCD module is used to provide real-time user feedback.
 +
 +Displayed messages include:
 +  * system initialization;​
 +  * PIN request;
 +  * access granted;
 +  * access denied;
 +  * timeout warnings;
 +  * error states;
 +  * conveyor and barrier status.
 +
 +The LCD interface improves usability and debugging visibility.
 +
 +===== LED Signaling System =====
 +
 +Two LEDs are used for visual feedback:
 +
 +^ LED ^ Meaning ^
 +| Green LED | Access granted / active system |
 +| Red LED | Access denied / error state |
 +
 +Implemented behavior:
 +  * both LEDs active in standby mode;
 +  * both LEDs off during authentication;​
 +  * green LED active after successful authentication;​
 +  * red LED active after invalid PIN;
 +  * red LED blinking during error state.
 +
 +===== Timing and Timeout Management =====
 +
 +The firmware uses non-blocking timing based on the millis() function.
 +
 +Implemented protections:​
 +  * PIN input timeout;
 +  * passage timeout;
 +  * automatic recovery after inactivity.
 +
 +Advantages:
 +  * responsive behavior;
 +  * reduced blocking delays;
 +  * stable event processing.
 +
 +===== Implemented Functions =====
 +
 +==== State Management ====
 +
 +^ Function ^ Purpose ^
 +| tranzitie() | Handles FSM transitions |
 +
 +==== Sensor Functions ====
 +
 +^ Function ^ Purpose ^
 +| irFata() | Detects approaching user |
 +| irSpate() | Detects completed passage |
 +
 +==== Barrier Functions ====
 +
 +^ Function ^ Purpose ^
 +| servoMisca() | Smooth servo movement control |
 +
 +==== Conveyor Functions ====
 +
 +^ Function ^ Purpose ^
 +| bandaPorneste() | Starts conveyor motor |
 +| bandaOpreste() | Stops conveyor motor |
 +
 +==== LCD Functions ====
 +
 +^ Function ^ Purpose ^
 +| lcdAfis() | Updates LCD display messages |
 +
 +===== Implemented Embedded Concepts =====
 +
 +The project integrates concepts from multiple Embedded Systems laboratory sessions:
 +
 +^ Laboratory ^ Concepts Used ^
 +| GPIO | LEDs, keypad, sensors |
 +| Timers & PWM | Servo motor control |
 +| ADC | IR sensor analog reading |
 +| I2C | LCD communication |
 +| FSM Design | System control logic |
 +
 +===== Software Optimizations =====
 +
 +Several optimizations were implemented:​
 +
 +  * modular firmware structure;
 +  * state-based architecture;​
 +  * automatic sensor calibration;​
 +  * non-blocking timeout management;
 +  * smooth servo movement;
 +  * reduced LCD refresh flickering;
 +  * stable sensor polling.
 +
 +===== System Workflow =====
 +
 +  - System waits in ST_IDLE.
 +  - Front sensor detects user presence.
 +  - User enters authentication PIN.
 +  - If PIN is correct:
 +    * barrier opens;
 +    * conveyor belt starts;
 +    * green LED activates.
 +  - Rear sensor confirms passage.
 +  - Conveyor stops.
 +  - Barrier closes.
 +  - System returns to idle state.
 +
 +In case of:
 +  * invalid PIN;
 +  * timeout;
 +  * missing passage confirmation;​
 +
 +the firmware transitions into an error handling state and safely resets the system.
 ===== Results ===== ===== Results =====
  
Line 278: Line 399:
 ==== Github Repository ==== ==== Github Repository ====
  
-[[https://​github.com/​USERNAME/andreea-project]]+[[https://​github.com/​andreeapeiu/Smart-Barrier-Access-System.git]]
  
 ==== Demo Video ==== ==== Demo Video ====
  
-[[https://​youtube.com/​]]+[[https://​youtube.com/​shorts/​fw3LWh_MJx0?​is=S9cDCzvet7fm1EIm]]
  
 ==== Project Images ==== ==== Project Images ====
  
-{{:​pm:​prj2026:​andreea:​full_setup.jpg?​600|}} 
- 
-{{:​pm:​prj2026:​andreea:​lcd_interface.jpg?​600|}} 
- 
-{{:​pm:​prj2026:​andreea:​barrier_open.jpg?​600|}} 
  
 ===== Conclusion ===== ===== Conclusion =====
Line 309: Line 425:
   * Arduino Uno Datasheet   * Arduino Uno Datasheet
   * SG90 Servo Motor Datasheet   * SG90 Servo Motor Datasheet
-  * HC-SR04 Sensor Datasheet 
   * LCD 16x2 I2C Documentation   * LCD 16x2 I2C Documentation
  
 ==== Software Resources ==== ==== Software Resources ====
  
-  * https://​www.arduino.cc/​ +
-  * https://​docs.arduino.cc/​ +
-  * https://​github.com/​arduino-libraries/​Servo +
-  * https://​github.com/​Chris--A/​Keypad +
-  * https://​github.com/​johnrickman/​LiquidCrystal_I2C+
pm/prj2026/bianca.popa1106/andreea.peiu.1778348116.txt.gz · Last modified: 2026/05/09 20:35 by andreea.peiu
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