Project tutorial

Online Attendance System (Without Ethernet) © GPL3+

Online Attendance System using RFID Module and PHP&MYSQL Only. Utility for all type of attendance requirements.

  • 8 respects

Components and supplies

About this project

About this Project

This is a unique project in the world of Arduino for marking Online Attendance without using ethernet and GSM modules. We have developed this unique project to automate the attendance system for offices, schools and universities etc. using RFID RC522 Module and Arduino. For web support and API you need php and mysql. This project costs less than $10.

The purpose of this project is to remove tedious process of marking attendance manually.We've visited so many sites but no one has the solution for marking online attendance without using Ethernet or GSM Module, so we decided to develop our system without using these components which reduces our project costing.

How It Works?

The system can be connected to the computer through RS232 or Universal Serial Bus (USB) port and store the attendance taken inside database (MySQL).To view the recorded attendance, web interface is provided using PHP and HTML.

There are 2 types of RFID Tags. They are Passive RFID Tags and Active Tags.

Here, we are using Passive RFID Tags which contains 8 digit number tags inbuilt in it. RFID reader contains a copper winding in it. This winding acts as an antenna. When a person with RFID tag or transponder enters in the range of RFID reader, the RF field induces voltage in the coils of tag. The range can be set by using the appropriate reader of appropriate frequency. This induced field supplies the voltage in case of passive tags and act as a battery in that case.

Due to interaction of tag with reader 8 characters from tag are sent to controller. These 8 characters are sent to Arduino via serial communication.

Here, Processing software is used to communicate between Arduino and PHP Web Application .This processing software read the 8 characters at serial communication and matched with data stored in DB (MYSQL) by calling PHP Api. If it is matched then it is replied with valid user and attendance marked otherwise it is replied with not valid and no attendance marked (Reply from PHP API) on serial you can view the results (Processing output window).

Circuit and Programming


Installing XAMPP And Setting up Web Interface:

For web interface we require php installed in our system so firstly we need to install apache and mysql in our system for this install XAMPP using link (According to your os) , may be your'e not good with web programming so there is no need to worry about. Please follow steps in order to install XAMPP for php link: ( )

After installing XAMPP please start the xampp apache/mysql services from xampp control panel as described in tutorial of wikihow.

How to test xampp is working fine?

Open your browser and type:


you will see below screen if everything is fine otherwise please repeat above steps.

Now copy and paste the attendance zip folder in htdocs


copied folder will be used in PROCESSING code to call api through path specified and to show attendance data online.


Now open the mysql using browser:


Paste the mysql query code to create database and tables.

Now we're ready to run our web application :

http://localhost/(your folder name)/

Here you'll see image given below if everything is going fine:



Adding Users in Our DB:

1.Before login please copy and paste Arduino code.

2.Now run and upload Arduino code to device.

3. Please copy and paste the markattendance program into processing window(to mark attendance)

4. Please copy and paste the add_user program into processing window by creating new file in processing software because we have different module to add users.

5. open processing and run add_user program it will show you a message to approximate your card so please approximate your card to RFID after this you'll see the UID Code and a user name box so please enter name of the user related to this UID (RFID TAG) store information to web then press add user button.


you've Added a new in user.

Now run our php code :

After Login as we've logged in before :

So this is overall information about our project please grab as you want.

Please shout in comment box if you have any query.


Please make given below circuit using RFID and Arduino Uno
Rfid circuit dig 0ww0qikaqk


