What is Near Field Communication (NFC)
NFC, in short for Near Field Communications is a technology standard based on Radio Frequency Identification (RFID), transmitting information wirelessly over short distances. Think of it as an authentication-free Bluetooth!
NFC Sense can detect the movement of objects using only NFC tags
NFC (Near-Field Communication) technology is generally used for identification, because NFC tags can carry a substantial amount of data, like a unique identifier or a text file, without a battery. But NFC readers are capable of reading tags quite quickly, which is a feature that is largely ignored. NFC Sense, takes advantage of that read speed to measure the movement of objects.
NFC Sense only requires a computer, an Arduino Uno board, a cheap RC522-based NFC/RFID reader, and a few NFC tags. It works a lot like a Hall effect sensor by detecting the presence of an NFC tag and using that to calculate the motion of an object. For example, if you attach an NFC tag to the wheel of a bicycle, you can calculate the bicycle’s movement speed by counting how much time passes between moments that the tag is detectable.
The advantage of using NFC, when compared to a Hall effect sensor and magnet, is that each tag is identifiable. That means that NFC Sense can differentiate between individual tags. It can monitor the movement of a virtually unlimited number of objects or provide better resolution of singular objects. If the entire perimeter of a wheel were lined with NFC tags, NFC Sense could recognize the rotational angle of the wheel at any given time.
Jump into the world of Near Field Communications (NFC), the fast-growing technology that lets devices in close proximity exchange data, using radio signals. With lots of examples, sample code, exercises, and step-by-step projects, this hands-on guide shows you how to build NFC applications for Android, the Arduino microcontroller, and embedded Linux devices.
You’ll learn how to write apps using the NFC Data Exchange Format (NDEF) inPhoneGap, Arduino, and node.js that help devices read messages from passive NFCtags and exchange data with other NFC-enabled devices. If you know HTML andJavaScript, you’re ready to start with NFC.
Dig into NFC’s architecture, and learn how it’s related to RFID
Write sample apps for Android with PhoneGap and its NFC plugin
Dive into NDEF: examine existing tag-writer apps and build your own
Listen for and filter NDEF messages, using PhoneGap event listeners
Build a full Android app to control lights and music in your home
Create a hotel registration app with Arduino, from check-in to door lock
Write peer-to-peer NFC messages between two Android devices
Explore embedded Linux applications, using examples on Raspberry Pi and Beagle Bone.
Active NFC |
Passive NFC |
---|---|
Has a power source |
Has no power source, connects to active devices |
Present in Smartphones; Apple, Andriod, etc. |
NFC tags, other small transmitters |
How is it powered then?
As mention in the earlier comparison, passive NFC devices connect to active ones, and this screen is no exception. As long as you have a smartphone with NFC function, you can use it to control this screen and transmit images to it!
No battery, no cables, no trouble, just passive NFC technology by swiping like a credit card!
Interested to find out more about it? You can head to our product page!
Main applications of NFC
Mobile payments; Apple Pay NFC, Google Wallet
Tap-to-Pair; Pairing Bluetooth devices just by tapping, instead of manual entering
Embedding digital experience in physical products; NFC’s small form factor allows for it to be embedded into physical products, enabling a unique experience when interacted
Security
Password replacement
Product Authentication
Want to find out more about the differences between NFC and RFID? Check out this article!
What is PN532
Now that we’ve understood more about NFC and its applications, I’ll quickly introduce PN532 before moving on to an integrated module.
PN532 is an NFC controller by NXP that’s based on the 80C51 microcontroller, allowing for contactless communication at 13.56 MHz. Furthermore, the support for MIFARE Classic 1K/MIFARE Classic 4K card allows for higher transfer speeds up to 424 kbit/s in both directions.
Features:
80C51 microcontroller core with 40 KB ROM and 1 KB RAM
Highly integrated demodulator and decoder
Integrated RF level detector
Supports ISO/IEC 14443A/MIFARE
Supports ISO/IEC 14443B (Reader/Writer mode only)
Up to 50mm of operating distance in Reader/Writer mode for communication to ISO/IEC 14443A/MIFARE, ISO/IEC 14443B or FeliCa cards
Up to 50mm of operating distance in NFCIP-1 depending on antenna size, tuning, and power supply
Approximately 100mm of operating distance in ISO/IEC 14443A/MIFARE or FeliCa card emulation mode
Possibility to communicate on the RF interface above 424 kbit/s using external analog components
Dedicated host interrupts
Low power modes
Hard-Power-Down mode
Soft-Power-Down mode
Programmable timers
Crystal oscillator
2.7 to 5.5 V power supply operating range
As the full list of PN532’s features may be exhaustive, I’ll only be highlighting the key ones. For the full list of features and benefits, you can check out PN532 datasheet!
PN532 NFC Module: Grove – NFC
Now that we’ve talked about NFC and PN532, let’s put them together and take a look at a pn532 NFC module, unlike other breakout boards!
What’s good about the Grove – NFC PN532 Module?
Flexibility
The PN532 allows for microcontroller pairing flexibility, with support for I2C, and UART interfaces.
Independent PCB antenna
What comes with this PN532 module is an independent PCB antenna that can easily stretch out of any enclosure you use, leaving more room for you to design the exterior of your project!
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.
Support P2P communication.
Dimensions: 25.43mm x 20.35mm
Looking for a PN532 NFC shield instead? Not to worry, we provide just that!
PN532 NFC Shield V2.0
Built around the PN532 module, this NFC shield allows for a 5cm max effective range, with support for SPI interface, allowing you to stack it on your Arduino boards!
Key Features include:
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
Note: This NFC shield can be used for Raspberry Pi as well, but you’ll need to modify the library
Interested in finding out more on the NFC Shield? You can head to its product page to find out more!
What about a PN532 NFC Hat for your Raspberry Pi, Arduino or STM32 boards? We got you covered too!
PN232 NFC Hat for Raspberry Pi, Arduino, STM32
This is an NFC HAT based on PN532 operating in the 13.56MHz frequency range that not only supports Raspberry Pi with its GPIO pins, it easily works on host boards like STM32 and Arduino as well!
Its features include:
Standard Raspberry Pi 40PIN GPIO extension header, supports Raspberry Pi series boards
Onboard PN532 chip, supports various NFC/RFID cards like MIFARE/NTAG2xx, etc.
Three interface options: I2C, SPI, and UART, configured via jumpers and switches
Breakout control pins, for easily connecting with host boards like STM32/Arduino
Comes with development resources and manual (examples for Raspberry Python/C, STM32, Arduino)
Interested in finding out more on the NFC Shield? You can head to its product page to find out more!
Getting Started with PN532: Arduino Guide
Before we begin with the Arduino Guide, do consider if you need interface changes into I2C. If needed, you should cut the UART connection and solder the I2C pins as below: