This project is an RFID-based attendance system using an Arduino UNO, MFRC522 RFID module, I2C LCD display, and Python script for logging attendance data in a MySQL database. The system allows users to sign in and out by scanning their RFID cards, and the attendance data is stored in the MySQL database.
- Arduino UNO
- MFRC522 RFID module
- I2C LCD display (16x2)
- Buzzer
- LEDs (Green and Red)
- Breadboard
- Jumper wires
- Arduino IDE
- Python 3.x
- MySQL Database (e.g., MySQL Server, XAMPP, or WAMP)
- Python libraries:
pyserial,mysql-connector-python
- Install the Arduino IDE from the official website.
- Install Python 3.x from the official website.
- Install a MySQL database server. You can use MySQL Server, XAMPP, or WAMP.
- Install the required Python libraries using pip: pip install pyserial mysql-connector-python
- Clone or download this repository to your local machine.
- Connect the MFRC522 RFID module, I2C LCD display, buzzer, and LEDs to the Arduino UNO according to the pin definitions in the
arduino.inofile. - Connect the Arduino UNO to your computer using a USB cable.
- Open the
arduino.inofile in the Arduino IDE and upload the code to the Arduino UNO. - Create a new MySQL database named
db_arduinoand import thedb_arduino.sqlfile provided in the repository. - Open the
Arduino.pyfile in a text editor and update the MySQL database connection credentials (host, user, and password) to match your setup. - Update the
ser = serial.Serial('COM3', 9600)line in theArduino.pyfile to match the serial port of your Arduino UNO. You can find the correct port in the Arduino IDE under Tools > Port.
- Run the Python script (make sure that you already uploaded the Code to the arduino after that Close any Serial Port that was open or else it wont open)
Arduino.py: python Arduino.py - Scan an RFID card with the MFRC522 RFID module. The user's name and attendance status (Signed In, Signed Out, or Expired) will be displayed on the I2C LCD display.
- The attendance data will be logged in the MySQL database, and you can view the attendance records in the
students,signin, andsignouttables.
You can customize the RFID card UIDs and corresponding names in the Arduino.py file by modifying the following lines:
if uid == '43B4C495':
name = 'John Miles'
elif uid == '81934043':
name = 'Mike Kaze'
elif uid == '63B001A6':
name = 'Fujiwara Kaede'
else:
name = 'Unknown'
Replace the example UIDs with your own RFID card UIDs and update the names accordingly.
