NFC Shield V2.0
NFC (Near Field Communication) is a technology that is widely used. Some of NFC's applications include wireless access control systems (e.g. keyless doors, and locks), and mobile device payments (e.g. store registers that receive payment information via a phone application).
The NFC Shield features a transceiver module, PN532, which handles wireless communication at 13.56MHz, this means that you can read and write a 13.56MHz tag with this shield or implement point to point (P2P) data exchange between the shield and a smart phone.
For this new version of the shield we have created a separate, independent, PCB antenna area which allows you to more easily stretch the NFC interface outside of your main circuit enclosure.
Application Ideas
If you want to make some awesome projects by NFC Shield V2.0, here are some projects for reference.
NFC Shield Demo
Paper Man, an interesting object to interact with Android
More Awesome Projects by NFC Shield V2.0
Features
- Use of the ICSP header for SPI. This means that the shield works with the following Arduino development boards: Uno, Mega, Leonardo
- Wireless NFC communication at 13.56MHz
- SPI protocol - pin saving interface that requires only 4 pins
- Input Voltage: 5V from the Arduino's 5V pin
- Typical Current: 100mA
- 5cm max effective range
- Supports P2P communication
- Support ISO14443 Type A and Type B protocols
Hardware Overview
The NFC shield's pins and other terminals are described below.
NFC shield interface
- D10 and D9 are used for SPI chip select (CS/SS). D10 is connected by default, to connect D9 soldering the SS pad to the D9 pad and scraping off the connection between SS and D10 is required.
- D2 can be used to receive the shield's interrupt request (IRQ) pin signal. The interrupt is not connect by default, soldering of the "D2/INT0" and "IRQ" pads is required.
- The shield gets its SPI interface (SPI MOSI, MISO, and SCK pins) from the Arduino's ICSP header directly, this means that the shield works the following Arduinos: Uno, Mega, and Leonardo.
- The ANT1 terminal is where the NFC antenna (included with the shield) is connected to.
- The shield is powered by 5V from the Arduino board.
The NFC shield's antenna, included with the shield, is a separate PCB module that is attached to the shield via a cable. The antenna is the area used to receive and transmit information.
NFC antenna PCB attachment
NFC Shield Setup
Hardware Installation
- Attach the NFC Antenna to the shield.
- Stack the NFC Shield on your Arduino development board and connect the board to a PC using a USB cable.
Software Libraries Installation
Step 1. Download Seeed Arduino NFC Library.
Step 2. Refer to How to install library to install Seeed Arduino NFC library for Arduino.
Step 3. Open “WriteTag” code via the path: File --> Examples --> WriteTag.
Step 4. Modify the code as below to enable SPI communication.
#if 0
#include <SPI.h>
#include <PN532/PN532_SPI/PN532_SPI.h>
PN532_SPI pn532spi(SPI, 10);
NfcAdapter nfc = NfcAdapter(pn532spi);
#else
#include <Wire.h>
#include <PN532/PN532_I2C/PN532_I2C.h>
PN532_I2C pn532_i2c(Wire);
NfcAdapter nfc = NfcAdapter(pn532_i2c);
#endif
void setup() {
SERIAL.begin(9600);
SERIAL.println("NDEF Writer");
nfc.begin();
}
Arduino available libraries menu
NFC Shield Examples/Applications
Example: NFC WriteTag
This example will show you how to use the NFC shield to scan an NFC tag and display its information/data.
In the Arduino IDE copy, paste, then upload the code below to your board.
Code
#include <NfcAdapter.h>
#include <PN532/PN532/PN532.h>
#if 0
#include <SPI.h>
#include <PN532/PN532_SPI/PN532_SPI.h>
PN532_SPI pn532spi(SPI, 10);
NfcAdapter nfc = NfcAdapter(pn532spi);
#else
#include <Wire.h>
#include <PN532/PN532_I2C/PN532_I2C.h>
PN532_I2C pn532_i2c(Wire);
NfcAdapter nfc = NfcAdapter(pn532_i2c);
#endif
void setup() {
SERIAL.begin(9600);
SERIAL.println("NDEF Writer");
nfc.begin();
}
void loop() {
SERIAL.println("\nPlace a formatted Mifare Classic or Ultralight NFC tag on the reader.");
if (nfc.tagPresent()) {
NdefMessage message = NdefMessage();
message.addUriRecord("http://arduino.cc");
bool success = nfc.write(message);
if (success) {
SERIAL.println("Success. Try reading this tag with your phone.");
} else {
SERIAL.println("Write failed.");
}
}
delay(5000);
}
To test the code:
- Open the Arduino Serial monitor window
- Set the baudrate to 115200
- Hold an NFC tag over the NFC antenna area
- The NFC shield will scan the tag and you should be able to see the NFC tag’s UID, tag type, and message (if available) in the serial monitor window. See the figure below.
FAQs
Q1: What's the length of the cable? And how long it can be if I want a longer one?
A1: The cable we sold with NFC shield is 12cm. If you want a longer one yourself, please no more than 15cm with a IPX/U.FL connector.
Q2: Can two or more antennae be added to NFC Shield V2.0 (SKU: 113030001)?
A2: NFC shield v2 is based on PN532 chip. Please note that the design only supports one antenna.
NFC Shield v2.0 Eagle File Schematic Online Viewer
NFC Shield v2.1 Eagle File Schematic Online Viewer
Resources
- NFC Shield v2.0 Schematic
- NFC Shield v2.0 Eagle File
- NFC Shield v2.1 Schematic
- NFC Shield v2.1 Eagle File
- PN532 Datasheet
- FAQ of NFC Shield
- Seeed Arduino NFC Library
- PN532 Libraryaaa
Project
Paper Man An interesting way to communicate with your Android device through the NFC technology.
NFC Card Controlled Remote Car Challenge your coordination: build your own NFC-controlled car
Tech Support & Product Discussion
Thank you for choosing our products! We are here to provide you with different support to ensure that your experience with our products is as smooth as possible. We offer several communication channels to cater to different preferences and needs.