Differences

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

Link to this comparison view

pm:prj2025:vstoica:mioara_raluca.nica [2025/05/29 03:43]
mioara_raluca.nica
pm:prj2025:vstoica:mioara_raluca.nica [2025/05/30 03:09] (current)
mioara_raluca.nica [Rezultate Obţinute]
Line 29: Line 29:
        - Orange → almost full        - Orange → almost full
        - Red → full        - Red → full
-  * **Push Button** (Override) Connected via interrupt, allows manual barrier control in emergency situations or system fallback. 
  
 === Software Flow & Interactions === === Software Flow & Interactions ===
Line 43: Line 42:
           * Red LED turns on.           * Red LED turns on.
   * After car enters, sensor 2 updates spot count.   * After car enters, sensor 2 updates spot count.
-  * Push button can trigger barrier manually, handled via interrupt. 
 ===== Hardware Design ===== ===== Hardware Design =====
 {{:​pm:​prj2025:​vstoica:​circuit_rn.jpeg?​600|}} {{:​pm:​prj2025:​vstoica:​circuit_rn.jpeg?​600|}}
Line 57: Line 55:
 | **Red LED**                   | 1        | Anode→A1 (via 220 Ω), Cathode→GND ​                                                                                | “Full” indicator ​                        | | **Red LED**                   | 1        | Anode→A1 (via 220 Ω), Cathode→GND ​                                                                                | “Full” indicator ​                        |
 | **220 Ω Resistors** ​          | 3        | In series with each LED                                                                                          | Current limiting for LEDs                | | **220 Ω Resistors** ​          | 3        | In series with each LED                                                                                          | Current limiting for LEDs                |
-| **Push-Button (Override)** ​   | 1        | One side→D3 (INPUT_PULLUP),​ other side→GND ​                                                                       | Manual barrier control (interrupt on D3) | 
 | **Breadboard** ​               | 1        | –                                                                                                                | Prototyping / common power rails         | | **Breadboard** ​               | 1        | –                                                                                                                | Prototyping / common power rails         |
 | **Jumper Wires** ​             | ~20      | –                                                                                                                | Signal and power connections ​            | | **Jumper Wires** ​             | ~20      | –                                                                                                                | Signal and power connections ​            |
Line 65: Line 62:
 ===== Software Design ===== ===== Software Design =====
  
