The experiment of RFID identification based on Arduino

Source: Internet
Author: User

Http://www.it165.net/embed/html/201512/3287.html

December 04, 2015 (Friday) morning Dr.--rfid identification experiment of smart card experiment, based on 51 single-chip microcomputer;

Our experiment with the reader is the rfid-rc522 module, just and I bought the Arduino RFID Suite is the same paragraph;

The experimental time did not finish, because in the burning process has been burning not to go in, well, in the afternoon in the office of our doctor said there is a single-chip microcomputer is a problem, TMD so coincidence?

At noon I began to read the Arduino suite supporting the RFID experimental data, I intend to finish this experiment, but I changed the host computer to Arduino.

Experimental purpose

1. Understand the basic concept of RFID and the working principle of RF card;

2. Familiar with the use of Arduino and Rc522rfid modules;

3. Test the RC522 module for card recognition.

Laboratory materials

1. Computer one;

2. Arduino piece;

3. usb-Serial line one root;

4. rfid-rc522 module One;

5. Standard S50 blank card one sheet;

6. S50-shaped card One (key chain shape);

7. Straight row, curved row pin each piece;

8. A row of DuPont lines.

Bought RF IC card sensor module like the following, the mail is about 14 pieces:

Bought when the row plug and not welded, so must self-welding, although I do not have welding tools, but through this experiment I still welded. Here is the result of my second soldering:

Miafre 1-S50 inductive IC card
◇ Chip: Philips Mifare 1 S50
◇ Storage Capacity: 8Kbit, 16 partitions, two sets of passwords per partition
◇ Operating Frequency: 13.56MHZ
◇ Communication speed: 106Kboud
◇ read/write Distance: 2.5-10cm
◇ Read/write Time: 1-2ms
◇ Operating Temperature: -20℃-85℃
◇ Erase times: > 100,000 times
◇ Data storage: > 10
◇ Specification: 0.87x85.5x54/non-standard card
◇ Packaging Materials: PVC, PET, 0.13 copper coins
◇ Packaging technology: Ultrasonic automatic planting Line/automatic touch welding
◇ production Standard: ISO 14443, ISO 10536
◇ Application scope: Enterprise/Campus card, bus stored value cards, expressway toll, parking, community management, etc.

Principle of experiment

(i) RFID system composition

RFID technology uses the wireless radio frequency method to carry out contactless bidirectional data transmission between the reader and the RF card in order to achieve the purpose of target identification and data exchange. The most basic RFID system consists of three parts:

1. label (tag, i.e. RF card): consists of a coupling element and a chip, and the label contains a built-in antenna for communication between the RF antennas.

2. Reader: The device that reads the label information (which can also be written in the read-write card).

3. Antenna: Transmits RF signals between the label and reader.

(ii) Working principle

MCU through the reader chip registers read and write to control the card reader chip, the card reader chip received the command from the MCU, in accordance with the contactless RF Card protocol format, through the antenna and its matching circuit to the vicinity of a set of fixed frequency modulation signal (13.56 MHz) for the card, if there is a card in this range, The LC resonant circuit inside the card (resonant frequency is the same as the electromagnetic wave frequency transmitted by the reader) in the electromagnetic wave excitation, the resonance, in the card internal voltage pump continuously for the other end of the capacitor charge, to obtain energy, when the capacitor voltage reaches 2 V, can be used as the power supply for the card of other circuits to provide the operating voltage. When a card is in the effective working range of the card reader, the MCU sends out a seek card to the card, the card will reply to the card type, establish the first link between the card and the card reader, and if there are multiple cards within the antenna's working range, the card reader can select a card according to the card serial number by initiating anti-collision mechanism. The selected card is then checked with the card reader for password verification, ensuring that the reader has access to the card and the validity of the card, while the unselected one is still idle, waiting for the next seek order. After the password verification is passed, the card can be read and written and other application operations.

(iii) RC522 module

The RF read-write chip for the module should be Philips MF RC522, which I should have attached in the previous article, in both English and Chinese.

The MF RC522 offers 3 interface modes: up to ten MB/s SPI, I²c bus mode (up to kb/s in fast mode, and up to 3.4 MB/s in high-speed mode), up to 1228.8 kb/s UART mode. The purchased module adopts the first mode-four-wire SPI, the clock signal in the communication is generated by Arduino, MF RC522 chip is set to slave mode, receive data from Arduino to set register, and be responsible for transmitting and receiving the related data in RF interface communication.

The transmission path for the data is: Arduino sends the data to the MF RC522,MF RC522 via the MOSI line and sends it back to the Arduino through the miso line.

Experimental design

RC522 module each pin function

SDA-Serial Data cable (I/O line at IIC interface), NSS (slave sign pin) in SPI interface;

SCK--The SCK signal connecting the MCU;

MOSI-MCU output, RC522 receive (i.e. the main device output, from the device input);

