RFID-ARDUINO

Photo of author

By Jackson Taylor

1)PRINTING RFID CARD NO. IN LCD
#include <LiquidCrystal.h>
char str1[13];int i=0,x=0;
LiquidCrystal lcd(12, 11, A0, A1, A2, A3);//LCD RS-12,En-11,D4-5,D5- 4,D6-3,D7-2,R/W- ground
void setup()
{
Serial.begin(9600);
lcd.begin(16, 2);// set up the LCD’s number of columns and rows:
lcd.print(“EMERGING”);// Print a message to the LCD.
delay(200);
lcd.clear();
str1[12]=0;
pinMode(13,OUTPUT);
}
void loop()
{
if(Serial.available()>0)
{
char a=Serial.read();
if(a==’8′)x=1; //CHECKS THE TWO LETTER
if(x==1 && a==’C’)digitalWrite(13,HIGH);//CHECKS THE TWO LETTER
str1[i]=a;
i++;
if(i>11)//total 12 char in rfid
{
   lcd.print(str1);
   i=0;
}
else
{
  lcd.clear();
}
}
}
2)  CHECKING RFID CARDS (AS IDENTITY CARD)
#include <LiquidCrystal.h>
char a,b;
LiquidCrystal lcd(12, 13, A0, A1, A2, A3);//LCD RS-12,En-11,D4-5,D5- 4,D6-3,D7-2,R/W- ground
void setup()

Serial.begin(9600);
lcd.begin(16, 2);// set up the LCD’s number of columns and rows: 
lcd.print(“www.EMERGINGTECHS.ORG”);// Print a message to the LCD.
delay(200);
lcd.clear();
}
void loop() 
{
rfid();
}
void rfid(void)
{
  if(Serial.available()>0)
{
a=Serial.read();
card1();
card2();
card3();
}
}
void card1(void)//card no.100069998C6C (PRINTED NO.10539308)
{
if(a==’8′)
{    
while(!(Serial.available()>0));
a=Serial.read();
if(a==’C’) {lcd.setCursor(0, 0);lcd.print(“JIMMY”);}
}} 
void card2(void)//card no.1000697BDDDF (PRINTED NO.10531709)
{
if(a==’B’){    
while(!(Serial.available()>0));
a=Serial.read();
if(a==’D’) {lcd.setCursor(0, 0);lcd.print(“ARJUN”);}
}}
void card3(void)//card no.100069505A73 (PRINTED NO.10520570)
{
  if(a==’A’){    
while(!(Serial.available()>0));
 a=Serial.read();
if(a==’7′) {lcd.setCursor(0, 0);lcd.print(“RENJU”);}
}
}