paint-brush
Custom RFID and NFC Device Development: Theory and Practiceby@andreysolovev
1,052 reads
1,052 reads

Custom RFID and NFC Device Development: Theory and Practice

by Andrey SolovevOctober 10th, 2022
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

RFID and NFC technologies are two similar technologies used in many industries. Their fields of application include inventory tracking, location tracking, access control, contactless payments, logistics, manufacturing, marketing, retail, and more. In this article, we are going to talk about these systems from an electronics design perspective. We will also take a look at RFID/NFC device development cases. Here are the key differences between RFID technology and NFC systems in our previous article.

Companies Mentioned

Mention Thumbnail
Mention Thumbnail

Coins Mentioned

Mention Thumbnail
Mention Thumbnail
featured image - Custom RFID and NFC Device Development: Theory and Practice
Andrey Solovev HackerNoon profile picture

Radio-frequency identification and near-field communication are two similar technologies used in many industries. Their fields of application include inventory tracking, location tracking, access control, contactless payments, logistics, manufacturing, marketing, retail, and more. In this article, we are going to talk about these systems from an electronics design perspective. We will also take a look at RFID and NFC device development cases.

How do RFID and NFC Technologies Work?

Radio-frequency identification (RFID) is a wireless communication technology that uses radio waves to uniquely identify tagged items. A radio-frequency identification system generally consists of three elements: a reader, a tag, and RFID software. The RFID tag carries unique ID information and other data associated with the item it is placed on. When activated, the reader sends radio waves. The waves power any tags within the interrogation zone. They send back the data to the reader. The software processes the raw data for the end user.

Radio-frequency identification allows you to track and identify unique items and people. For this reason, RFID technology is used in many spheres: asset and location tracking, inventory management, access control, theft prevention, etc. Near field communication (NFC) is a short-range wireless communication technology that uses high-frequency radio waves to uniquely identify tagged items and exchange data with other NFC-enabled devices. While RFID uses a broad range of radio frequencies, NFC devices work at 13.56 MHz only. This technology evolved from RFID and can be regarded as its fine-tuned subset.

NFC technology is commonly used in contactless payment terminals in retail stores.

NFC systems consist of the same elements as RFID: a reader (called initiator), a tag (called target), and NFC software. They work the same way as RFID systems. However, they have a much shorter operating range (up to several centimeters). That is why near field communication is primarily used in contactless payment. Nevertheless, other applications similar to that of RFID systems are also possible. Unlike RFID, NFC devices are capable of two-way communication. So, they are also used where data exchange is required.

These technologies are very similar, but suit different business tasks.

NFC systems can work in active or passive modes of communication.

In passive mode, one active device (Initiator) generates a radio-frequency field. The passive device (Target) draws power from the alternating magnetic field and acts as a transponder. It uses load modulation for data transferring. 

In active mode, both the Initiator and the Target are active and generate magnetic fields in turns. The field deactivates while the device is waiting for data and activates when the device is ready to respond.

An active NFC device can work in any of these operating modes:

Card emulation mode. The device acts as a contactless smart card. The radio-frequency field is generated by the reader. Typical application: smartphone as an instrument of payment. Reader/writer mode. The device acts as a reader for NFC and RFID tags. When the tag is close enough, the device detects it with a collision avoidance mechanism. Then it can read the data from the tag or write new information to it. Typical application: smart posters.Peer-to-peer mode. Both devices act as a reader and a tag to alternately transmit and receive data. It allows them to exchange information such as pictures, business cards, etc. Android Beam technology uses this mode. 

Here are the key differences between RFID and NFC systems. You can learn more about these and other differences and the applications of RFID and NFC systems in our previous article.

RFID and NFC Tags

RFID Tags

RFID and NFC tags consist of three elements: a substrate, an antenna, and a microchip. Tags come in various shapes and sizes: plastic cards, key fobs, paper or plastic stickers, badges, etc. The microchip is responsible for the signal modulation and demodulation. It also stores and processes information.

There are three types of RFID tags: 

Passive tags do not have a power source. In order to function, they use the energy from the reader’s radio signal.Active tags have their own power source (usually a small battery). It allows them to transmit signals periodically. The battery boosts the signal. Active tags can be read from longer distances.Semi-passive (battery-assisted passive) tags also use batteries but do not transmit periodic signals. When the tag receives the signal from the reader, the battery only turns on the tag. So, all the energy from the reader’s signal is reflected back. They also have a longer range than passive tags. 

RFID systems can operate at different frequencies. They commonly use the following radio frequency bands. Note that the bands are defined by national standards and regulations.

