RFID attendance system review in tamil
this video is my 100th video in youtube
to get my app click here
before uploading change the uid code of the your RFID tag...
then upload that code
coding for that video
/*
PINOUT:
RC522 MODULE Uno/Nano MEGA
SDA D10 D9
SCK D13 D52
MOSI D11 D51
MISO D12 D50
IRQ N/A N/A
GND GND GND
RST D9 D8
3.3V 3.3V 3.3V
*/
/* Include the standard Arduino SPI library */
#include <SPI.h>
/* Include the RFID library */
#include <MFRC522.h>
#include <LiquidCrystal.h>
LiquidCrystal lcd(2,3,4,5,6,7);//rs,e,d0,d1,d2,d3
String rfid = "";
bool id1 = false;
bool id2 = false;
int successRead;
/* Define the DIO used for the SDA (SS) and RST (reset) pins. */
#define SDA_DIO 10
#define RESET_DIO 9
/* Create an instance of the RFID library */
MFRC522 mfrc522(SDA_DIO, RESET_DIO);
void setup()
{
Serial.begin(9600);
/* Enable the SPI interface */
SPI.begin();
lcd.begin(16,2);
mfrc522.PCD_Init();
Serial.println("RFID CARD SETUP");
}
void loop()
{
do{
successRead = getID();
}
while (!successRead);
if (rfid == "9D 22 B5 2D")//for card
{
id1 = !id1;
if(id1 == true)
{
Serial.println("STUDENT 1,1");
lcd.print("STUDENT 1");
lcd.setCursor(0,1);
lcd.print("welcome");
}
else if(id1 == false)
{
Serial.println("STUDENT 1,0");
lcd.print("STUDENT 1");
lcd.setCursor(0,1);
lcd.print("thank you");
}
}
if (rfid == "7D 18 24 D9")// for keychain
{
id2 = !id2;
if(id2 == true)
{
Serial.println("STUDENT 2,1");
lcd.print("STUDENT 2");
lcd.setCursor(0,1);
lcd.print("welcome");
}
else if(id2 == false)
{
Serial.println("STUDENT 2,0");
lcd.print("STUDENT 2");
lcd.setCursor(0,1);
lcd.print("thank you");
}
}
rfid = "";
delay(3000);
lcd.clear();
}
int getID() {
if ( ! mfrc522.PICC_IsNewCardPresent()) {
return 0;
}
if ( ! mfrc522.PICC_ReadCardSerial()) {
return 0;
}
for (int i = 0; i < mfrc522.uid.size; i++)
{
rfid += mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " ";
rfid += String(mfrc522.uid.uidByte[i], HEX);
}
rfid.trim();
rfid.toUpperCase();
mfrc522.PICC_HaltA();
return 1;
}
**********--------------*****************-------------------******************
before uploading change the uid code of the your RFID tag...
then upload that code
Comments
Post a Comment