IOT Based Dormitory Attendance System
Revolutionizing dormitory attendance with Face Recognition and IoT Technologies
Learn MoreIntroduction
Project Introduction
Manual attendance management in dormitories is a time-consuming and tedious task. Traditional methods, including contact-based biometrics like fingerprints or cards, pose health risks, especially in situations like the COVID-19 pandemic. To address these challenges, our project introduces an IoT-based smart attendance system utilizing a Face Recognition module.
The system employs an ESP32 Cam to authenticate individuals. Upon enrollment, student information (ID, name, class, etc.) is captured. When a student approaches the ESP32 Cam, it automatically detects, recognizes, and stores their attendance data in an IoT cloud via HTTPS. Unauthorized access is prevented, and a buzzer alerts staff to invalid entries, effectively resolving proxy issues and enhancing security.
Compare and Contrast with Existing System
The current dormitory system relies on manual attendance, which is inefficient and prone to errors. Our IoT-based solution offers a significant upgrade by automating the entire process. Unlike traditional analogue systems, our proposed system provides real-time, accurate, and contact-free attendance tracking.
Existing systems often involve long queues or physical contact, which our face recognition approach eliminates. This not only saves time but also improves hygiene and security by preventing unauthorized entries and proxy attendance.
System Overview
General Design
The smart attendance system operates in several stages:
- Registration: Students register by filling out a form. An operator enters this data into a computer and records the student's image via an ESP32 module at the Registration Node. This data is then sent to the server and saved in the database.
- Dormitory Entry (Initial): When students first enter the dormitory, attendance is taken using face recognition at the Camera Node. This attendance data is sent from the Camera Node through the ThingSpeak cloud to the Server.
- Dormitory Entry (Before 11:00 PM): If students enter before 11:00 PM, attendance is again recorded via the Camera Node, and the data is sent through the Cloud (ThingSpeak) to the Server.
Concept of Operation & Use Case Diagram
The system continuously tracks student attendance, providing a robust solution to existing management problems. The use case diagram illustrates the interactions between the system and its actors:
- Register: Dorm managers/staff register students and teachers.
- Record Attendance: Staff record attendance using identification numbers and save to the database.
- View Records: Staff, students, teachers, and parents can view attendance details (with appropriate permissions).
- Generate Report: Staff can generate reports for teachers and students.

Components & Technologies
ESP32 Camera Module
A compact Wi-Fi and Bluetooth module with an OV2640 2MP camera, ideal for IoT applications and face recognition. It features low power consumption and a microSD card slot for storage.

Key for face detection and image capture.
Arduino Mega 2560
A microcontroller board based on ATmega2560, providing numerous digital I/O pins and analog inputs. It interfaces with the ESP32 Cam and other modules.

Central control unit for the system.
GSM SIM800L Module
A miniature GSM modem for GPRS transmission, sending/receiving SMS, and making/receiving calls. Used for sending attendance alerts to parents and dorm managers.

Enables communication for alerts.
Display & Alert Components

Liquid Crystal Display (LCD)
An electronically-modulated optical device used to display current date, time, and student attendance status (name, present/absent).
Provides real-time visual feedback.
DS3231 Real Time Clock (RTC)
A highly accurate I2C real-time clock module with a built-in temperature sensor, ensuring precise timekeeping for attendance records.
Maintains accurate time for records.
Buzzer
An active electromagnetic buzzer used to generate an audible alert when an unauthorized person is detected by the ESP32 Cam.
Provides immediate security alerts.
Software & Algorithms: OpenCV & LBPH
The system leverages OpenCV (Open Source Computer Vision Library) for image processing and face detection. The Local Binary Patterns Histogram (LBPH) algorithm is used for face recognition due to its simplicity and efficiency, making it suitable for the ESP32 Cam's processing capabilities. This algorithm analyzes images locally, converts regions into LBPH matrices, and compares histograms to identify individuals.
System Architecture
Our system follows a layered architecture, ensuring robust data flow and functionality.
Layered Architecture
- Perception Layer: Consists of sensors (camera, ESP32), transmitters, actuators, and controllers. It defines the system's environment, capturing student images and collecting data.
- Network Layer: Responsible for forwarding collected data from objects to the next layer without interpretation. It handles data transmission, filtering, and aggregation using technologies like Wi-Fi.
- Middleware Layer: Manages data storage from the perception layer. It includes a web server and database that handle queries from authorized personnel via the web application.
- Application Layer: Performs data management and resource discovery. It provides interfaces for hardware resource utilization, using IoT protocols like HTTP and HTTPS for message transfer.

