Principle of non-contact IC card MFRC500

1 Non-contact IC card antenna composition

The non-contact IC card antenna is a decisive factor affecting the performance of the card reading. The quality of the antenna design directly affects the stability of the card reading system. As shown in FIG. 1, the entire antenna portion circuit is composed of an EMC filter circuit, a receiving circuit, and an antenna coil circuit. The function of the EMC filter circuit is to attenuate the influence of higher harmonics generated by the antenna transmitting circuit on the outside world. The receiving circuit is composed of R1, R2, C3, and C4. The role of R2 and C4 is to make the DC level on the receiving pin RX coincide with the internal reference voltage output VMID; R1 is used to adjust the amplitude of the AC signal on the receiving pin RX. The circuit shown to the right of the dashed line is the antenna to be designed, including the antenna coil and the associated resonant components.

Among them, Rext is used to adjust the quality factor of the antenna, and the center frequency f of the antenna and the external output impedance Za are mainly adjusted by changing the values ​​of the resonant capacitors C1a, C1b, C2a, C2b. Therefore, the determination of the external resistor Rext and the resonant capacitor component parameters is an indispensable part of the antenna coil circuit design. According to Philips' non-contact IC card antenna design data, antenna tuning is divided into two steps: 1 Adjust the antenna's resonant frequency f and output impedance Za to the desired 13.56 MHz and 500 Ω; 2 Adjust the antenna to find the largest Reading distance. The specific method is to connect the antenna into the circuit, and then, when the system is working, continuously adjust the value of C2 and test the read/write distance of the card until the value of C2 is found when the maximum card reading distance is found. The purpose of finding the maximum card reading distance is to make the card enter the antenna radiation range for a long enough time to complete the card operation satisfactorily.

Non-contact IC card antenna

Figure 1 Antenna module circuit

2 Non-contact IC wallet function

Value cards are generally used for small purchases, and e-wallets are a typical application. The operation of the electronic wallet includes READ, INCREMENT, DECREMENT, TRANSFER, and RESTORE. The e-wallet is generally stored in a value segment manner, and the manufacturer also provides a value segment operation function to facilitate user development. Value segments are also called "Value Blocks" and Value is 4 bytes long (including sign bits). To improve error detection and error correction, each Value is stored 3 times in a Value Block as follows:

The consistency of the three Values ​​is checked inside the chip before any calculation is performed. The remaining 4 bytes (A and ) are 8-bit arbitrary address bytes, and the same address is stored 4 times (A and ).

The contents of the Value Block are first written to the requested address by the WRITE command, and can be modified later using the DECREAMENT/INCREMENT/RESTORE command. The calculation process of the data is shown in Figure 2. The result of the calculation is temporarily stored in the DATA register (ie, the data register), and then written to the register using the TRANSFER command.

Value calculation diagram

Figure 2 Value calculation diagram

3 software implementation

The MF1 IC S50 has 8 Kb EEPROM divided into 16 zones, each zone is divided into 4 blocks (Block0~3), and one packet has 16 bytes. For the convenience of users, Philips has given the value segment operation function M500PiccValue(), which can be used to easily perform operations such as INCREMENT, DECREMENT, TRANSFER, and RESTORE. However, this function has certain defects. When the return value is "non-MI_OK", there are two cases:

1 value operation is not completed, the value is unchanged;
The 2 value operation is complete and the value is the correct calculation result. This will make it impossible to determine whether the value operation succeeded or not based on the function return value (only the return value is MI_OK to determine that it is correct). In other words, although it can be determined that the operation is correct when MI_OK, but the operation may be completed when it is "non-MI_OK", the operation may not be completed. Therefore, if this is the return value operation, then wait until MI_OK, there will be more The phenomenon of operation. For example, if you need to brush the card for 1 yuan, it may deduct 2 yuan, 3 yuan, or even more. This is certainly not what you expect to see.

In view of the above situation, in order to ensure that the card can be operated correctly and data is not lost, two data blocks are generally divided into one electronic wallet in one area, and stored in a value segment format, which is respectively defined as a main value block (1 block). And the backup value block (2 blocks), the primary value block and the backup block are backed up to each other.

Non-contact IC card MFRC500 principle

Figure 3 software operation process

First, the value obtained by subtracting the value of the main value block from the consumption amount is stored in the backup value block (1 block → 2 blocks, using the "subtract" and "transfer" operations), and the main value block has not changed yet; if this operation is MI_OK, continue the following operation to return the value of the backup value block back to the main value block (2 blocks → 1 block), using the recovery operation; if the operation is MI_OK, then the values ​​of 1 block and 2 blocks are equal. Each step of the operation judges the result, and if it fails, it is redone. The specific software operation process is shown in Figure 3.

4 Conclusion

As a kind of value card, e-wallet is very important for the stability of its operation. In terms of hardware, try to adjust the card reader antenna's card reading range to the maximum distance of the card reader to ensure that the card and antenna have sufficient time coupling to create a good hardware condition for the card. However, due to the individual differences in card readers and personal swiping habits, it can also cause some anomalies. At this time, software is needed to make up for the deficiencies in the hardware. The two-value block operation sacrifices some time of card swiping, but solves some problems in the single-value block operation. Even if there is a problem with one value block, the data can be transmitted from another value block, thereby improving the stability of the system. . In addition, in order to ensure that the operation of the card can be completed before the card leaves the antenna, some sound and light prompts can be added as an aid (for example, the sound and light prompt is performed after the operation is successfully completed). These details are also necessary. The method has been rigorously tested indoors and put into operation, and the work is stable.

Author email: e-mail:

The products are made of PU sponge which is super soft. It simply makes dirt disappear and brings lots of conveniences to you. Good absorbing of water, no additional detergents needed while using. Macroporous structure can produce rich foam in a short time, make your clean more easily. Absorb water with sponge and squeeze out gently. Gently rub sponge on dirty surface to remove the dirts and smudges. Rinse the dirty sponge with water after use and dry it. Dispose of properly after multiple uses It can be used with different sizes by cutting with knife or scissors according to purpose. Widely used as a cleaning material in Household Cleaning, Car Washing. etc. Car Cleaning Sponge, bulk sponge, Car Sponge, car polish wax, heavy duty Cleaning Sponge, foam cleaning sponge. 

Porous SpongeCar Washer


Car Cleaning Sponge

Car Cleaning Sponge,Car Wash Sponge,Car Sponge,Cleaning Sponge

FengRun Commodity Co.,Ltd. , https://www.yuan-qiang.com