Arduino Smart Classroom Series: Attendance System (RTC + LCD + Keypad + SD Backup)
Arduino Smart Classroom Attendance System (RTC + LCD + Keypad + SD Backup)
Welcome to the Arduino Smart Classroom Series! 🎓📚 In this project, we build a Smart Attendance System for classrooms. Students mark their attendance using a 4x4 keypad. Data is stored in EEPROM and backed up weekly to an SD card. The system features a 16x2 LCD display for live feedback and allows easy future modifications. Perfect for educators, tech enthusiasts, and makers looking to automate attendance tracking and gain insights into classroom participation!
Table of Contents
- Introduction
- Required Hardware
- Arduino IDE Setup
- Wiring the Components
- Arduino Code
- How It Works
- Testing Your Project
- Advanced Modifications
- Common Issues and Troubleshooting
- Learning Insights
- Classroom Applications and Benefits
- Conclusion
1. Introduction
Maintaining attendance in classrooms has always been a tedious task. Teachers often struggle to record accurate attendance, wasting time and facing human errors. With the power of Arduino, we can automate attendance while providing real-time feedback. This Smart Classroom Attendance System is designed for modern classrooms, integrating a keypad for student input, EEPROM storage for local data persistence, SD card backups for long-term records, an RTC module for date/time tracking, and an LCD for immediate feedback.
The main goal is to create a system that is:
- Reliable and accurate
- Easy to use for both students and teachers
- Expandable for future smart classroom applications
- Educational, allowing students to learn electronics, programming, and data management
This system is suitable for schools, coaching centers, and workshops. It also introduces students and hobbyists to data storage, microcontroller programming, and interfacing multiple devices like LCDs, keypads, SD modules, and RTCs.
2. Required Hardware
- Arduino Uno (~₹500)
- 4x4 Keypad Module (~₹150)
- 16x2 I2C LCD (~₹200)
- SD Card Module (~₹250)
- Real-Time Clock (RTC) Module DS3231 (~₹150)
- Resistors, jumper wires, and breadboard (~₹100)
- MicroSD card (8GB or 16GB recommended)
- Arduino IDE installed on your PC
3. Arduino IDE Setup
To get started, follow these steps:
- Install Arduino IDE from the official Arduino website. Make sure to install the latest version compatible with your operating system.
- Connect Arduino Uno to your PC using a USB cable. Ensure the drivers are installed correctly so the IDE recognizes the board.
- Go to Tools → Board → Arduino Uno.
- Select the correct COM port under Tools → Port.
- Install the following libraries via Library Manager:
- Keypad.h – for reading matrix keypad inputs.
- Wire.h – for I2C communication.
- LiquidCrystal_I2C.h – for controlling the LCD.
- SD.h – for SD card interactions.
- RTClib.h – for Real-Time Clock module support.
- Restart the IDE after installing libraries to ensure they are recognized correctly.
4. Wiring the Components
Wiring is critical for this project. Follow the connections carefully:
- Keypad rows to Arduino pins 2,3,4,5; columns to pins 6,7,8,9.
- LCD: SDA → A4, SCL → A5, VCC → 5V, GND → GND.
- SD Module: CS → D10, MOSI → D11, MISO → D12, SCK → D13, VCC → 5V, GND → GND.
- RTC: SDA → A4, SCL → A5, VCC → 5V, GND → GND.
Use a breadboard for secure connections, and ensure all I2C devices (LCD and RTC) share the same 5V and GND lines. Check that the SD card module is properly powered.
5. Arduino Code
Upload the following code. This version stores attendance in EEPROM and backs up weekly to the SD card. The LCD provides live updates, and the keypad registers student IDs.
#include <Keypad.h> #include <Wire.h> #include <LiquidCrystal_I2C.h> #include <EEPROM.h> #include <SD.h> #include <RTClib.h> #define NUM_STUDENTS 20 #define SD_CS 10 LiquidCrystal_I2C lcd(0x27,16,2); RTC_DS3231 rtc; // Keypad setup const byte ROWS = 4; const byte COLS = 4; char keys[ROWS][COLS] = { {'1','2','3','A'}, {'4','5','6','B'}, {'7','8','9','C'}, {'*','0','#','D'} }; byte rowPins[ROWS] = {2,3,4,5}; byte colPins[COLS] = {6,7,8,9}; Keypad keypad = Keypad(makeKeymap(keys), rowPins, colPins, ROWS, COLS); void setup() { lcd.init(); lcd.backlight(); Serial.begin(9600); if(!SD.begin(SD_CS)) lcd.print("SD init fail"); if(!rtc.begin()) { lcd.setCursor(0,0); lcd.print("RTC missing"); while(1); } lcd.setCursor(0,0); lcd.print("Attendance Ready"); delay(2000); } void loop() { char key = keypad.getKey(); if(key){ int studentID = key - '0'; if(studentID > 0 && studentID <= NUM_STUDENTS){ EEPROM.write(studentID-1, 1); lcd.clear(); lcd.setCursor(0,0); lcd.print("ID "); lcd.print(studentID); lcd.print(" Present"); } } if(key == '#'){ // Backup trigger File dataFile = SD.open("attendance.txt", FILE_WRITE); if(dataFile){ for(int i=0;i<NUM_STUDENTS;i++){ int val = EEPROM.read(i); dataFile.print("Student "); dataFile.print(i+1); dataFile.print(": "); dataFile.println(val); } dataFile.close(); lcd.clear(); lcd.setCursor(0,0); lcd.print("Backup Complete"); } else { lcd.clear(); lcd.setCursor(0,0); lcd.print("SD Write Error"); } } }
6. How It Works
When a student presses a key corresponding to their ID, the system records attendance in EEPROM. The LCD confirms the student is marked present. Pressing '#' writes all data to the SD card, creating a permanent backup. The RTC ensures accurate time tracking for weekly or monthly reports. This system can be expanded to send notifications, integrate with school software, or add security features.
7. Testing Your Project
- Power the Arduino, check LCD initialization.
- Press a keypad number to mark attendance; verify LCD feedback.
- Press '#' to backup data to SD; check the file on the card.
- Repeat for multiple students to ensure accuracy.
8. Advanced Modifications
- ESP32/Wi-Fi module to send attendance online.
- Automated backup using RTC trigger.
- RFID integration instead of keypad.
- Multiple classrooms with centralized database.
- Web dashboard with real-time attendance charts.
9. Common Issues and Troubleshooting
- EEPROM not updating: Check write bounds.
- SD card not detected: Verify wiring.
- LCD blank: Confirm I2C address.
- Keypad unresponsive: Check wiring and keymap.
10. Learning Insights
- EEPROM memory management.
- Keypad matrix scanning.
- SD card file handling.
- RTC utilization.
- LCD display techniques.
- System integration for real-world applications.
11. Classroom Applications and Benefits
This system automates attendance, reduces errors, and saves teacher time. Students get immediate feedback. Data is backed up for accountability and can be integrated into school reports. Expanding with Wi-Fi allows remote access, analytics, and notifications, making classrooms smarter, safer, and more efficient.
12. Conclusion
The Smart Classroom Attendance System combines Arduino, keypad input, EEPROM storage, SD backup, RTC, and LCD display into a practical educational tool. It is perfect for classrooms, coaching centers, or hobby projects. It teaches programming, electronics, data management, and system design. Next in the series: Smart Classroom Notification and Alert System, which integrates Wi-Fi notifications and real-time reporting!
By Kaushal Haladi
Comments
Post a Comment