Arduino codeArduino
This code used to read user 8 Digit UID (ID CARD) and print on serial printer and to send it to processing.
/*Created by: Anshul Pareek
 * --------------------------------------------------------------------------------------------------------------------
 * Example sketch/program showing how to read new NUID from a PICC to serial.
 * --------------------------------------------------------------------------------------------------------------------
 * This is a MFRC522 library example; for further details and other examples see:
 * Example sketch/program showing how to the read data from a PICC (that is: a RFID Tag or Card) using a MFRC522 based RFID
 * Reader on the Arduino SPI interface.
 * When the Arduino and the MFRC522 module are connected (see the pin layout below), load this sketch into Arduino IDE
 * then verify/compile and upload it. To see the output: use Tools, Serial Monitor of the IDE (hit Ctrl+Shft+M). When
 * you present a PICC (that is: a RFID Tag or Card) at reading distance of the MFRC522 Reader/PCD, the serial output
 * will show the type, and the NUID if a new card has been detected. Note: you may see "Timeout in communication" messages
 * when removing the PICC from reading distance too early.
 * @license Released into the public domain.
 * Typical pin layout used:
 * -----------------------------------------------------------------------------------------
 *             MFRC522      Arduino       Arduino   Arduino    Arduino          Arduino
 *             Reader/PCD   Uno/101       Mega      Nano v3    Leonardo/Micro   Pro Micro
 * Signal      Pin          Pin           Pin       Pin        Pin              Pin
 * -----------------------------------------------------------------------------------------
 * RST/Reset   RST          9             5         D9         RESET/ICSP-5     RST
 * SPI SS      SDA(SS)      10            53        D10        10               10
 * SPI MOSI    MOSI         11 / ICSP-4   51        D11        ICSP-4           16
 * SPI MISO    MISO         12 / ICSP-1   50        D12        ICSP-1           14
 * SPI SCK     SCK          13 / ICSP-3   52        D13        ICSP-3           15

#include <SPI.h>
#include <MFRC522.h>

#define SS_PIN 10
#define RST_PIN 9
MFRC522 rfid(SS_PIN, RST_PIN); // Instance of the class

MFRC522::MIFARE_Key key; 

// Init array that will store new NUID 
byte nuidPICC[4];

void setup() { 
  SPI.begin(); // Init SPI bus
  rfid.PCD_Init(); // Init MFRC522 

  for (byte i = 0; i < 6; i++) {
    key.keyByte[i] = 0xFF;

void loop() {

  // Look for new cards
  if ( ! rfid.PICC_IsNewCardPresent())

  // Verify if the NUID has been readed
  if ( ! rfid.PICC_ReadCardSerial())

  MFRC522::PICC_Type piccType = rfid.PICC_GetType(rfid.uid.sak);

  // Check is the PICC of Classic MIFARE type
  if (piccType != MFRC522::PICC_TYPE_MIFARE_MINI &&  
    piccType != MFRC522::PICC_TYPE_MIFARE_1K &&
    piccType != MFRC522::PICC_TYPE_MIFARE_4K) {
    //Serial.println(F("Your tag is not of type MIFARE Classic."));
 String s;
    for (byte i = 0; i < 4; i++) {
      nuidPICC[i] = rfid.uid.uidByte[i];

    printHex(rfid.uid.uidByte, rfid.uid.size);
  // Halt PICC

  // Stop encryption on PCD

 * Helper routine to dump a byte array as hex values to Serial. 
void printHex(byte *buffer, byte bufferSize) {
  for (byte i = 0; i < bufferSize; i++) {
    Serial.print(buffer[i] < 0x10 ? "0" : "");
    Serial.print(buffer[i], HEX);

 * Helper routine to dump a byte array as dec values to Serial.
void printDec(byte *buffer, byte bufferSize) {
  for (byte i = 0; i < bufferSize; i++) {
    Serial.print(buffer[i] < 0x10 ? "0" : "");
    Serial.print(buffer[i], DEC);
Upload this code in processing and run when we need to mark attendance after adding user successfully!
No preview (download only).
This is different module so please add new file and upload this code it will show you two files which are used in creating form.
No preview (download only).
This is php code so please put it inside xampp>htdocs with same name if you are new with php and web programming.
No preview (download only).
please copy and paste this code in php mysql
-- phpMyAdmin SQL Dump
-- version 4.5.2
-- Host: localhost
-- Generation Time: Oct 19, 2017 at 09:42 PM
-- Server version: 10.1.13-MariaDB
-- PHP Version: 5.5.35

SET time_zone = "+00:00";

-- Database: `attendance`

-- --------------------------------------------------------

-- Table structure for table `tbl_attendance`

CREATE TABLE `tbl_attendance` (
  `att_id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `rfid_uid` varchar(255) NOT NULL,
  `created` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'

-- Indexes for dumped tables

-- Indexes for table `tbl_attendance`
ALTER TABLE `tbl_attendance`
  ADD PRIMARY KEY (`att_id`);

-- AUTO_INCREMENT for dumped tables

-- AUTO_INCREMENT for table `tbl_attendance`
ALTER TABLE `tbl_attendance`


Team gadgetprogrammer

  • 1 project

Additional contributors

  • Developed documentation for this project and helping in my electronic concepts by Neetu

Published on

October 17, 2017

Members who respect this project

1061999DefaultAdambenz21765226 1579407528783518 5753079706324423939 n12540590 741555235974555 3535889509737692135 n u3tbvajh6hPhoto

and 2 others

See similar projects
you might like

Similar projects you might like

Windows PC Lock/Unlock Using RFID

Project tutorial by Prasanth K S

  • 30 respects

Makers (Cubecon) #1 Infrared Transmit & Infrared Receive

Project in progress by Alpha

  • 4 respects

Digital Clock With Mirrored Display Driven by Accelerometers

Project tutorial by LAGSILVA

  • 3 respects

Lie Detector

Project tutorial by Adaline Baskaran

  • 16 respects
Add projectSign up / Login