arduino with RFID and LCD project overview in tamil



this is the simple projec for arduino with RFID and LCD display... here the name of student only displayed in LCD display.... we can sent that to cloud to online attendance using esp8266 or using lab with python....

                                 The code is here

/*
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 id = true;
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");
  Serial.println("--------------------------");
  Serial.println("PLEASE SHOW YOUR 1. ID CARD.");
  Serial.println();
}

void loop()
{
  id = !id;
  do{
    successRead = getID();
  }
  while (!successRead);
  
  Serial.println(successRead);
  /*if (id == false)
  {
    Serial.print("hai");
  }
  else if (id == true)
  {
    Serial.print("hello");
  }*/
  if (rfid == "9D 22 B5 2D")//for card
  {
    if(id == true)
    {
      lcd.print("STUDENT 1");
      lcd.setCursor(0,1);
      lcd.print("WELCOME");
    }
    else if(id == false)
    {
      lcd.print("STUDENT 1");
      lcd.setCursor(0,1);
      lcd.print("THANK YOU");
    }
    
  }
  if (rfid == "7D 18 24 D9")// for keychain
  {
   if(id == true)
    {
     lcd.print("STUDENT 2");
     lcd.setCursor(0,1);
     lcd.print("WELCOME");
    }
    else if(id == false)
    {
     lcd.print("STUDENT 2");
     lcd.setCursor(0,1);
     lcd.print("THANK YOU");
    } 
  }  
  rfid = "";
  delay(2000);
  lcd.clear();
  
}


int getID() {
  
  if ( ! mfrc522.PICC_IsNewCardPresent()) { 
    return 0;
  }
  if ( ! mfrc522.PICC_ReadCardSerial()) {
    return 0;
  }
  Serial.print("Card ID: ");

  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();
  
  Serial.print(rfid);
  mfrc522.PICC_HaltA();
  return 1;
}
----------------------------------------------------------************-----------------------------------------------
copy that and paste in the arduino IDE and then upload that..... connections are given there(in codings)....

Comments

Popular posts from this blog

CHATBOT programming tutorial in tamil

programing part for petrol level measuring in tamil

using millis() in ultrasonic sensor program in tamil