RFID–Radio Frequency Identification

RFID–Radio Frequency Identification

RFID overview

1.The composition of RFID

RFID is mainly composed of a reader or writer and a transponder. The reader or writer is to read and write the transponder. For example, the most common, vehicle card reader. A transponder is an information storage medium in which data can usually be stored for a long period of time. This data can be manipulated by the reader. Transponders come in many different categories depending on the attributes.

2.The working principle of RFID

RFID uses electromagnetic waves for communication. More common in our daily life is the passive transponder. This transponder has no built-in power supply, it is passive and needs to be close to the reader or writer to get enough power supply by the emitted electromagnetic waves for communication. Correspondingly, there’s active transponder which has its own power supply and has no requirement for external power. It can actively send out communication requests.

In addition to the hardware support, RFID requires normal protocol support, such as the common ISO/EC 14443A protocol. Under the constraints of the software protocol, the transponder and the reader or writer can communicate directly.

3.The advantages and disadvantages of RFID

Advantages of RFID are as follows:

  1. RFID equipment has strong anti-interference ability and is hard to damage;
  2. RFID response has a long service life;
  3. Large reading distance;
  4. The data in the transponder can be encrypted;
  5. Large data storage capacity;
  6. The storage information can be modified.

Disadvantages of RFID are as follows:

  1. Data flooding: the data read from the RFID transponder is not all useful, which will inevitably have an impact on the control system;
  2. There is no global standard: countries that use different standards may be unable to operate RFID data, the corresponding QR code does not have this problem, however;
  3. Security issues: Private data in RFID transponders may be read without knowledge;
  4. May be used with malicious purpose: for example, in 2006, there were reports of RFID buffer overflow vulnerability, which may cause the airport terminal information leakage;
  5. High temperature damage: most of the current transponders glue the integrated circuit in the base material, which may causes loose connection at high temperatures.

RFID hardware

1.The hardware of the RFID consists of a reader or writer and a transponder (usually an electronic tag). There are many ways to communicate between the reader or writer and the transponder. Often, which are mutually incompatible, mainly because of the different working frequency bands. The commonly used radio frequency identification bands and their characteristics are shown in the table:

The transponder we use is the MIFARE 1KB passive tag. It operates at 13.56 MHz and follows the ISO/IEC 14443A standard. The reader or writer is MFRC522, which also supports the ISO/IEC14443A/MIFARE standard.

2.RFID reader or writer.

3.RFID transponder.

4.MIFARE 1KB smart card data organization form.

a.Sector Trailer

Sector Trailer is composed of Key A, Key B of 6 Bytes , and Access Bits of 4 Bytes.

Their specific functions are as follows:

Key A: Any time when reading Key A, it will return data 0; Key B is for security verification, it can be used as user data and can be read under some access conditions

Key B: Key B is for security verification, it can be used as user data and can be read under some access conditions.

Access bit: access bit is used to specify the access right of each block of the sector;bit 9 can be used as user data.

b. Manufacturer data

The 0th block of the sector 0 is a special block that stores the manufacturer data. This block is a read-only block and is write protected. Changes to the access bits will not affect the properties of the block.

c. The data block

The 16 bits of 3 blocks (0 sectors only have 2 blocks) in all sectors can be used to store data. These data can be configured as read or write or value block. Value block can be used to implement electronic payment functions (allowing reading, writing, adding, reducing, restoring, and transmitting commands). Value blocks are organized in a fixed format, as shown in the table:

 

The definitions of value and address in the table are as follows.

  1. Value: indicates a 4Byte has a symbolic value, and negative numbers are represented by a complement. For data integrity and security, a value is stored three times in the form of the original code and the complement;
  2. Address: indicates a 1Byte address, which can be used to store the storage address of a block. Also, for data integrity and security, the address is stored four times in the form of the original code and the complement. The value increase, decrease, recovery, and transfer operations will not affect the value of the address, only by writing command can it be modified.

The circuit diagram connection

The MFRC522 supports three types of interfaces. The third-party RFID uses the SPI interface, and the four control lines are described as below:

  1. SCK: serial clock;
  2. MOSI: host (Arduino) output, slave (MFRC522) input;
  3. MISO: host input, slave output;
  4. NSS: slave selection (active low).

