Skip to main content

RFID attendance system

 RFID Attendance System With SMS Notification



Hello viewers, welcome to my new project demonstration. The name of the project is an RFID based attendance system with SMS notifications. We can use this project for taking the students and office employee's attendance or when they join and leave the work. Nowadays it is the most popular experimental project among high school and college students. The key function of this project is when you put a tag on the RFID reader, it scans the tag, and the Arduino controller sends an SMS with help of the GSM module to the pre-defined number when you are joining or leaving. Let’s introduce with the circuit component what I am using for this project.

Component List:

  • RFID Tag 
  • RFID Reader
  • Buzzer
  • GSM Module
  • Capacitor
  • RTC Module
  • Arduino Nano
  • 16*2 LCD Display
  • Resistor
  • Printed PCB
  • Connecting wires
  • Battery
  • ISP Connector
  • Potentiometer
  • Voltage Regulator IC 7805

 This is RC522 13.56 MHz RFID reader, here is a buzzer at the top right corner, next in the top middle position sim800l GSM module and a capacitorwith value 10V 1000uf. The ds3231 RTC module is in the upper left corner. After that below the ds3231 module, it is an Arduino Nano board and a 16*2 LCD Display. Next to the power switch is a 10k ohm potentiometer. All the components I am soldering with a single side Vero board.

Procedure:

Step 1:

1) Add the ESP boards to the Arduino IDE.

2)Add the RFID library from Sketch--Include Library--Manages Libraries--search for (RFID)--then Install it.

3)After having the RFID-module wired to the nodeMCU like this:

 SDA --- D8

 SCK --- D5

 MOSI --- D7

 MISO --- D6

 IRQ --- Not connected

 GND --- GND

RST --- D3

3.3V --- 3.3V

connect it to the computer using a Micro USB.

4)Open the RFID_NodeMCU code and enter your WiFi setting(Name, Password) and your computer IP(you can know it from the command line by typing "ipconfig" then check ipv4), after that select the nodeMCU board from Tools--boards with the correct Port COM, and then upload it.

5)Open the serial monitor and set the baud rate to 115200 to check the connection status and the nodeMCU IP, save the IP(to put it in the server file "httpd.conf").

 step 2:

 1)Download the WampServer or xampp and install it.

 2)Run it.

3)If you're using WAMPServer 2.1: Click on wamp icon: Apache--httpd.conf--Add the nodeMCU IP to the permit list ( Allow from "nodeMCU IP")or try(Allow from all) next to this line: Allow from 127.0.0.1, then save it. while If you're using WAMPServer 3.0.6: Click on wamp icon: Apache--httpd-vhosts.conf--simply replace “Require local” with “Require all granted“ or "Require ip 192.168.xx.xx"(nodeMCU IP), then save it.

4)Click on wamp icon: Restart all services.

5)Click on wamp icon: www directory, then copy the website folder(login system folder) into it.

6)Click on wamp icon: localhost--login system--install.php(It should give you a success message, if not check the PHPMyAdmin password and username from (C:\wamp\apps\phpmyadmin3.3.9\config.inc.php) then put the password in (connectDB.php and install.php) pages.

7)Go to localhost/loginsystem/AddCard.php to add the users.

8)Then localhost/loginsystem/view.php to check the log. It should appear on the serial monitor these messages: for a new card or an available card: 200 successful "the cardID" and should the two LEDs blink for a login: 200 login "the cardID" and should the red LED turn on for a logout: 200 logout "the cardID" and should the blue LED turn on.

Connections And Circuit Diagram:


Now let’s discuss about the circuit schematic of this project. First of all LCD display, LCD display has 16 pins among them VSS, RW, and cathode pin is connect to the Arduino GND pin. The VDD pin is connected to the Arduino 5Vand the anode pin is also connected through a 330-ohm resistor. The potentiometer output pin is connected to the LCD V0 pin and the rest of potentiometer pins are connected to 5V and GND.LCD RS andE pins are connected to the Arduino digital pins 2 and 3. Next LCD D4, D5, D6, and D7 pins are connected to the Arduino digital pins 4 to 7 respectively. After that, the RFID module VCC pin is connected to the Arduino 3.3V pin. The RST and GND pin of RFID is connected tothe Arduino analog pin A0 and GND. Next the RFID module MISO, MOSI, and SCK pins must be connected to the Arduino digital pins 12, 11, and 13 respectively. The last pin SDA is connected to the Arduino digital pin 10. Now the sim 800l GSM module VCC and GND pins are connected to Arduino 5V and GND pins with a capacitor. Next the TX and RX pins are connected to the Arduino digital pins 8 and 9 respectively. Then RTC module GND pin is connected to the GND and VCC pin is connected to the 5v. RTC SDA pin is connected to the Arduino Analog Pin A4 and SCL pin is connected to Analog pin A5. The buzzer is connected to Arduino analog pin A1 and GND.

