Grove - NFC
Near Field Communication (NFC) is a set of short-range wireless technologies. It is behind daily applications such as access control system and mobile payment system. Grove NFC features a highly integrated transceiver module PN532 which handles contactless communication at 13.56MHz. You can read and write a 13.56MHz tag with this module or implement point to point data exchange with two NFCs. Grove NFC is designed to use I2C or UART communication protocols, and UART is the default mode. In addition, we assign an independent PCB antenna which can easily stretch out of any enclosure you use, leaving more room for you to design the exterior of your project.
Version
Version | Data | Change |
---|---|---|
Grove NFC V1.0 | December 11,2015 | inital |
Grove NFC V1.1 | Augest 31,2016 | Add TP2/TP3 Pad on the back of the PCB, to switch the I2C and UART |
Specifications
- Working Voltage: 3.3V
- Working Current:
- Static Mode: 73mA
- Write/Read Mode: 83mA
- Support host interface: I2C, UART(default).
- Serve for contactless communication at 13.56MHz.
- Support ISO14443 Type A and Type B protocols.
- Max operating distance for detecting NFC tags is 28mm depending on current antenna size.
- Dimensions: 25.43mm x 20.35mm
More details about Grove modules please refer to Grove System
Platforms Supported
Arduino | Raspberry Pi | |||
---|---|---|---|---|
The platforms mentioned above as supported is/are an indication of the module's software or theoritical compatibility. We only provide software library or code examples for Arduino platform in most cases. It is not possible to provide software library / demo code for all possible MCU platforms. Hence, users have to write their own software library.
Hardware overview
Grove NFC v1.0
The default setting is UART, if you need to change it into I2C, then you should do some soldering at first.
Cut following connections:
- TP1 to UART
- TP2 to RX
- TP3 to TX
Solder following connections:
- TP1 to I2C
- TP2 to SCL
- TP3 to SDA
Grove NFC v1.1
The default setting is UART, if you need to change it into I2C, then you should cut the UART connection and then solder the I2C pins as below.
Getting Started
If this is the first time you work with Arduino, we strongly recommend you to see Getting Started with Arduino before the start.
The Grove - NFC supports I2C and UART, Seeed Arduino NFC Library supports Arduino Uno/Seeeduino v4.2, Arduino Mega/Seeeduino Mega, Arduino Zero/Seeeduino Lorawan and Arduino Leonardo/Seeeduino Lite.
Play with Seeeduino Lite
Hardware
Materials required
Seeeduino Lite | Base Shield | Grove - NFC | NFC Tags |
---|---|---|---|
Get One Now | Get One Now | Get One Now | Please Prepare yourself |
Step 1. Connect Grove - NFC to port UART of Grove-Base Shield.
Step 2. Plug Grove - Base Shield into Seeeduino Lite.
Step 3. Connect Seeeduino Lite to PC via a USB cable
Software
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.
xiao may have pin compatibility issues.
#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
Step 5. Upload the code. If you do not know how to upload the code, please check How to upload code.
Step 6. Open the Serial Monitor of Arduino IDE by click Tool-> Serial Monitor. Or tap the ctrl+shift+m key at the same time. Set the baud Rate 9600.
Step 7. Use the Grove - NFC to get close to an NFC Tag. If everything goes well, you will get the NFC Tag information in the Serial Monitor.
If you want to connect to Arduino Mega UART ports, You can change the PN532_HSU pn532hsu(Serial1) to PN532_HSU pn532hsu(SerialX). X stands for the arduino mega serial port you use. If you want to connect Grove-NFC sensors to Arduino Uno, you can use the software serial. Please follow below to configure software serial.
#if 0 // use SPI
#include <SPI.h>
#include <PN532/PN532_SPI/PN532_SPI.h>
PN532_SPI pn532spi(SPI, 9);
NfcAdapter nfc = NfcAdapter(pn532spi);
#elif 0 // use hardware serial
#include <PN532/PN532_HSU/PN532_HSU.h>
PN532_HSU pn532hsu(Serial1);
NfcAdapter nfc(pn532hsu);
#elif 1 // use software serial
#include <PN532/PN532_SWHSU/PN532_SWHSU.h>
#include "SoftwareSerial.h"
SoftwareSerial SWSerial(2, 3);
PN532_SWHSU pn532swhsu(SWSerial);
NfcAdapter nfc(pn532swhsu);
#else //use I2C
#include <Wire.h>
#include <PN532/PN532_I2C/PN532_I2C.h>
PN532_I2C pn532_i2c(Wire);
NfcAdapter nfc = NfcAdapter(pn532_i2c);
#endif
Play with Seeedunio V4.2
Hardware
Materials required
Seeeduino V4.2 | Base Shield | Grove - NFC | NFC Tags |
---|---|---|---|
Get One Now | Get One Now | Get One Now | Please Prepare yourself |
1. Please choose 13.5MHZ, ISO14443 NFC Tags, or the Grove - NFC module may can not read the tag.
2. Please plug the USB cable gently, otherwise you may damage the port. Please use the USB cable with 4 wires inside, the 2 wires cable can't transfer data. If you are not sure about the wire you have, you can click here to buy
3. Each Grove module comes with a Grove cable when you buy. In case you lose the Grove cable, you can click here to buy.
4. For this demo, you can work without the baseshild, for the Seeeduino V4.2 has a on-board Grove I2C connector.
Step 1. Connect Grove - NFC to port I2C of Grove-Base Shield. Please make sure you follow hardware overview to change the default UART setting to I2C.
Step 2. Plug Grove - Base Shield into Seeeduino V4.2.
Step 3. Connect Seeeduino V4.2 to PC via a USB cable
Software
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
Step 5. Upload the code. If you do not know how to upload the code, please check How to upload code.
Step 6. Open the Serial Monitor of Arduino IDE by click Tool-> Serial Monitor. Or tap the ++ctrl+shift+m++ key at the same time. Set the baud Rate 9600
Step 7. Use the Grove - NFC to get close to an NFC Tag. If everything goes well, you will get the NFC Tag information in the Serial Monitor.
Grove - NFC v1.0
Grove - NFC v1.1
Resources
- [Zip] Grove - NFC v1.0 EAGLE (schematic and board) files
- [Zip] Grove - NFC v1.1 EAGLE (schematic and board) files
- [PDF] PN532 Datasheet PDF
- [Library] Seeed Arduino NFC Library
Project
Particle Photon + Grove NFC + Grove LCD via I2C Use Particle Photon to read UID of a NFC Card and display on LCD, all with I2C.
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.