-<note tip> +=== Development Environment === 
-Descrierea codului aplicaţiei ​(firmware): +  * **IDE:** PlatformIO in VS Code 
-  * mediu de dezvoltare ​(if any) (e.gAVR Studio, CodeVisionAVR+  * **Tool-chain:​** avr-gcc + avrdude ​(bundled with the IDE) 
-  * librării şi surse 3rd-party ​(e.gProcyon AVRlib+  * **MCU clock:** 16 MHz 
-  * algoritmi şi structuri pe care plănuiţi să le implementaţi +  * **Debug:** Serial Monitor @ 9600 baud; optional logic-analyzer capture 
-  * (etapa 3surse şi funcţii implementate + 
-</note>+=== Libraries & Sources === 
 +  * Wire – I2C bus (Arduino core) 
 +  * LiquidCrystal_PCF8574 – 16×2 LCD via PCF8574 backpack 
 +  * SPI – hardware SPI for MFRC522 ​(Arduino core) 
 +  * MFRC522 – 13.56 MHz RFID reader API (miguelbalboa/​MFRC522
 +  * Servo – PWM control for the barrier arm 
 +  * avr/io.h – direct register access for fast LED updates 
 + 
 +=== Architecture & Algorithms === 
 +**State Flow** 
 +    1. Idle / Scan Card – LEDs show occupancy, LCD “Scan card…”. 
 +    2. Entry Granted – valid UID and free spots. 
 +    3. Raise Barrier ​(Entry) – ultrasonic #1 detects a vehicle and ≥ 10 s since last raise. 
 +    4Count Entry – ultrasonic #2 sees vehicle, barrier lowers, carsInside++. 
 +    5. Raise Barrier (Exit– carsInside > 0, ultrasonic #2 sees vehicle and cooldown met. 
 +    6. Count Exit – vehicle clears sensor, barrier lowers, carsInside--. 
 + 
 +**Key Data** 
 +    ```cpp 
 +    const byte authorizedUID[][4]; ​  // whitelist of UIDs 
 +    int  carsInside; ​                // vehicles inside 
 +    unsigned long lastRaiseMillis; ​  // last time barrier was raised 
 +    ``` 
 + 
 +**Timing Constants** 
 +    * minRaiseInterval = 10 000 ms – global cooldown between raises 
 +    * carClearTime = 1 500 ms – confirm sensor field is empty before lowering 
 + 
 +=== Source Files & Functions === 
 +  * **parking_barrier.ino** 
 +      * setup() – hardware init, “Welcome” splash 
 +      * loop() – full FSM for entry/exit 
 +      * readDistanceCm() – HC-SR04 helper 
 +      * isAuthorized() – UID whitelist check 
 +      * updateLEDs() – green/​orange/​red status LEDs 
 +      * showMessage() – text output on LCD 
 + 
 +=== Planned Enhancements === 
 +  * Safety photocell to block lowering if an obstacle is detected 
 +  * EEPROM-stored whitelist with master-card admin functions 
 +  * Web dashboard (ESP8266/​ESP32) for live telemetry and OTA updates
  
 ===== Rezultate Obţinute ===== ===== Rezultate Obţinute =====
  
-<note tip> +Code: 
-Care au fost rezultatele obţinute în urma realizării proiectului vostru+https://​github.com/​Raluca1304/​Automatic_parking_gate.git 
-</note>+ 
 + 
 +Demo:  
 +https://​youtube.com/​shorts/​BB8ATAf_ZLA?​feature=share 
 + 
 +{{:​pm:​prj2025:​vstoica:​imagine_13.jpeg?​200|}} 
 + 
 + 
 +===== Conclusions ===== 
 + 
 +The **Automatic Parking Gate** prototype successfully met its main goals: RFID-based access control, real-time spot counting with ultrasonic sensors, and safe barrier actuation via a servo—all accompanied by clear LCD messages and status LEDs. Bench-top and live tests showed: 
 + 
 +* **Reliability** – The barrier opened only for authorised cards and never allowed occupancy to exceed capacity in all test scenarios. 
 +   
 +* **Response time** – The arm rises in under 1 s after a valid scan and lowers about 800 ms after the vehicle clears the exit sensor.  
 +  
 +* **User feedback** – LCD prompts and the green / yellow / red LED scheme gave immediate, intuitive information. 
 + 
 +On the learning side, the project reinforced skills in: 
 + 
 +* SPI and I2C communication on Arduino hardware; ​  
 + 
 +* designing a clean finite-state machine;  
 +  
 +* integrating multiple hardware modules into a cohesive system. 
 + 
 +** Observed limitations 
 +** 
 +* Ultrasonic sensors can mis-trigger in heavy rain or on very angled surfaces. 
 +   
 +* The whitelist of cards is hard-coded—any change requires reflashing.  
 +  
 +* There is no dedicated safety sensor to halt the arm while it is lowering. 
 + 
 +** Future improvements** 
 + 
 +1. Add an IR **safety photocell** to stop the barrier if something crosses underneath. ​  
 + 
 +2. Store the whitelist in **EEPROM** and use a master card for live admin tasks. ​  
 + 
 +3. Attach a Wi-Fi module (ESP8266/​ESP32) for a web dashboard, live telemetry and OTA firmware updates.  
 +  
 +4. Enclose the electronics in a 3-D-printed,​ weather-proof housing and provide rugged power filtering. 
 + 
 +Implementing these upgrades would move the prototype closer to a deployable, real-world parking solution—enhancing safety, flexibility and ease of maintenance.
  
-===== Concluzii ===== 
  
 ===== Download ===== ===== Download =====
 +{{:​pm:​prj2025:​vstoica:​automatic_parking_gate-master.zip|}}
 +
 +
 +
 +
 +===== Bibliography / Resources =====
 +
 +=== Software Resources ===
 +* **Arduino Core Documentation** – “Language Reference” and “Core Libraries” (arduino.cc)
 +
 +* **MFRC522 Library** – GitHub repository *miguelbalboa/​MFRC522*,​ release v1.4.11  ​
 +README and example sketches for SPI RFID communication
 +  ​
 +* **LiquidCrystal_PCF8574 Library** – GitHub repository *mathertel/​LiquidCrystal_PCF8574*,​ release v1.3.x ​ I2C backpack usage and custom character guide
 +  ​
 +* **PlatformIO Documentation** – “Getting Started with AVR/​Arduino” and “Library Dependency Finder”
 +
 +* **AVR Libc Manual** – chapter on direct register access (`avr/​io.h`)
 +
 +* **Timer-1 Fast-PWM Tutorial** – Nick Gammon’s blog post on generating 50 Hz servo signals
 +
 +* **Microchip ATmega328P Datasheet** – section on timers/​counters and SPI/I²C peripherals
  
-<note warning> +=== Hardware Resources === 
-O arhivă (sau mai multe dacă este cazul) cu fişierele obţinute în urma realizării proiectului:​ sursescheme, etc. Un fişier README, un ChangeLog, un script de compilare şi copiere automată pe uC crează întotdeauna o impresie bună ;-).+* **MFRC522 RFID Reader Module Datasheet** – NXP PN532/RC522 referencetiming diagrams
  
-Fişierele se încarcă pe wiki folosind facilitatea ​**Add Images or other files**. Namespace-ul în care se încarcă fişierele este de tipul **:​pm:​prj20??:​c?​** sau **:​pm:​prj20??:​c?:​nume_student** (dacă este cazul). **Exemplu:​** Dumitru Alin331CC -> **:​pm:​prj2009:​cc:​dumitru_alin**. +* **HC-SR04 Ultrasonic Sensor Datasheet** – voltage levelsecho timing relationship
-</​note>​+
  
-===== Jurnal =====+* **SG90 / TowerPro Micro Servo Datasheet** – pulse-width vs. angle chart, stall torque specs
  
-<note tip> +* **16×2 Character LCD (HD44780) Datasheet** – command set, timing, busy-flag notes
-Puteți avea și o secțiune de jurnal în care să poată urmări asistentul de proiect progresul proiectului. +
-</​note>​+
  
-===== Bibliografie/Resurse =====+* **PCF8574 I/O Expander Datasheet** – I2C address map, drive current limits
  
-<​note>​ +* **ESP328P Module Datasheet** – pinout, flash modes, Wi-Fi radio parameters
-Listă cu documente, datasheet-uri,​ resurse Internet folosite, eventual grupate pe **Resurse Software** şi **Resurse Hardware**. +
-</​note>​+
  
 <​html><​a class="​media mediafile mf_pdf"​ href="?​do=export_pdf">​Export to PDF</​a></​html>​ <​html><​a class="​media mediafile mf_pdf"​ href="?​do=export_pdf">​Export to PDF</​a></​html>​
  
  
pm/prj2025/vstoica/mioara_raluca.nica.1748479423.txt.gz · Last modified: 2025/05/29 03:43 by mioara_raluca.nica
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