This shows you the differences between two versions of the page.
iothings:proiecte:2025sric:rfidscanner [2025/05/28 23:20] flaviu.ghena |
iothings:proiecte:2025sric:rfidscanner [2025/05/29 10:07] (current) flaviu.ghena |
||
---|---|---|---|
Line 22: | Line 22: | ||
===== Hardware Description ===== | ===== Hardware Description ===== | ||
- | Parts List: | + | {{:iothings:proiecte:2025sric:flaviu4.jpg?600|}} |
- | ESP32-WROOM-32: Main microcontroller for processing and connectivity. | + | |
- | RFID-RC522 Module: Reads RFID card UIDs. | + | |
- | Green LED: Indicates authorized access. | + | |
- | Red LED: Indicates denied access. | + | |
- | Resistors (2x): Current-limiting resistors for LEDs | + | |
- | Breadboard/Jumper Wires: For prototyping connections. | + | |
- | Power Supply: 3.3V for ESP32 and RC522. | + | |
- | ESP32-WROOM-32: | + | **Parts List:** |
- | - Connects to WiFi for cloud communication. | + | * ESP32-WROOM-32: Main microcontroller for processing and connectivity. |
- | - Interfaces with the RC522 via SPI (GPIO 5, 18, 19, 23). | + | * RFID-RC522 Module: Reads RFID card UIDs. |
- | - Controls LEDs via GPIO 25 (green) and 26 (red). | + | * Green LED: Indicates authorized access. |
+ | * Red LED: Indicates denied access. | ||
+ | * Resistors (2x): Current-limiting resistors for LEDs | ||
+ | * Breadboard/Jumper Wires: For prototyping connections. | ||
+ | * Power Supply: 3.3V for ESP32 and RC522. | ||
- | RFID-RC522: | + | **ESP32-WROOM-32:** \\ |
- | - Communicates with ESP32 via SPI pins. | + | - Connects to WiFi for cloud communication.\\ |
- | - Powered by 3.3V | + | - Interfaces with the RC522 via SPI (GPIO 5, 18, 19, 23).\\ |
- | - Antenna gain boosted for better sensitivity. | + | - Controls LEDs via GPIO 25 (green) and 26 (red).\\ |
- | LEDs: | + | **RFID-RC522:** \\ |
- | - Green LED: Activated for valid cards or manual "grant" commands. | + | - Communicates with ESP32 via SPI pins.\\ |
- | - Red LED: Activated for invalid cards or manual "deny" commands. | + | - Powered by 3.3V \\ |
+ | - Antenna gain boosted for better sensitivity.\\ | ||
+ | **LEDs:** \\ | ||
+ | - Green LED: Activated for valid cards or manual "grant" commands.\\ | ||
+ | - Red LED: Activated for invalid cards or manual "deny" commands.\\ | ||
+ | |||
+ | {{:iothings:proiecte:2025sric:flaviu3.png?600|}} | ||
===== Functionality Breakdown ===== | ===== Functionality Breakdown ===== | ||
- | Key Components Explained | + | **Key Components** |
+ | |||
+ | **RFID Handling:** | ||
+ | - The MFRC522 library interfaces with the RFID reader\\ | ||
+ | - Cards are identified by their UID and converted to decimal format\\ | ||
+ | - Reader automatically resets after periods of inactivity\\ | ||
+ | |||
+ | **Access Control Logic:** | ||
+ | - Compares scanned card IDs against authorized list\\ | ||
+ | - Provides immediate visual feedback via LEDs\\ | ||
+ | - Green LED for authorized access, red for denied\\ | ||
+ | |||
+ | **Firebase Integration:** | ||
+ | - Stores all access events with timestamps\\ | ||
+ | - Allows remote control via the ledControl path\\ | ||
+ | - Uses anonymous authentication for security\\ | ||
+ | |||
+ | **Realtime Database rules** | ||
+ | <code> | ||
+ | { | ||
+ | "rules": { | ||
+ | "rfidSystem": { | ||
+ | "control": { | ||
+ | ".read": true, | ||
+ | ".write": true | ||
+ | }, | ||
+ | "logs": { | ||
+ | ".read": true, | ||
+ | ".write": true | ||
+ | }, | ||
+ | "ledControl": { | ||
+ | ".read": true, | ||
+ | ".write": true | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | </code> | ||
+ | |||
+ | {{:iothings:proiecte:2025sric:flaviu6.png?300|}} | ||
+ | |||
+ | **Telegram Notifications:** | ||
+ | - Sends instant alerts for all access attempts\\ | ||
+ | - Differentiates between authorized and unauthorized access\\ | ||
+ | - Includes system startup notification\\ | ||
+ | |||
+ | {{:iothings:proiecte:2025sric:flaviu2.jpeg?250|}} | ||
+ | |||
+ | |||
+ | **Web Interface:** | ||
+ | - Provides real-time access logs display\\ | ||
+ | - Allows manual access control via buttons\\ | ||
+ | - Shows system connection status\\ | ||
+ | - The system combines local hardware control with cloud connectivity for a comprehensive access control solution with remote monitoring capabilities.\\ | ||
+ | |||
+ | **Error Handling:** | ||
+ | - Auto-resets RFID reader if inactive.\\ | ||
+ | - Reconnects to WiFi/Firebase if disconnected.\\ | ||
- | RFID Handling: | + | ^ RC522 Pin ^ ESP32 Pin ^ |
- | - The MFRC522 library interfaces with the RFID reader | + | | SDA | GPIO 5 | |
- | - Cards are identified by their UID and converted to decimal format | + | | SCK | GPIO 18 | |
- | - Reader automatically resets after periods of inactivity | + | | MOSI | GPIO 23 | |
+ | | MISO | GPIO 19 | | ||
+ | | IRQ | Not connected | | ||
+ | | GND | GND | | ||
+ | | RST | GPIO 22 | | ||
+ | | 3.3V | 3.3V | | ||
- | Access Control Logic: | + | ^ LED Pin ^ ESP32 Pin ^ |
- | - Compares scanned card IDs against authorized list | + | | GREEN LED PIN | GPIO 25 | |
- | - Provides immediate visual feedback via LEDs | + | | RED LED PIN | GPIO 26 | |
- | - Green LED for authorized access, red for denied | + | |
- | Firebase Integration: | + | {{:iothings:proiecte:2025sric:flaviu1.png?600|}} |
- | - Stores all access events with timestamps | + | |
- | - Allows remote control via the ledControl path | + | |
- | - Uses anonymous authentication for security | + | |
- | Telegram Notifications: | ||
- | - Sends instant alerts for all access attempts | ||
- | - Differentiates between authorized and unauthorized access | ||
- | - Includes system startup notification | ||
- | Web Interface: | ||
- | - Provides real-time access logs display | ||
- | - Allows manual access control via buttons | ||
- | - Shows system connection status | ||
- | - The system combines local hardware control with cloud connectivity for a comprehensive access control solution with remote monitoring capabilities. | ||
- | Error Handling: | ||
- | - Auto-resets RFID reader if inactive. | ||
- | - Reconnects to WiFi/Firebase if disconnected. | ||
===== Code Breakdown ===== | ===== Code Breakdown ===== | ||
Line 398: | Line 448: | ||
===== Webpage ===== | ===== Webpage ===== | ||
+ | |||
+ | {{:iothings:proiecte:2025sric:flaviu5.png?600|}} | ||
+ | |||
<code> | <code> | ||
<!DOCTYPE html> | <!DOCTYPE html> | ||
Line 551: | Line 604: | ||
- Future enhancements could include adding biometric verification or integrating with physical locks. | - Future enhancements could include adding biometric verification or integrating with physical locks. | ||
+ | ===== Demo ===== | ||
+ | |||
+ | <html><iframe width="456" height="811" src="https://www.youtube.com/embed/BdYKw6g49gY" title="RFID22" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe></html> | ||
+ | |||
+ | <html><iframe width="456" height="811" src="https://www.youtube.com/embed/UwR_TnAOcD8" title="RFID11" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe></html> | ||
===== References ===== | ===== References ===== | ||
[1] https://randomnerdtutorials.com/control-esp-gpios-firebase-web-app/ \\ | [1] https://randomnerdtutorials.com/control-esp-gpios-firebase-web-app/ \\ | ||
[2] https://randomnerdtutorials.com/esp32-door-status-telegram/ | [2] https://randomnerdtutorials.com/esp32-door-status-telegram/ |