CODE:

Let’s see the code for this project. We need two different external libraries for RFID and DS3231. First of all, I include these libraries with Arduino IDE. Don’t worry about the library. The link of this library i have give below the link. You can easily download the library from the link. This is our source code for our project.

#include <ESP8266WiFi.h>     //Include Esp library

#include <SPI.h>

#include <MFRC522.h>        //include RFID library

#define SS_PIN D8 //RX slave select

#define RST_PIN D3

#define RedLed D1

#define BlueLed D2

MFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance.

/* Set these to your desired credentials. */

const char *ssid = "SSID";  //ENTER YOUR WIFI SETTINGS

const char *password = "password";

//Web/Server address to read/write from 

const char *host = "192.168.x.x";   //IP address of server

String getData ,Link;

String CardID="";

void setup() {

delay(1000);

Serial.begin(115200);

SPI.begin();  // Init SPI bus

mfrc522.PCD_Init(); // Init MFRC522 card

WiFi.mode(WIFI_OFF);        //Prevents reconnection issue (taking too long to connect)

delay(1000);

WiFi.mode(WIFI_STA);        //This line hides the viewing of ESP as wifi hotspot

WiFi.begin(ssid, password);     //Connect to your WiFi router

Serial.println("");

Serial.print("Connecting to ");

Serial.print(ssid);      // Wait for connection

while (WiFi.status() != WL_CONNECTED) {

delay(500);

Serial.print("."); }  //If connection successful show IP address in serial monitor

Serial.println("");

Serial.println("Connected");

Serial.print("IP address: ");

Serial.println(WiFi.localIP());  //IP address assigned to your ESP

pinMode(RedLed,OUTPUT);

pinMode(BlueLed,OUTPUT);}

