Learn to use PN532 to copy IC access card

Introduction to PN532

The PN532 chip is a near field communication (NFC RFID) chip developed by NXP. The chip integrates a contactless communication protocol for communication at 13.56MHz. It contains an 8051 core. If you say so much, you won’t come. Nonsense, to be honest about the many functions and principles of the chip, bloggers don't know much, but it does not prevent us from using it to read and write ordinary IC cards on the market!

PN532 module

There are a variety of modules made of PN532 chips on the market, some are expensive and some are cheap. You can search on the Internet by yourself. The following is the blogger’s

Figure 1 Front of PN532
Figure 2 The back of PN532
The module itself provides SPI, IIC, and UART interfaces for communicating with external devices, and provides two toggle switches to control the current communication protocol in a very user-friendly way. Here we use the UART protocol because it is very convenient for us. Connect the module and the computer to use

Preparation before use

Although the communication protocol interface between the module and the outside world has a UART interface, it is of TTL level and cannot be directly connected to a computer. We also need a USB-TTL module

Figure 3 PN532 module
Figure 4 USB-TTL module

Hardware wiring

Before wiring, let's put a big picture and look at the pin names on the module.
Insert picture description here
Above we can see that TX and RX are not marked for the UART protocol pins. After checking the information, we found that SDA corresponds to the TX pin of the UART protocol, and SCL corresponds to the UART. Protocol RX, power supply can use the 3.3V power supply port on the USB-TTL module. Check the
following table for wiring

PN532 USB-TTL
GND GND
VCC 3V3
SDA RX
SCL TX

Insert picture description here

Software settings

After wiring according to the above pins, open the computer device manager and you can see that there is a CH340 device in the port. If an unknown device is displayed, please install the CH340 driver (by Baidu)
Insert picture description here

Open the host computer software included with the information (friends who need information can leave a message below or search online by themselves), if the connection is ok, the host computer will display an NFC device found
Insert picture description here

Read data

Next, paste the white card and our PN532 module together, click "read card content" on the computer host computer,
Insert picture description here
you can see that this is a white card, and then we find the access control card we need to copy, and put it Read out the content of the
card in the same way as the white card above
Insert picture description here
. After reading the data, we first save it as a file, click the triangle in the upper left corner of the data, and save it to a place where you can find it. You need to use it when writing the card.
Insert picture description here

data input

The next step is to write the data of the access control card into the prepared white card. Click Write to the white card and find the previously saved file
Insert picture description here
Insert picture description here
. When this is reached, we have already copied an IC access control card. Here I use ordinary If there is a need to change the 0 sector block, it is recommended to use a UID card. The ordinary M1 card cannot modify the 0 sector block information.

Write complete

At this time, we read the data of the card again.
Insert picture description here
Comparing the data above, we can find that the data of the original access control card has been written to the new card, and the process of copying a card is completed here.

to sum up

The above copying process does not apply to encrypted cards. Ordinary non-encrypted IC cards are still no problem.
We are here for this issue. Interested friends are welcome to leave a message below!

Guess you like

Origin blog.csdn.net/qq_42250136/article/details/106471815