This shows you the differences between two versions of the page.
pm:prj2025:abirlica:octavian.armasu [2025/05/25 18:09] octavian.armasu |
pm:prj2025:abirlica:octavian.armasu [2025/05/26 10:44] (current) octavian.armasu [Hardware Design] |
||
---|---|---|---|
Line 23: | Line 23: | ||
| 151051RS11000 | Red color led | | | 151051RS11000 | Red color led | | ||
| 151031VS06000 | Green color led | | | 151031VS06000 | Green color led | | ||
- | | SSD1306 | Display LCD | | + | | SSD1306 | Display | |
| RC522 | NFC Reader | | | RC522 | NFC Reader | | ||
| PS1440P02BT | Buzzer | | | PS1440P02BT | Buzzer | | ||
Line 57: | Line 57: | ||
{{:pm:prj2025:abirlica:final_oa.jpeg?700|}} | {{:pm:prj2025:abirlica:final_oa.jpeg?700|}} | ||
===== Software Design ===== | ===== Software Design ===== | ||
- | <note tip> | ||
- | Descrierea codului aplicaţiei (firmware): | ||
- | * mediu de dezvoltare (if any) (e.g. AVR Studio, CodeVisionAVR) | ||
- | * librării şi surse 3rd-party (e.g. Procyon AVRlib) | ||
- | * algoritmi şi structuri pe care plănuiţi să le implementaţi | ||
- | * (etapa 3) surse şi funcţii implementate | ||
- | </note> | ||
- | ===== Rezultate Obţinute ===== | + | **Purpose of the code** |
- | <note tip> | ||
- | Care au fost rezultatele obţinute în urma realizării proiectului vostru. | ||
- | </note> | ||
- | ===== Concluzii ===== | + | This program implements an access control system using RFID cards, based on an Arduino microcontroller. The system integrates an RC522 NFC reader, an OLED display, a real-time clock module (DS3231), LEDs, and a buzzer. When a card is detected, the system displays the access information, provides visual and sound feedback, and logs the timestamp of the event. |
- | ===== Download ===== | + | **Main Software Components** |
+ | - RC522 RFID Reader | ||
+ | * The RC522 module is configured to trigger an interrupt signal via its IRQ pin when a card is presented. | ||
+ | * This interrupt is connected to pin D2 on the Arduino and is handled using attachInterrupt(...). | ||
+ | * The interrupt service routine cardDetected() sets a global flag (cardInterrupt). | ||
+ | * The main loop() checks this flag and processes the card only when the flag is true. | ||
+ | * There are advantages using this method: the microcontroller stays idle until an actual card is detected, reducing unnecessary polling and improving efficiency. | ||
+ | - OLED Display | ||
+ | * It is used to display information for the user. | ||
+ | * When a card is valid and the "door" opens, on the display it will be showed the following message: "Valid Card\n Timestamp\n Door opened". | ||
+ | * When waiting for a card to be provided, the message will be: "Please scan your card...". | ||
+ | - Real Time Clock | ||
+ | * Provides the current date and time for each access event. | ||
+ | - LEDs and Buzzer | ||
+ | * The red LED indicates the default state (door closed). | ||
+ | * The green LED and buzzer are activated when a valid card is detected. | ||
+ | * After a delay of 3 seconds, the system goes back to its default state. | ||
- | <note warning> | ||
- | O arhivă (sau mai multe dacă este cazul) cu fişierele obţinute în urma realizării proiectului: surse, scheme, etc. Un fişier README, un ChangeLog, un script de compilare şi copiere automată pe uC crează întotdeauna o impresie bună ;-). | ||
- | 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 Alin, 331CC -> **:pm:prj2009:cc:dumitru_alin**. | + | **Flow Overview** |
- | </note> | + | |
- | ===== Bibliografie/Resurse ===== | + | * System powers on, displays "System on..."/ "Please scan your card..." and waits for a card. |
+ | * When a RFID card is brought near the reader, it triggers an interrupt via IRQ. | ||
+ | * The cardInterrupt flag is set to true. | ||
+ | * In loop(), the card is read only when the flag is active, LEDs and buzzer are activated, the current time is retrieved from the RTC, the OLED displays the message and the timestamp | ||
+ | * After 3 seconds, the system resets. | ||
+ | |||
+ | For debug reasons, I also print the UID of the card and the message in the serial monitor. | ||
+ | |||
+ | Libraries used: SPI.h, Wire.h, MFRC522.h, RTClib.h, Adafruit_GFX.h, Adafruit_SSD1306.h. These libraries are used to enable communication between the Arduino and external modules such as the RFID reader, OLED display, and RTC clock. SPI.h is used for SPI communication with the RC522 module, Wire.h for I2C communication with the OLED and RTC, MFRC522.h for handling RFID card detection and reading, RTClib.h for accessing real-time data from the DS3231, and Adafruit_GFX.h along with Adafruit_SSD1306.h for displaying text and graphics on the OLED screen. | ||
+ | ===== Conclusions ===== | ||
+ | |||
+ | At first, I wasn’t very enthusiastic about this project because I had no clear idea how to build it and I was afraid I wouldn’t be able to complete it successfully. However, once I got started and broke the problem down into smaller steps, everything became more clear and manageable. I began to understand how each part works and how they connect together, and the process became more interesting and rewarding. I found myself enjoying the development more than I expected. | ||
+ | In the end, not only did I manage to complete the project, but I also learned a lot in the process and I’m genuinely proud of what I achieved. | ||
+ | |||
+ | ===== Download ===== | ||
- | <note> | + | {{:pm:prj2025:abirlica:proiect_pm.zip|}} |
- | Listă cu documente, datasheet-uri, resurse Internet folosite, eventual grupate pe **Resurse Software** şi **Resurse Hardware**. | + | ===== Resources ===== |
- | </note> | + | |
- | <html><a class="media mediafile mf_pdf" href="?do=export_pdf">Export to PDF</a></html> | + | I mainly searched on youtube to see how to connect different components or how different components work. |
+ | * https://www.youtube.com/watch?v=MfmK55TREuQ&t=112s | ||
+ | * https://www.diyengineers.com/2021/04/15/learn-how-to-read-an-rfid-tag-with-rc522-and-arduino/ | ||
+ | * https://github.com/miguelbalboa/rfid | ||
+ | * https://www.youtube.com/watch?v=pB49idXdPfY | ||