Low frequency band, particularly 120-140 kHz. In ideal conditions, these radio waves can travel up to 50 cm. But in practice, their range does not exceed 10-20 cm. LF RFID tags do not have security standards. So, they are not recommended for applications requiring encrypted communication. They can also penetrate through metals and liquids. High frequency band, particularly 13.56 MHz. The read range of these systems usually varies from 10 to 20 cm but can reach about 1 m. HF RFID tags cannot penetrate through liquids and dense metals but work fine with most other materials including thin metals.Ultra-high frequency tags operate at frequencies of 865–868 MHz (Europe) and 902–928 MHz (North America). Their reading range usually does not exceed 12 m. Note that some UHF RFID systems use 433 MHz and can reach up to 100 m.

Some RFID tags operate at 2.45-5.8 GHz, 3.1-10 GHz, and 24.125 GHz. However, frequency bands higher than 928 MHz are not common for commercial RFID tags. Most civil-grade systems use LF, HF, and UHF tags. 

NFC Tags

Near field communication utilizes the same frequency as HF RFID tags – 13.56 MHz. NFC-Forum defines the following types of NFC tags.

Note that custom RFID and NFC systems usually do not require custom tags. However, one may require to design a non-standard device with a reader, which includes custom PCB design and embedded software development.

RFID and NFC Readers

NFC devices can work as readers and tags. RFID readers can only scan tags. Readers consist of an oscillator, transceiver, receiver, control unit (processor), and an external antenna. They come in three form factors: 

- Mobile (handheld) readers that often have the shape of a pistol; 

- Fixed readers that can be attached to walls or near doors;

- Vehicle-mounted readers that are often integrated into material handling devices.

The reading range of RFID and NFC readers depends on their transmitting power. This, in turn, is defined by the type of antenna, the operating frequencies, and the power source. Environmental conditions and local regulations can cap the reader’s maximum range as well. 

Many RFID-enabled devices have an integrated NFC module, which enables them to read both RFID and NFC tags. They can also have a few additional modules: a 1D/2D scanner, a camera, GPS, or a cellular connection (in case Wi-Fi is unavailable).

RFID readers can be either active or passive. Depending the type of readers and tags, RFID systems can be classified as follows:

PRAT (Passive Reader Active Tag) systems. The reader has no power source and can only receive data from active tags.

ARPT (Active Reader Passive Tag) systems. The reader sends interrogation signals to passive tags and powers them. 

ARAT (Active Reader Active Tag) systems. Both elements have power sources. Semi-passive tags can also be used here.

Unlike NFC devices, RFID readers can scan multiple tags simultaneously with one of these anti-collision algorithms: either probabilistic or deterministic detection. 

To transmit the data from the reader to a host computer, several network connection types can be used. Fixed readers usually utilize USB, serial interface, Ethernet, Wi-Fi, and POE. Mobile models usually use Wi-Fi, Bluetooth, and USB. These network connections can also be used to charge the device.

Custom RFID and NFC Device Development

Usually, one has a number of options here. 

If it is possible to create the system with off-the-shelf (OTS) readers and tags, then all you need is to develop software. In some cases, one can even purchase OTS software packages for RFID and NFC systems. However, there are relatively few of them. 

Due to complicated or specific tasks, businesses may also require custom-design readers and, thus, custom NFC or RFID hardware development. Non-standard applications and requirements will probably need a research and development stage. As for tags, engineers usually use OTS models even for custom solutions. Manufacturers offer so many models that there is no need to reinvent the wheel. 

Designing a printed circuit board for an RFID or NFC-enabled device starts with choosing a suitable reader. The choice is defined by various factors: the required read range, frequency band, environmental conditions, etc. The PCB will also require a microcontroller or a microprocessor, as well as various passive components. Another obligatory component is the antenna, but it is placed outside the board. Depending on what additional functions the device must perform, the team may need to mount additional modules and components. 

Custom NFC and RFID device development also involves software design. Such systems typically require three types of software.

1. Firmware that manages the work of the hardware. Tags come with firmware developed by the manufacturer and don’t require any changes. But designing a custom reader also includes RFID or NFC firmware development. Simpler solutions can be written in C, while more complex devices will most likely be written in C++. 

2. Application, i.e. the highest-level software that manages the processed data, collected with the reader, to address particular business needs.

3. Middleware, i.e. the software between the firmware and the high-level application. As a rule, NFC systems do not require middleware, unless an NFC-enabled device serves as an intermediate link between the tag and an enterprise information system, which is uncommon. Middleware is more common for RFID systems.Middleware connects the readers and the data they collect with the application or enterprise information system. It processes the raw data coming from the readers before passing it on as aggregated data. It also provides an application-level interface for managing readers and querying data.

The middleware and the application level software can be written in C++, C#, Python, Java, and other languages. The choice is defined by the system’s size, the complexity of its tasks, and hardware requirements. When there’s a need for cross-platform solutions, Qt development is a better option. The most important requirements for the language for middleware is the ability to reach the hardware on the one hand and to interact with the high-level software on the other hand.

The following cases demonstrate two projects from our portfolio that involved custom RFID and NFC device development. 

Case #1: Custom RFID Device Development

Our customer wanted to develop an RFID system for livestock enterprises to identify animals, track their movements, and collect other data for timely disease diagnostics. Our job was to design a handheld RFID data terminal for this system. 