void loop() {

  if(WiFi.status() != WL_CONNECTED){

    WiFi.disconnect();

    WiFi.mode(WIFI_STA);

    Serial.print("Reconnecting to ");

    Serial.println(ssid);

    WiFi.begin(ssid, password);

while (WiFi.status() != WL_CONNECTED) {

    delay(500);

    Serial.print("."); }

    Serial.println("");

    Serial.println("Connected");

    Serial.print("IP address: ");

    Serial.println(WiFi.localIP());  //IP address assigned to your ESP

 }//look for new card

   if ( ! mfrc522.PICC_IsNewCardPresent()) {

  return;//got to start of loop if there is no card present }   // Select one of the cards

 if ( ! mfrc522.PICC_ReadCardSerial()) {

  return;//if read card serial(0) returns 1, the uid struct contians the ID of the read card.

 }

for (byte i = 0; i < mfrc522.uid.size; i++) {

     CardID += mfrc522.uid.uidByte[i];

}

    HTTPClient http;    //Declare object of class HTTPClient          //GET Data

  getData = "?CardID=" + CardID;  //Note "?" added at front

  Link = "http://192.168.x.x/loginsystem/postdemo.php" + getData;

  http.begin(Link);

  int httpCode = http.GET();            //Send the request

  delay(10);

  String payload = http.getString();    //Get the response payload

  Serial.println(httpCode);   //Print HTTP return code

  Serial.println(payload);    //Print request response payload

  Serial.println(CardID);     //Print Card ID

  if(payload == "login"){

    digitalWrite(RedLed,HIGH);

    Serial.println("red on");

    delay(500);  //Post Data at every 5 seconds

  }

  else if(payload == "logout"){

    digitalWrite(BlueLed,HIGH);

    Serial.println("Blue on");

    delay(500);  //Post Data at every 5 seconds

  }

  else if(payload == "succesful" || payload == "Cardavailable"){

    digitalWrite(BlueLed,HIGH);

    digitalWrite(RedLed,HIGH);

    delay(500);  

  }

  delay(500);

 CardID = "";

  getData = "";

 Link = "";

 http.end();  //Close connection

   digitalWrite(RedLed,LOW);

  digitalWrite(BlueLed,LOW);

}


Conclusion:
 Here, I include five different header files. SPI.h and MFRC522.h for the RFID reader. LiquidCrystal.h for the LCD display and Software Serial.h for the serial communication between Arduino and GSM module. DS3231.h for the RTC Module. Initialize the Arduino pins that are connected with LCD and GSM module. Declare a string for which number you send the SMS notification. Here I declare five int types variables. Next define the buzzer pin and the RFID RST and SDA Pins. Create MFRC522 and DS3231 instance In the Setup Section I initialize the LCD, Serial monitor, GSM, RFID, and RTC. Set the buzzer pin as OUTPUT and print the welcome message to the LCD. Inside the loop function has two functions they are RTC() and RFID(). In the RTC function, these three lines are used to set the date and time. Next, I print a message to the LCD. If you want to display time and date on the LCD you uncomment these lines. Now see the RFID function, these lines are used to read a RFID tag and return the tag UID as hexadecimal number. I have five different UID tags for five different people. Here I compare the UID if the tag value match with the UID then buzzer gives a beep and LCD display shows details about the tag holder. Also, send an SMS notification to the default number.



Inside the send Kamal function first LCD display shows SMS Sending message. Then I set the GSM module in text mode. Next, send SMS to the number. Here you replace with your own message. Also, send time with the message. When state1 is 0 then sending the joining message and when state1 is 1 then sending the leave message. After that, I repeat it for the rest of the four people. Also, if RFID finds any unregister UID then LCD shows unknown access denied with a beep. Before upload the code please check the correct board and port option. After upload the code let’s see how the project is work. First of all, I check an RFID tag on the RFID reader. It working well and LCD shows the details about the RFID tag and GSM module send an SMS to the number. I received an SMS on my phone. Let's check the SMS, it shows the Kamal joining message. Now try the next tag, the tag is not register so it shows access dined. Next I try rest of the tag and they are registered. So GSM module sends the SMS to the number. After that, when I punch any card second time,it send different message. Thank you viewers for Visiting my Blog. 

Hope You Like This Blog And Please Share With Your Friends!!!

Comments

amazon banner

Popular posts from this blog

Motion Detector Camera

Motion Detector With Photo Capture Camera   Hello friends!! Welcome to This Blog. In this Blog, we will make a motion sensor detector with photo capture using ESP32CAM and the PIR module. The logic behind is when the PIR sensor detects any motion, the ESP32CAM will start taking the pictures. So you can use this project as a security camera. In thisblog, I will share the circuitdiagram, Arduino sketch, and the component list, so after reading the complete article you can easily make this project. Now ESP32 CAM is a small camera module that has ESP32S chip on the back and some GPIO pins to connect peripherals and it also has a micro-SD card slot, where you can insert the micro-SD card and store the pictures. Now before going to the circuit diagram and Arduino sketch, let me give you a quick overview of this project.  Components Required ESP32-CAM  PIR Motion Sensor Module BC547 NPN Transistor 220ohm, 1k, 10k Resistor. LED 5-mm FTDI 232 USB to Serial Interface board 5 volt DC supply  The

Bidirectional Visitor Counter

Bidirectional Visitor Counter using Arduino A bidirectional visitor counter using Arduino may be a reliable circuit that takes over the task of counting variety of Persons/Visitors within the Room very accurately. if somebody enters into the space then the Counter is incremented by one and also leaves it might be incremented. MATERIALS REQUIRED: Arduino IR Module 16*2 LED 5V Relay Resistor(1K,220 ohm) Breadboard Jumper Wires The total number of persons inside the space is Shows on the 16X2 LCD module. The microcontroller does the work it receives the signals from the sensors, and this signals operated under the control of software which is stored in EPROM of Arduino. There are two IR Modules are used. first, one are often wont to count the amount of persons entering a hall within the up mode at the doorway gate. and therefore the other can count the amount of persons leaving the hall by decrementing the count at the exit gate. In this Project will helps to Wastage of electricity. In ou

Obstacle Avoiding Robot

Obstacle Avoiding Robot using Arduino and Ultrasonic Sensor A simple project on Obstacle Avoiding Robot is meant here. Robotics is a stimulating and fast growing field. Being a branch of engineering, the applications of robotics are increasing with the advancement of technology.The concept of Mobile Robot is fast evolving and therefore the number of mobile robots and their complexities are increasing with different applications. There are many kind of mobile robot navigation techniques like path planning, self – localization and map interpreting. An Obstacle Avoiding Robot may be a sort of autonomous mobile robot that avoids collision with unexpected obstacles. In this project, an Obstacle Avoiding Robot is supposed. It's an Arduino based robot that uses Ultrasonic range finder sensors to avoid collisions.  Components Required Arduino NANO or Uno  🛒 HC-SR04 Ultrasonic Sensor  🛒 LM298N Motor Driver Module  🛒 5V DC Motors  🛒 Battery  🛒 Wheels 🛒 Chassis  🛒 Jumper Wires  🛒 Circ