Miso--RC522 output, MCU receive (i.e. from device output, main device input);

IRQ--Interrupt request output;

GND--grounding;

RST--Reset;

3.3V--VSS, operating voltage, if the use of 5V MCU, pay attention to the sub-pressure.

Pin Correspondence Relationship:

rfid module arduino UNO
VCC
rst
gnd gnd
12
mosi 11
sck nss 10
irq (not connected)

Circuit diagram

Physical Connection Diagram

The design of the code, I will put in the next article to say.

Experimental content

1, realize the use of IC card control LED light flashing.

2, realize the use of seven-segment Digital tube display IC card type, and record.

3. Realize the serial number of IC card on the seven-segment digital tube and record it in hexadecimal.

4. Print the IC card type and serial number from the serial port.

5, test the maximum identification distance.

Study Questions

1, the completion of the IC card data read and write, what are the steps required?

A: Four steps: Seek card--anti-collision, select Card, three times mutual confirmation, read and write

2. Please write down the type and serial number of standard S50 card, S50 key card in the experiment material respectively.

Answer: S50 Standard card: Type 0400 and SN fdc2e3d5

S50 profiled card: Type 0400 and SN D8163100

3, when more than one card together, can correctly identify its card number? And please explain the reason.

Answer: Not in this experiment. In this experimental system, the reader performs the seek operation and returns the card type before performing a conflict prevention operation. Because there are more than one card in the reader's readable range, the anti-collision function return value is Mi_err, you can not continue to perform the selection of cards and read and write operations, you will not get the card's serial number.

Observations in the

Experiment:

As I slowly move two cards closer to the reader, the reader first identifies the type of card and one of its cards, and prints the type and serial number of the card on the serial port. Then the serial port will only print the card type without printing the serial number of the card. Sometimes only the card type is printed and there is no serial number.

Parsing:

In the process of getting closer, the reader gets an indeterminate signal that occasionally happens to recognize one of the cards. But then, the two cards interfere with each other, so that they can not work.

Can RFID readers handle multiple labels at the same time in multiple cards?

The answer is yes, TI's 13.56MHz system can handle about 50 tags per second. Looking back at the logical structure of the MF card mentioned in the previous article, there is a module called the Anti-collision module:

If there are multiple Mifare 1 cards in the operating range of the reader's antenna, the conflict prevention module will be activated: Select a card based on the card's serial number. The selected card will be exchanged directly with the reader, the unselected card is waiting and ready to communicate with the reader.

Since there is an anti-collision module, why do we use the same MF1 S50 card, or do we not recognize it? The reason for

is on the anti-collision mechanism of the RFID reader. If our card reader device uses anti-collision mechanism, then after the collision, the RFID system will respond to the different card ticks according to the collision algorithm, and the card that has been responded to will be temporarily dormant (sleep), and the card that is not selected is in the waiting state. In the last article I just mentioned the name of the algorithm. The

Anti-collision mechanism makes it possible to correctly operate multiple cards at the same time in the read-write area, with only the algorithm programmed to automatically select one of the cards for read and write operations. This facilitates the operation and increases the speed of the operation.

If there are more than one VICC or PICC responding simultaneously within the same time period, a collision occurs. The core of RFID is anti-collision technology, which is also the main difference with the contact IC card. ISO 14443-3 Specifies the anti-collision mechanism for type A and type B. The anti-collision mechanism is different in principle: the former is based on the bit Collision detection protocol, and TYPE B completes the anti-collision through series command sequence. ISO 15693 uses wheel-seek mechanism, time-sharing query to complete the anti-collision mechanism, in the third part of the standard detailed provisions.

4, please test whether the RC522 module can identify Yangcheng Tong, campus card and other contactless IC cards? If you can identify, please write out the type and serial number?

A: RC522 module can also identify Yangcheng Tong, Campus card and bank cards, found that the type are 0400, belong to the MFONE-S50 card. The second-generation ID card is not recognized, but I have seen the machine identified. It is estimated that the working frequency is different, be deciphered.

A campus One card
Card TYPE:MFONE-S50
The card ' s number Is:f68f8eab

Some Yangcheng Tong
Card TYPE:MFONE-S50
The card ' s number is:95af4b27

A bank card
Card TYPE:MFONE-S50
The card ' s number is:ef660184

Experimental results

LED flashing

Next drawings ...

Digital tube Display

Next drawings ...

Serial printing

Recognition distance

I measured it roughly and found that the identification of the white card needed to be within 4 cm, and at 7 cm, the card could not be read. As for increasing the working current, the communication distance cannot be increased. With my campus card and white card test together, almost all can only identify campus card. So I thought the campus card coil is better, but the individual identification, the distance is still 4 cm. The identification distance of the key ring is about 2.5 cm.

Attention to the identification of the time to release the hands of static electricity, the reader should not be around the other current interference.

The experiment of RFID identification based on Arduino

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.