nfc shield/nfc module user guide - elecfreaks store

7
NFC NFC NFC NFC Shield/NFC Shield/NFC Shield/NFC Shield/NFC Module Module Module Module User User User User Guide Guide Guide Guide NFC NFC NFC NFC Shield/NFC Shield/NFC Shield/NFC Shield/NFC Module Module Module Module Introduction Introduction Introduction Introduction NFC Shield is a Near Field Communication interface for Arduino build around the popular NXP PN532 integrated circuit and SPI communication between Arduino and NFC Shield.. NFC is a short-distance radio technology that enables communication between devices that are held close together. RFID/NFC traces its roots in RFID technology and is an open platform technology standardized in ECMA-340 and ISO/IEC 18092. The NFC/RFID breakout base on PN532, which is the most popular NFC chip, and is what embedded in pretty much every phone or device that does NFC. It can pretty much do it all, such as read and write to tags and cards, communicate with phones (say for payment processing), and 'act' like a NFC tag. If you want to do any sort of embedded NFC work, this is the chip you'll want to use! NFC NFC NFC NFC Shield Shield Shield Shield

Upload: lamtram

Post on 25-Jan-2017

257 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: NFC Shield/NFC Module User Guide - Elecfreaks Store

NFCNFCNFCNFC Shield/NFCShield/NFCShield/NFCShield/NFC ModuleModuleModuleModule UserUserUserUser GuideGuideGuideGuide

NFCNFCNFCNFC Shield/NFCShield/NFCShield/NFCShield/NFC ModuleModuleModuleModule IntroductionIntroductionIntroductionIntroductionNFC Shield is a Near Field Communication interface for Arduino build aroundthe popular NXP PN532 integrated circuit and SPI communication betweenArduino and NFC Shield.. NFC is a short-distance radio technology thatenables communication between devices that are held close together.RFID/NFC traces its roots in RFID technology and is an open platformtechnology standardized in ECMA-340 and ISO/IEC 18092.

The NFC/RFID breakout base on PN532, which is the most popular NFC chip,and is what embedded in pretty much every phone or device that does NFC. Itcan pretty much do it all, such as read and write to tags and cards,communicate with phones (say for payment processing), and 'act' like a NFCtag. If you want to do any sort of embedded NFC work, this is the chip you'llwant to use!

NFCNFCNFCNFC ShieldShieldShieldShield

Page 2: NFC Shield/NFC Module User Guide - Elecfreaks Store

NFCNFCNFCNFC ModuleModuleModuleModule

HardwareHardwareHardwareHardware andandandand SoftwareSoftwareSoftwareSoftware PreparationPreparationPreparationPreparation

Page 3: NFC Shield/NFC Module User Guide - Elecfreaks Store

PartPartPartPart 1111 CommunicationCommunicationCommunicationCommunication BetweenBetweenBetweenBetween ArduinoArduinoArduinoArduino andandandand NFCNFCNFCNFC ShieldShieldShieldShield

1. Set the Arduino UNO Switch in 5V power supply2. Assemble the Arduino UNO and NFC Shield, and then link to PC with USBCable (we default the NFC Shield communicate in SPI Mode.)3. Open Arduino IDE and choose the corresponding Board and Serial port4. Click Examples / PN532_SPI / readAllMemoryBlocks ( if you do not havelibrary of PN532_SPI, please Download Demo Code PN532_SPI fromhttp://www.elecfreaks.com/wiki/index.php?title=RFID_/_NFC_Shield and Put the fileof PN532_SPI in the file of arduino -1.0.X / libraries )5. Please Note: Arduino 1.0 users have to change the #include <WProgram.h>lines to #include <Arduino.h> in PN532.cpp and PN532.h.6. Compiling sketch until done uploading appears7. Place the NFC Card near the NFC Shield to perform reaction

Page 4: NFC Shield/NFC Module User Guide - Elecfreaks Store

8. Open Serial Monitor and set the BaudRate as 96009. All memory blocks from NFC Card would be read and displayed

PartPartPartPart 2222 CommunicationCommunicationCommunicationCommunication BetweenBetweenBetweenBetween ArduinoArduinoArduinoArduino andandandand NFCNFCNFCNFC ModuleModuleModuleModule

ThroughThroughThroughThrough SPISPISPISPI

1. Set the Arduino Switch in 5V power supply.2. To enter SPI Mode, you need to set the SEL0 Switch in GND Side (for 0)and set the SEL1 Switch in 3V3 Side (for 1)

Page 5: NFC Shield/NFC Module User Guide - Elecfreaks Store

3. Assemble the Arduino UNO and NFC Module with Jumper Wire as below,and then link to PC

5V to 5V SCK to D13 MISO to D12MOSI to D11 SCL to D10 GND to GND

4. Open Arduino IDE1.0.X, and then click Examples, PN532_SPI,readAllMemoryBlocks5. Compiling sketch until done uploading appears6. Place the Card near the Module to do reaction7. Open Serial Monitor and set the BaudRate as 96008. All memory blocks from NFC Card would be read and displayed

PartPartPartPart 3.3.3.3. CommunicationCommunicationCommunicationCommunication BetweenBetweenBetweenBetween ArduinoArduinoArduinoArduino andandandand NFCNFCNFCNFC ModuleModuleModuleModule

throughthroughthroughthrough IICIICIICIIC

Page 6: NFC Shield/NFC Module User Guide - Elecfreaks Store

1. Set the Arduino Switch in 5V power supply.2. To enter IIC Mode, you need to set the SEL0 Switch in 3V3Side (for 1) andset the SEL1 Switch in GND Side (for 0)3. Assemble the Arduino UNO and NFC Module with Jumper Wire as below,and then link to PC

5V to 5V RST to D3 SDA to A4SCL to A5 IRQ to D2 GND to GND

Page 7: NFC Shield/NFC Module User Guide - Elecfreaks Store

4. Download IIC Demo fromhttp://www.elecfreaks.com/store/rfidnfc-breakout-board-p-519.html5. Change the file name from NFC_I2C-master into Adafruit_NFCShield_I2C,and then put in file of arduino-1.0.X / libraries6. Click Examples / Adafruit_NFCShield_I2C/ iso14443a-uid and upload code.7. Place the NFC Card near the NFC module to do reaction.

8. Open the Serial Monitor and set the BaudRate as 1152009. The data from NFC Module would be displayed in the Serial Monitor