Our RFID device development resulted in a data terminal operating at 860-960 MHz with multiple modules. The terminal can read multiple tags simultaneously from a distance of several meters.

For this project, our team developed a custom single-board computer  based on the STM32MP151AAD3 microprocessor with one Arm® Cortex®-A7 core for high-level operations and one Cortex®-M4 core for low-level operations. This microprocessor features a low price and allows us to curb the number of components to make the device smaller but more energy efficient. Pared with the microprocessor, the device also uses energy-saving 1GB MT41K512M16HA-125A SDRAM-DDR3L memory and 4GB EMMC04G-MK27-A01C FLASH-NAND (MLC) memory with eMMC interface. 

The RFID reading function is implemented with the ST25RU3980 single chip reader. It’s a highly-integrated solution compatible with ISO 18000-6C/EPC Class1 Gen2 transponders. The reader is battery-powered and features very low power consumption. Pared with a custom patch antenna, it provides a very high sensitivity and resistance to reflection and self-clutter effects.

The ESP32-C3-MINI-1-N4 module with an integrated PCB antenna is responsible for the WiFi 802.11b/g/n and Bluetooth v5.0 interfaces. They allow the device to connect to local data networks. The Telit ME310G1W103T040100 module is responsible for cellular connection and data transmission in the field.

The device is also equipped with a Newland EM2096 module for scanning 1D and 2D barcodes. The team used a USB Type C Amphenol 124019322112A connector for data transmission over USB 2.0 and battery charging. It has IPX4 level of protection, which makes it suitable for outdoor applications. 

The terminal is also equipped with an MC6470 inertial measurement unit. It allows businesses to track the location of the device, which can be important for keeping record of its work. 

The device is powered with a 3.7V 12Ah single-cell Li-ion battery, which should be enough for a 12-hour shift. 

The scope of work also included firmware and software development. For the microprocessor, the team used the Android distribution package provided by the manufacturer. We developed the firmware in C for the ESP32-C3-MINI-1-N4 module with programming libraries. It is controlled by the microprocessor with the help of AT commands. We also wrote a custom driver in C for the RFID reader, as it uses an SPI interface. Other modules use standard drivers.

Case #2: Custom NFC Device Development

This case demonstrates how NFC technology can be adapted for non-standard use. The project involved both custom NFC hardware and software development. Our job was to design an NFC-enabled device for orienteering events and location-based games. 

With the device we created, event participants can scan NFC tags placed on control points. The reader then transmits the data to a host computer used by the administration to let them know which team reached the point. The device can also perform a number of other tasks.

The device is based on an NXP PN7362BNHN microcontroller. It has an integrated radio interface with NFC support and low energy consumption for autonomous work. The microcontroller has all the necessary NFC components inside. The team only had to add impedance-matching circuits. It also has enough memory capacity (160 KB) for complex algorithms. 

As the microcontroller has an integrated radio interface, it is also responsible for reading NFC tags. The microcontroller is paired with a passive, small-size flexible antenna – Pulse/Larsen W7001. The system supports all protocols and modes defined by NFC-Forum. It features high sensitivity and stability. Its read range equals 40 mm.  

Data transmission in field conditions is implemented with a Quectel MC60ECB-04-BLE module. It has an integrated navigation receiver (GPS/GLONASS/Galileo/BeiDou/QZSS) and supports 2G cellular communication. The module supports navigation, based on GSM signals, and multiple data transmission protocols (TCP/UDP/FTP/PPP/HTTP/NITZ/NTP/PING/HTTPS/TCP/SSL/MQTT). 

It allows the device to send data to the administration as well as receive various messages: confirmations, warnings, hints, statistics, etc. The information is displayed on a monochrome graphic display (Orient Display JAZZ-BC-W).

The device is equipped with an emergency button. When it is pressed, the device sends an emergency signal to the host computer along with location data. The device’s location is tracked with an MC6470 inertial measurement unit.

The device is powered by a built-in single-cell 3.7V 1.2Ah Li-ion battery. It can work over 8 hours on a single charge. Using the energy-saving mode of the microcontroller can extend this period. The device is fitted with a USB Type C Amphenol 124019322112A connector, so it is well protected against moisture and dust. 

The software development team wrote firmware for the microcontroller in C using an AT command library to control the 2G module.

Conclusion

In most cases, one can use off-the-shelf RFID and NFC systems. Different types of readers and tags suit different purposes. Technical characteristics of the devices, such as operating frequency, power source, or memory capacity, define the system’s read range, penetration capability, etc. With off-the-shelf elements, it is only a matter of software design. But sometimes, complicated or non-standard tasks can require a custom solution. 

RFID and NFC device development involves designing a custom PCB, as well as embedded firmware and software development. Depending on what tasks the system must perform, the team can also install additional components, so that the device could work in field conditions, or scan 1D/2D codes, and so on.

This story was first published here.