The charging system

The implementation of the charging system is very simple, the idea is as follows

  1. Use the key for verification;
  2. Execute the deduction operation;
  3. Output balance;

The code implements the charging system is as follow:

/***********************************************************
File name:  Adeept_RFID.ino
Description:  
RFID is a wireless communication technology that is commonly used in 
automatic identification and target tracking. 
It can operate on target data without contact, 
such as the common public transportation payment 
system and access control system.

Website: www.adeept.com
E-mail: support@adeept.com
Author: Felix
Date: 2019/07/01 
***********************************************************/

#include <SPI.h>
#include <MFRC522.h>

#define SS_PIN 10
#define RST_PIN 9

MFRC522 mfrc522(SS_PIN, RST_PIN);        // creat MFRC522 object

void setup() {
  Serial.begin(9600);        //initialize the serial port
  SPI.begin();                //initialize SPI bus
  mfrc522.PCD_Init();        //initialize reader-writer
  Serial.println("Public transport charge system."); //output the payment system message
}

void loop() {
//  int amount=0;
//  char yon;

  //detect if the chip is detected
  if ( ! mfrc522.PICC_IsNewCardPresent()) {
    return;
  }

  //select a card to operate on
  if ( ! mfrc522.PICC_ReadCardSerial()) {
    return;
  }

    byte piccType = mfrc522.PICC_GetType(mfrc522.uid.sak);
    if(piccType != MFRC522::PICC_TYPE_MIFARE_MINI
    && piccType != MFRC522::PICC_TYPE_MIFARE_1K
    && piccType != MFRC522::PICC_TYPE_MIFARE_4K){
      Serial.println("Don not works with this cards.");
      return;
    }

  //set the key variable to FFFFFFFFFFFFh
  MFRC522::MIFARE_Key key;
  for (byte i = 0; i < 6; i++) {
    key.keyByte[i] = 0xFF;
  }

  //use the fifth data block of the card
  byte valueBlockA = 5;
  byte status;

  //use Key B to verify
  status = mfrc522.PCD_Authenticate(MFRC522::PICC_CMD_MF_AUTH_KEY_B, valueBlockA, &key, &(mfrc522.uid));
  if (status != MFRC522::STATUS_OK) {
    Serial.print("Failed,please try again.");
    return;
  }
//perform fee deduction poeration(the amount here is 1)
  status = mfrc522.MIFARE_Decrement(valueBlockA,1);
  if(status != MFRC522::STATUS_OK){
    Serial.print("Failed,please try again.");
    return;
  }
  status = mfrc522.MIFARE_Transfer(valueBlockA);
  if(status != MFRC522::STATUS_OK){
    Serial.print("Failed,please try again.");
    return;
  }

  byte buffer[18];
  byte size = sizeof(buffer);

  //read and output the balance
  status = mfrc522.MIFARE_Read(valueBlockA, buffer, &size);
  long value = (long(buffer[3])<<24) | (long(buffer[2])<<16) | (long(buffer[1])<<8) | long(buffer[0]);
  Serial.println("Success!");
  Serial.print("Balance:"); 
  Serial.println(value, DEC);
  //change card activation status
  mfrc522.PICC_HaltA();
  //stop encrypted transmission
  mfrc522.PCD_StopCrypto1();
}

Usually, the deduction information is displayed on the LED of the vehicle reader. The above example code outputs it to the serial monitor. After downloading the above code to the Arduino development board, open the serial monitor and wait for the output of the public transportation. charging system.

After it prompts the message, the card is ready to be used. As shown in the figure, the result after 5 times of swiping.

It can be seen that the balance is 95 yuan. And system works very well.

