The IoT based Entry and Exit Monitoring System is an RFID-based solution for tracking individuals entering and exiting a monitored area. Each person scans their unique RFID tag upon entry or exit, and the system records the action.
This information is displayed in real-time on a web server, indicating whether the individual is inside or has left the area, with color-coded markers (green for entry and red for exit). Additionally, the web page shows the total number of people currently inside the area.
Key Learnings
- RFID Technology: Utilizing RFID tags and readers for automatic identification and data capture.
- IoT Web Server: Setting up a web server on ESP32 to display live data, making the system accessible remotely.
- Real-time Monitoring: Capturing and displaying real-time entry and exit actions of individuals.
- Data Handling: Storing and managing multiple RFID tags and their statuses.
Bill of Material
Components | Description | Quantity |
IndusBoard | 3cm sized dev board | 1 |
Battery | 3.3V | 1 |
Round Display | SSD1306/ GC9A01 | 1 |
L89 GPS | GPS Module | 1 |
Use Case and Application
This system can be employed in various environments such as:
- Workplaces: Track employees entering and exiting offices.
- Events: Monitor the attendance of participants.
- Educational Institutions: Automate attendance monitoring of students.
The RFID-based IoT system is simple and efficient, providing a real-time overview of who is inside the monitored area, making it suitable for security and monitoring purposes.
Working Explanation
- When an RFID tag is scanned, the system checks if it is a new entry or a repeat scan.
- If it is a new entry, the system logs the time, marks it as “entered” with a green dot, and increases the counter of people inside.
- If the same RFID tag is scanned again, it is marked as “exited” with a red dot, and the counter is decreased.
- This data is displayed in real-time on a webpage, showing the current number of people inside and their entry/exit statuses.
Disclaimer!
This project is designed for educational purposes. For real-world deployment, please ensure proper security measures are taken, especially with sensitive data such as RFID tags linked to personal information. Use a test setup with limited funds or dummy data for verification before full implementation.
Code for IoT Entry and Exit Monitoring System
Explanation
- Libraries and Definitions: Includes necessary libraries for SPI, RFID communication, and web server functionalities. Defines pin assignments and user data.
- Setup Function: Initializes serial communication, SPI, MFRC522, and Wi-Fi. Sets up web server routes for the root URL and attendance page.
- Loop Function: Continuously checks for new RFID cards. Reads the UID, compares it to stored UIDs, and updates attendance records. If an RFID card matches, it updates the punch-in or punch-out time and sends an update message to the server.
- Web Server Handlers:
- handleRoot(): Serves a simple HTML page with a link to view attendance.
- handleAttendance(): Serves an HTML page with a table displaying the attendance records. CSS styles are used to format the table for better readability.
- getTime(): Provides the current date and time in the format “YYYY-MM-DD HH:MM
IoT based Entry and Exit Monitoring System – Circuit Connection
Now connect the RFID to SPI pins of the INDUSBoard Coin as per circuit diagram.
Testing
- Upload the Code: Use the Arduino IDE to upload the code to your IndusBoard Coin
- Connect to Wi-Fi: Ensure the ESP32 is connected to the Wi-Fi network.
- Access Web Server: Open a web browser and navigate to the IP address of the ESP32. You should see a page with a link to view attendance records.
- Scan RFID Cards: Test scanning the RFID cards and verify that the attendance records are updated correctly on the web page.
- Real-Time Updates: Refresh the attendance page to see real-time updates as you scan different RFID cards.
This project provides a practical introduction to IoT, web development, and RFID technology, allowing you to build a real-time attendance system with a modern web interface.