Flowchart of the Proposed System
The system ensures student privacy by allowing only the System Admin to log in. It is designed for ease of use, requiring minimal training. Key services include:
- Registration Service: Admin staff handle person entry, creating usernames and passwords for system access.
- Data Visualization: Users can view permitted records; parents, for instance, can only see their children's attendance.
- Data Management: The admin is responsible for managing and filtering student and faculty data.

Data Management
Database & Data Dictionary
Our system utilizes a MongoDB database for storing and managing attendance records. The conceptual database tables are designed to capture all necessary information, ensuring data integrity and accessibility.
Student Data Dictionary
Field Name | Description | Type | Length |
---|---|---|---|
STD_ID (pk) | Student ID number | Int | 11 |
STD_FNAME | First name | Varchar | 30 |
STD_LNAME | Last name | Varchar | 30 |
STD_ADDRESS | Address | Varchar | 50 |
STD_YEAR | Year Level | Varchar | 10 |
STD_SECTION | Section | Varchar | 10 |
STD_BIRTHDAY | Date of Birth | Varchar | 30 |
STD_AGE | Age | Int | 3 |
STD_GENDER | Gender | Varchar | 10 |
STD_CONTACT | Student Contact Number | Varchar | 30 |
Student Attendance Data Dictionary
Field Name | Description | Type | Length |
---|---|---|---|
SATT_ID (pk) | Student Attendance ID | Int | 11 |
STD_ID (fk) | Student ID number | Int | 11 |
SATT_DATE | Attendance date | Varchar | 30 |
SATT_AM_IN | Am Login | Varchar | 10 |
SATT_AM_OUT | Am Logout | Varchar | 10 |
SATT_PM_IN | Pm Login | Varchar | 10 |
SATT_PM_OUT | Pm Logout | Varchar | 10 |
MongoDB Database Implementation
The system leverages MongoDB, a NoSQL document database, for storing and managing all attendance data. MongoDB's flexible document structure makes it ideal for handling student information, attendance records, and system logs efficiently.
- Scalability: MongoDB's horizontal scaling capabilities ensure the system can handle growing student populations.
- Real-time Data: Supports real-time data insertion and retrieval for immediate attendance tracking.
- JSON-like Documents: Natural fit for IoT data structures and web application integration.
- High Availability: Built-in replication ensures data redundancy and system reliability.

MongoDB database interface showing collections and document structure
Results and Discussion
Real-time Attendance Display
Before a student approaches the ESP32 Cam, the LCD displays the current date and time. Once a student's face is detected and recognized, their name, the current date, and "Present" are displayed on the LCD, providing immediate confirmation. This data is also stored in the cloud for later access by authorized personnel.

Automated Absentee Alerts
If a student is marked absent after a specified time or at the end of the day, this information is updated in the cloud. An emergency SMS alert is then automatically sent to their respective parents and the dormitory manager, ensuring timely notification of absences.

Dorm Manager Web View
The dormitory manager has access to a web interface that allows them to view student attendance reports. This interface provides a comprehensive overview of attendance records, enabling efficient monitoring and management.

Conclusion & Future Scope
Conclusion
We have successfully designed and prototyped an IoT-based dormitory attendance system using face recognition, aiming to replace the existing manual methods. This system effectively automates attendance tracking, enhances security, and provides timely alerts, addressing the limitations of traditional approaches. While this prototype demonstrates significant potential, we acknowledge that there is ample room for further development and refinement.
Future Scopes
The potential of this project extends far beyond its current application. Future enhancements could include:
- Developing a dedicated Android application for enhanced user interaction.
- Building a comprehensive database system for robust data management.
- Integrating additional sensors to make the system more versatile.
- Designing a portable hardware device with a door accessing method.
- Adding a keypad for password verification after card scanning.
- Implementing separate interfaces for students to view their attendance.
- Extending its application to sensitive environments like banking sectors.