Near Field Communication (NFC) is a wireless communication technology that acts over short distances for two-way communication. The use of NFC tags is growing in several markets, including the medical, consumer, retail, industrial, automotive, and smart grid markets. NFC is a type of Radio-Frequency Identification (RFID) technology.
When two NFC enabled devices are very close to each other, about 4 cm or less, they can communicate with each other using the radio waves. Of the two devices communicating using NFC, at least of them has to be an active device (powered). In many cases, this would be a smartphone, tablet, security pad, or a payment terminal. The other device can be either active or passive (unpowered). Using NFC, two devices can be set up in less than one-tenth of a second.
NFC supports three modes of communication: peer-to-peer, read/write mode, and card emulation.
Peer-to-Peer (P2P) Mode
In an active peer-to-peer (P2P) mode, two active devices create a wireless communication channel between them. The active device, with an external power supply, can power the passive device with the electromagnetic field coming from the active device. NFC passive devices are used in many applications because the passive NFC device can be a simple tag.
NFC devices communicate with each other via radio waves. The active NFC device has to be enabled (turned on) first. The radio waves for NFC are generated using an antenna. NFC works by exploiting the properties of electromagnetic fields, using the inductive coupling between NFC devices. It operates at the 13.56 MHz frequency, which is a license-free section of HF on the RF spectrum. (As a comparison, Wi-Fi commonly operates at 2.4 and 5 GHz).
As an example of active P2P communication, a smartphone might have an antenna that’s on the battery or case. People can share information using two smartphones as active devices, with the smartphones alternately generating radio waves. While one active NFC device sends signals, the other one listens. In the active P2P mode, both devices generate the radio wave alternately at a carrier frequency of 13.56 MHz. This is how people can share information and files with each other through NFC versus Bluetooth, for instance.
There is also a passive P2P mode. Passive NFC tags do not need a power supply because they take advantage of the slight current generated by the inductive coupling. NFC uses a compact antenna pattern that fits onto a retail tag, sticker, or card.
The second mode is the reader/writer mode.
One example is when you access data from the NFC tag using another NFC device (e.g., a smartphone). In reader/writer mode, an active device like a smartphone or tablet reads or writes the data on the NFC tag. An active device can read data from an NFC tag by generating a radio wave using the 13.56 MHz carrier frequency.
The waves from the active device interact with the antenna of the passive NFC tag. The NFC tag “harvests” the energy from the time-varying electromagnetic field made by the active device. This creates enough voltage for the NFC tag to rectify it and power up the chip inside the NFC tag. The chip is tiny and has a clock, rectifier circuit, some memory and a simple controller.
Once the chip has power, the tag can respond to the active device using a technique called load modulation, and data gets sent to the active device.
Card Emulation Mode
Card emulation is the third mode, which is very much like reader/writer mode. A common use case is when smartphones are used to make mobile payments. In this case, a smartphone acts as a passive smart card for the benefit of a payment terminal. The smartphone does not generate radio waves but does respond back to the payment terminal with the requested data.
DIY NFC using your smartphone
NFC standards are derived from existing radio communication standards, and are known as NFC-A, NFC-B, NFC-F, and NFC-V. However, you don’t need to read a standard to start using NFC, as much of it is already set up for you in a smartphone. For instance, you can experiment with your smartphone’s NFC capabilities using an app called NFC Tools. NFC Tools allows you to read, write and program tasks on NFC tags or otherwise RFID compatible chips. The NFC Tools app for smartphones lets you program tasks on an NFC tag to automate repetitive actions. According to NFC Tools’ description on the Google Play Store, “For example, a simple motion with your phone in front of your NFC tag before going to sleep and the WiFi will turn off, the phone will switch to silence and your alarm will be set for the next morning, all by itself.” NFC Tools’ description identifies several compatible NFC tags that you can buy (differentiated by the chip on the tags) such as NTAG 203, 210, 212, 213, 215, 216; Topaz 512 (BCM512), Ultralight and Ultralight C; MIFARE Classic 1k and 4k; and FeliCa.
As for using an MCU as an active NFC device, you can get Arduino NFC shields as a ready-made module solution from companies like Adafruit, which has the Adafruit PN532 NFC/RFID controller shield for various Arduino MCUs. Seeed Studio’s NFC shield and Grove RFID transponder tools are also an option for NFC with Arduino MCUs.