18 Replies to “RFID–Radio Frequency Identification”

  1. 66ceme situs bandar ceme online judi ceme agen ceme poker ceme qq ceme online terpercaya. Permainan yang disediakan di 66ceme berbasis server Idnplay, dengan minimal deposit sepuluh ribu rupiah dan bisa menggunakan pulsa sebagai deposit pulsa, selain itu nikmati banyak kemudahan dan keuntungan dengan bergabung di 66Ceme. http://bit.ly/registerceme

  2. Teaching our kids on-line security is each bit as vital today as instructing them the fundamentals of “actual world” bodily safety. The previous adages of “do not discuss to strangers” and different related sayings now have their very own digital counterparts, and it’s best to bear in mind of the entire prospects to make sure the security of your children once they go on the web 99 Bandar. Listed here are the foremost hazards of kids going surfing, together with a couple of bits of recommendation on the right way to deal with them.

  3. Teaching our kids on-line security is each bit as vital today as instructing them the fundamentals of “actual world” bodily safety. The previous adages of “do not discuss to strangers” and different related sayings now have their very own digital counterparts, and it’s best to bear in mind of the entire prospects to make sure the security of your children once they go on the web http://216.194.162.181. Listed here are the foremost hazards of kids going surfing, together with a couple of bits of recommendation on the right way to deal with them.

  4. Apa itu ceme online ? Mengapa bahasan mengenai ceme sering sekali di perbincangkan di Indonesia? Ceme sendiri adalah sebuah gim kartu yang menggunakan kartu domino. Pada game ceme ini terdiri dari 2 hingga 8 orang pemain. Setiap pemainnya akan mendapatkan 2 buah kartu. Tugas pemain di dalam game ini adalah menjumlahkan nilai kartu yang mereka miliki untuk diadu dengan pemain lainnya. http://209.182.194.11/apa-itu-ceme.php

  5. As most individuals know, Linux is among the finest applications ever developed to handle web Bandar Ceme Terpercaya connection and act as a server. With this type of functionality, you possibly can see that Linux is the only option on the subject of controlling your own home automation techniques.

  6. Ini pada dasarnya akan menjadi sebanyak Anda dan apa yang Anda anggap dapat Anda tangani. Bagi mereka yang memutuskan untuk mendapatkan perencana acara yang akan membantu Anda, Anda juga bisa berkeliaran di tempat yang Anda temukan. Anda akan terkejut dengan jumlah individu yang ada yang dapat membantu dengan kesempatan seperti itu. Ada banyak orang yang melakukan itu untuk tinggal https://bit.ly/2UzA8ix.

  7. Agen Poker Deposit Pulsa – Situs bandar ceme online dan poker online di Indonesia melakukan banyak inovasi dan perkembangan agar pemain tetap merasa nyaman dan setia bermain game poker online Indonesia.Untuk itu bukan hanya melakukan inovasi dalam jenis game yang disediakan, teknologi yang digunakan, sistem transaksi pun selalu berkembang sesuai dengan perkembangan jaman. http://bit.ly/cemedepositpulsa

  8. Everyone, in some unspecified time in the future of his or her life, has dreamed of being any individual particular, any individual large. Who hasn’t fantasized about being the one who hits the sport-profitable homer? Who hasn’t dreamed of being the homecoming queen? And what number of instances have we dreamed of being wealthy, or profitable, or pleased with our relationships? Daftar Bandar Ceme

  9. sehingga Anda perlu untuk mempertimbangkan dengan hati-hati apa yang Anda butuhkan dari hidup Anda, dan apakah itu bisa lebih baik dilayani dengan mentransfer ke seluruh bagian dunia yang baru. Pindah ke negara atau benua yang berbeda dapat meninggalkan Anda dengan bahasa untuk dipikirkan – apakah Anda mengomunikasikan bahasa yang dominan di sana – dan jika tidak, apakah Anda dapat mempelajarinya? Jika Anda tidak dapat berbicara, Anda mungkin merasa lebih sulit untuk melakukan banyak masalah yang kami ambil sebagai hak http://216.194.162.183/jackpot.php.

  10. Tidak sulit untuk mencari situs mana yang memberikan kemudahan poker deposit pulsa, anda hanya perlu mencari pada mesin pencari online seperti google, yahoo, bing atau yang lainnya kemudian masukan kata pencarian poker deposit pulsa, maka akan muncul banyak situs pilihan yang menyediakan deposit pulsa sebagai sistem depositnya. Dengan begitu anda tinggal memilih saja situs mana yang menarik perhatian anda. https://tinyurl.com/cemedepositpulsa

Leave a Reply