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/30 00:59]
mioara_raluca.nica [Software Design]
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 71: Line 68:
   * **Debug:** Serial Monitor @ 9600 baud; optional logic-analyzer capture   * **Debug:** Serial Monitor @ 9600 baud; optional logic-analyzer capture
  
-=== Third-Party ​Libraries & Sources ===+=== Libraries & Sources ===
   * Wire – I2C bus (Arduino core)   * Wire – I2C bus (Arduino core)
   * LiquidCrystal_PCF8574 – 16×2 LCD via PCF8574 backpack   * LiquidCrystal_PCF8574 – 16×2 LCD via PCF8574 backpack
Line 80: Line 77:
  
 === Architecture & Algorithms === === Architecture & Algorithms ===
-    1.**State Flow** +**State Flow** 
-    1. *Idle / Scan Card– LEDs show occupancy, LCD “Scan card…”. +    1. Idle / Scan Card – LEDs show occupancy, LCD “Scan card…”. 
-    2. *Entry Granted– valid UID **and** free spots. +    2. Entry Granted – valid UID and free spots. 
-    3. *Raise Barrier (Entry)– ultrasonic #1 detects a vehicle ​**and** ≥ 10 s since last raise. +    3. Raise Barrier (Entry) – ultrasonic #1 detects a vehicle and ≥ 10 s since last raise. 
-    4. *Count Entry– ultrasonic #2 sees vehicle, barrier lowers, ​`carsInside++`+    4. Count Entry – ultrasonic #2 sees vehicle, barrier lowers, carsInside++. 
-    5. *Raise Barrier (Exit)– `carsInside > 0`, ultrasonic #2 sees vehicle ​**and** cooldown met. +    5. Raise Barrier (Exit) – carsInside > 0, ultrasonic #2 sees vehicle and cooldown met. 
-    6. *Count Exit– vehicle clears sensor, barrier lowers, ​`carsInside--`.+    6. Count Exit – vehicle clears sensor, barrier lowers, carsInside--.
  
-  - **Key Data**+**Key Data**
     ```cpp     ```cpp
     const byte authorizedUID[][4]; ​  // whitelist of UIDs     const byte authorizedUID[][4]; ​  // whitelist of UIDs
Line 95: Line 92:
     ```     ```
  
-  - **Timing Constants** +**Timing Constants** 
-    * `minRaiseInterval= 10 000 ms – global cooldown between raises +    * minRaiseInterval = 10 000 ms – global cooldown between raises 
-    * `carClearTime= 1 500 ms – confirm sensor field is empty before lowering+    * carClearTime = 1 500 ms – confirm sensor field is empty before lowering
  
-=== Source Files & Functions ​(Stage 3) === +=== Source Files & Functions === 
-  * **`parking_barrier.ino`** +  * **parking_barrier.ino** 
-      * `setup()– hardware init, “Welcome” splash +      * setup() – hardware init, “Welcome” splash 
-      * `loop()– full FSM for entry/​exit +      * loop() – full FSM for entry/​exit 
-      * `readDistanceCm()– HC-SR04 helper +      * readDistanceCm() – HC-SR04 helper 
-      * `isAuthorized()– UID whitelist check +      * isAuthorized() – UID whitelist check 
-      * `updateLEDs()– green/​orange/​red status LEDs +      * updateLEDs() – green/​orange/​red status LEDs 
-      * `showMessage()– text output on LCD+      * showMessage() – text output on LCD
  
 === Planned Enhancements === === Planned Enhancements ===
Line 115: Line 112:
 ===== 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.1748555940.txt.gz · Last modified: 2025/05/30 00:59 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