PN532 Manual V3
PN532 Manual V3
PN532 Manual V3
com
Introduction
NFC is a popular technology in recent years. We often heard this word while smart phone company such as Samsung or HTC
introduces their latest high-end phones. Almost all the high-end phones in the market support NFC.
Near field communication (NFC) is a set of standards for smartphones and similar devices to establish radio communication with
each other by touching them together or bringing them into close proximity, usually no more than a few centimeters.
For electronics geeks, we also want to use NFC technology to make our own things. So we build this NFC RFID module. This module is
built around NXP PN532. NXP PN532 is very popular in NFC area. And the company offers much technology document to help
developers. We developed this module based on the official document. To make things easier, we also build library for this module.
We almost break out all the IO pins of NXP532 on this module. Users could easily connect and play. With our Arduino Sensor Shield ,
it is very easy to plug and play. However, if users want to use other interface such as UART or SPI, this module also makes it easy to
connect those pins.
www.elechouse.com
We have updated this module to version 3. Compared with V2, V3 have the following improvement:
1.
2.
3.
4.
Features
1.
2.
3.
4.
5.
6.
7.
8.
9.
www.elechouse.com
Interface
VCC: 3.3V~5V
SPI: 3.3V TTL with 100 ohm resistors in series. It could be connected directly to 5V interface of microcontroller such as
Arduino.
The I2C and HSU shares the same pins. The definition of IIC pins is printed at front and the HSUs is printed at the back. The HSU mode
is configured as the default mode. But you could change the interface by setting the toggle switch.
Channel
1
OFF
ON
OFF
Channel
2
OFF
OFF
ON
We break all the PN532 pins out. The 1.27mm connector hole contains those pins which might not be used for most users. If some
developers need to connect those pins, we could supply connectors.
www.elechouse.com
Hardware Installation
Solder the connector
The bended male pins come with the NFC board.
Some users might need soldering other types of connectors or directly solder wires on it. Anyway, make sure the wires go across the
antenna lines in 90 degree.
www.elechouse.com
Connect with Arduino
If without the sensor shield, please connect as following:
Mode
PN532
Module
Arduino UNO
Arduino Leonardo
Arduino Mega
(2560)
Arduino Due
Power
VCC
GND
SDA
SCL
TXD
RXD
5V
GND
A4/SDA
A5/SCL
Pin 0
Pin 1
5V
GND
Pin 2 /SDA
Pin 3/SCL
Pin 0
Pin 1
5V
GND
Pin 20 /SDA
Pin 21/SCL
Pin 19
Pin 18
5V
GND
Pin 20 /SDA
Pin 21/SCL
Pin 19
Pin 18
IIC/I2C Mode
HSU Mode
Could not
present
message in
Serial
Monitor on
PC
SPI Mode
SCK
Pin 13 or ICSP-3
ICSP-3
Pin 52 or ICSP-3
ICSP-3
Note: SPI
on Due is
MISO
Pin 12 or ICSP-1
ICSP-1
Pin 50 or ICSP-1
ICSP-1
still in
MOSI
Pin 11 or ICSP-4
ICSP-4
Pin 51 or ICSP-4
ICSP-4
developing
SS
Pin 10
Pin 10
Pin 10
Pin 10
Arduino UNO only has one serial interface which is also connected to USB port to PC. In HSU mode, the serial monitor could not be
used as message displaying windows.
Function Test
RFID Reader/Writer
Here we show how to read and write RFID card with this module.
Download the library PN532 at our github page. You could find 4 folders in the library. Unzip the 4 folders at the library folder in
Arduino IDE.
www.elechouse.com
www.elechouse.com
Upload the code to Arduino and open Serial monitor. Put a card on it:
You could also try other reading/writing example code in the library.
www.elechouse.com
It also supports reading flexible tag. We tested flexible tags of Mifare 1 S50 and Ultralight. The reading distance is up to 5cm.
You could find those flexible tags here.
P2P NFC
Currently we are still developing the software. The P2P NFC communication between two PN532 modules is only supported by I2C
mode. Please download this library.
Note, while testing this library, please remove the libraries in the testing above (or other PN532 libraries) to other folders.
Otherwise they might conflict.
Here we need two Arduino boards to test this function. Basically we will program one NFC module as Initiator, and the other as
Target.
Please upload the following two examples to the two Arduino board:
NFC_p2p_initiator
NFC_p2p_target
After uploading the sketches, open the Serial Monitor. Please note that Arduino IDE doesnt support opening 2 Serial Monitors. So
you need another Serial Tool. Here we have 2 versions of Arduino IDE installed in my PC: Arduino 0022 and Arduino 1.0. We open the
two and could have two Serial Monitor working. Note the baud rate is 115200.
Target:
www.elechouse.com
Initiator:
www.elechouse.com
Finally we get
Target:
Initiator:
www.elechouse.com
www.elechouse.com
Upload the code to Arduino, and open Serial Monitor:
Put a NFC-support phone on the module (the following phone is Nexus 4):
On Android phone, if you have set the default browser, it will start the browser and visit our website: www.elechouse.com
If it doesnt start the browser, please open the browser and try again. Here we tested HTC one and Google Nexus 4. They all work
very well. Different NFC phones might have different NFC ICs. If your phone doesnt work with it, try to google information to check if
your phone NFC chip is compatible with PN532.
On Serial Monitor you could get the following result:
www.elechouse.com
Useful link
Where to buy
Please visit this page to buy this product: PN532 NFC module
Date
Author
Description
Wilson
Initial version
Wilson