fbpx
АРВАН ХОЁРДУГААР ДОЛОО ХОНОГ
АРВАН ГУРАВДУГААР ДОЛОО ХОНОГ
АРВАН ДӨРӨВДҮГЭЭР ДОЛОО ХОНОГ
АРВАН ТАВДУГААР ДОЛОО ХОНОГ
АРВАН ЗУРГААДУГААР ДОЛОО ХОНОГ
АРВАН ДОЛООДУГААР ДОЛОО ХОНОГ
АРВАН НАЙМДУГААР ДОЛОО ХОНОГ
Төсөл
2 of 3

Төсөл 4 RFID badge scanner with LCD

Хэрэглэгдэхүүн:

  1. Ардиуно 1ш
  2. RFID RC 522 module 1ш
  3. RFID RC 522 key 1ш
  4. 10k потенциометр
  5. LCD дэлгэц 1ш
  6. Туршилтын хавтан 1ш
  7. Утас

Зарчмын схем

Зарчмын схем

Программ

//All Credit Technic 1510
//
//
//
//
#include <SPI.h>
#include   <MFRC522.h>
#include <LiquidCrystal.h>
#define SS_PIN 10
#define RST_PIN   9
MFRC522 mfrc522(SS_PIN, RST_PIN);   
LiquidCrystal lcd(6 , 7, 5, 4, 3, 2);

   
void setup() 
{
  
  SPI.begin();     
  mfrc522.PCD_Init();   
   lcd.begin(16, 2);
  lcd.print("Scan RFID Card");
  

}
void loop()   
{

  if ( ! mfrc522.PICC_IsNewCardPresent()) 
  {
    return;
   }

  if ( ! mfrc522.PICC_ReadCardSerial()) 
  {
    return;
  }

   lcd.clear();
  lcd.begin(16, 2);
  lcd.print("UID tag :");
  String   content= "";
  byte letter;
  for (byte i = 0; i < mfrc522.uid.size; i++)   
  {
    lcd.setCursor(0, 1);
     lcd.print(mfrc522.uid.uidByte[i] < 0x10   ? " 0" : " ");
     lcd.print(mfrc522.uid.uidByte[i], HEX);
     content.concat(String(mfrc522.uid.uidByte[i]   < 0x10 ? " 0" : " "));
     content.concat(String(mfrc522.uid.uidByte[i],   HEX));
  }
lcd.clear();
lcd.begin(16, 2);
 lcd.print("Message : ");
   content.toUpperCase();
  if (content.substring(1) == "E0 28 E9 87") //Plz change   to your cards UID
  {
   lcd.setCursor(0,1);
    lcd.print("Authorized");

     delay(3000);
   lcd.clear();
    setup();
  }
 
 else   {
   lcd.setCursor(0, 1);
    lcd.print(" Access denied");
    delay(3000);
     lcd.clear();
      setup();
      }
}