What is an NFC tag - how to program it, examples of use


NFC is rightfully considered one of the modern technologies, ensuring the joint operation of mobile devices. For these purposes, special NFC tags have been developed, with the help of which synchronization is carried out literally in one touch. Tags are made in the form of miniature stickers, stickers, or other, more durable configurations. This service is not yet widely used. Next, we’ll look at what an NFC tag is, how to program it, and examples of use.

Why NFC technology was created

This technology was developed for a smartphone in order to establish communication with other devices located at close range. The average range is 4-5 cm, which is quite enough for a two-way wireless connection. At the same time, both devices involved in the chain can exchange information. This type of connection works independently of other communication methods - Wi-Fi, Bluetooth, 3G, LTE, etc. Using NFC is completely free.

A typical example of this technology is modern bank cards equipped with chips for contactless payments. This also includes social cards used to pay for travel on public transport. The NFC function is supported by most modern smartphones using special Google Pay services.

NFC operation algorithm

It is based on the principle of electromagnetic induction. NFC tags are electromagnetic coils that do not have their own energy source. For current to occur, they must fall within the range of an active device with a module capable of reading information. The data volumes are small. More often this is a written algorithm that allows you to run a certain function on a smartphone. For example:

  1. Enable or disable the Wi-Fi module.
  2. Starting the Bluetooth protocol.
  3. Follow the link in the browser.
  4. Adjusting the speaker volume.
  5. Change the brightness level of your phone screen.
  6. Transfer of owner data.
  7. Transfer of a code that acts as a pass or key.
  8. Bank cards with NFC are used to pay at terminals.

NFC, like RFID, has an initiator and a target in an exchange, but the new technology does much more than simply exchange an identifier and read or write the target's information. The most significant difference between the two technologies is that NFC targets are often programmable devices such as smartphones. This means that it is possible to exchange not only static data, but also to generate a response to the information requested by the initiator each time.

NFC devices have two interaction modes. If the initiator emits radio frequency waves, and the target receives power due to the initiator, then this mode of interaction is called passive. In active mode, the initiator and target have their own power sources and are independent of each other. These modes are the same as RFID modes.

NFC devices also have three operating methods. They can operate in the mode of reading information from the target or writing to it. They can emulate cards, behaving like RFID tags when they are in the field of another NFC or RFID device. Or they can operate in peer-to-peer (P2P) mode, in which they exchange data in both directions at once.

The first main difference between NFC and RFID is the peer-to-peer interaction method, which is implemented using GOST R ISO/IEC 18092. P2P data exchange is implemented by two protocols - the logical link control protocol (LLCP) and a simple exchange protocol NDEF data (SNEP - simple NDEF exchange format).

What is an NFC tag

A standard NFS mark is a small sticker, slightly thicker than a sheet of regular paper. In essence, it is a round antenna on a flexible base, approximately 25 mm in diameter. This sticker can be easily and conveniently fixed in any place. In fact, the NFC antenna is a passive microchip that provides contactless communication. It does not require any energy to operate since it cannot transmit information.

Tags can only be used and programmed using a smartphone or iPhone equipped with a built-in chip. If it is not available, you must purchase an external NFC module separately, which is located inside or outside the device. To further work with stickers, you will need to install a special program on your phone. Next, you need to think about the placement of the stickers, using the most convenient places.

How to make an NFS mark with your own hands

Most users do not want to configure the tags themselves for fear of damaging it. In this case, the absence of a program makes the device useless, since it will not transmit a signal. In fact, NFC tags are quite easy to set up using a smartphone.

To do this, you need to use special applications. You can configure the device using NFCTools or NFCTasks. Both programs have a built-in English interface. But almost any user with basic knowledge can understand them. In addition, there is always a translator on the Internet.

Types of payment tags

All tags are manufactured according to the international standard ISO 14443. Conventionally, they are divided into 4 types, depending on their characteristics. They are determined by the amount of data and the speed at which it is transferred. At first glance, these parameters may seem insufficient compared to other technologies. However, for performing one-time tasks on command from a short distance, this is quite enough. All basic actions are performed by the smartphone.

All microchips can be written and rewritten many times, without any restrictions. Their classification is as follows:

  • Types 1 and 2 are equipped with 48 bytes and 2 kbytes of memory, respectively. Signal transmission is carried out at a speed of 106 kbit/s.
  • Type 3. Label without the possibility of rewriting. However, they are capable of solving more complex problems, and the transmission speed is much higher - 106 kbit/s.
  • Type 4. The most powerful and productive. The internal memory reaches 32 kbytes, and information can be transmitted at a speed of 106-424 kbps.

Scenarios for using NFC tags

There are quite a few options for using tags in practice, and all of them, to one degree or another, make it easier to use certain devices and significantly speed up the performance of regular routine actions. Below are the areas where NFC is used most often.

NFC tag instead of WI-FI password

The simplest and most popular use of NFC is to quickly connect a smartphone to a Wi-Fi network. This is especially true for those who constantly deal with new gadgets. If the router has a rather complex and long password, then entering it manually every time will not be very convenient.

However, after programming certain actions, this procedure becomes simpler. Bring your smartphone close enough to the router, and the connection will be established immediately. This scheme is ideal in public places where visitors are provided with the opportunity to connect to the wireless Internet.

How to use

Setting up microchips, as well as their use, is used in different areas of life, it all depends on the imagination of the users. Advanced youth install stickers throughout the house, which definitely makes life easier. Several life hacks on how to correctly record microtags, with examples of use:

  1. Internet distribution. Program the microchip to distribute the mobile network via WI-FI. Then fix it on your personal computer or laptop. Let’s assume this situation: the wired network disappears, the user brings the smartphone to the sticker and starts distributing the network via WI-FI. Very fast and simple.
  2. Night mode. The microtag is programmed to trigger a change in the operating mode of the smartphone. The chip is fixed in a convenient place in the bedroom, after touching the chip, the mobile device automatically lowers the sound, lowers the brightness level or goes into silent mode. If desired, you can program a separate tag to activate the alarm.
  3. In the car.


    A very effective thing for active drivers who use Bluetooth technology for communication. In the event of an incoming call, you do not need to switch the gadget manually; you just need to bring your mobile phone to the pre-programmed chip and the wireless headset will connect. With one touch you can turn on your favorite radio station, player or GPS.

  4. Quick start. Do you have favorite apps that you use in the same place? Microstickers programmed for quick launch will open your favorite application, social network page, or email with one touch.
  5. Payment for purchases. If you fix one programmed tag on your PC or laptop, you will no longer need to manually search for the online banking tab or enter a password to enter your personal account. By bringing the smartphone closer to the installed microtag, the user will instantly be taken to his account and will be able to make a quick and secure payment for the goods.

How to program an NFC tag

Before you can use an NFC tag, it must be written to your phone. To do this, you will need to install a special application with which the smartphone can read the necessary data.

Settings will only be possible if certain conditions are met:

  • Having a smartphone or tablet with a pre-installed NFC module.
  • Application for working with tags.
  • Sticker installed in the right place.

How to set up an NFC tag on Android

Solving the problem of how to program NFC tags on an Android smartphone is not particularly difficult. All actions are performed in a certain sequence:

  • Install the sticker with the microchip in the main place where it will be constantly used.
  • Log in to Google Play Market and log in.
  • Select one of the applications: NFC Tools, Trigger, Tag Writer, NFC Tasks or others. They can be in Russian or English.
  • Download and install the application on your smartphone in compliance with all conditions.
  • After opening the program, type the command to create the required task regarding the installed sticker. Confirm your choice using the appropriate Russian-language command.
  • After the settings, bring the smartphone to the sticker to check the response and establish a connection.

How to set up an NFC tag on iPhone

Settings for iPhone gadgets are considered more complex. Full use of NFC tags is available only to devices of the following series: XR, XS, 11, 11 Pro, SE 2022 release. These iPhones perform all given actions completely offline. Earlier devices - 7, 8 and X models do not have this function and the scanner has to be opened manually each time.

NFC architecture

There are several layers in the NFC architecture. The lowest of them is physical, which is implemented by the CPU and other hardware through which interaction occurs. In the middle is the packet data and transport layer, then the data layer format, and at the end is the software.

At the physical level, NFC works according to the algorithm described in GOST for RFID (GOST R ISO/IEC 14443-2-2014), which refers to low-power radio signals with a frequency of 13.56 MHz. Then comes the level that describes the breakdown of the data stream into frames (GOST R ISO/IEC 14443-3-2014). Any radio controllers that are used in a phone, tablet, or connected to a computer or microcontroller are separate hardware components.

They communicate with the host processor through one or more standard device-to-device serial protocols: universal asynchronous transceiver (UART), serial peripheral interface (SPI), serial integrated circuit communications (I2C), or universal serial bus (USB).

Above this are several RFID command protocols based on two specifications. NFC reading and writing tags is based on the original RFID GOST R ISO/IEC 14443A. Philips/NXP Semiconductors Mifare Classic and Mifare Ultralight and NXP DESFire protocols are compatible with GOST R ISO/IEC 14443A. P2P NFC data exchange is based on GOST R ISO/IEC 18092.

They are depicted in the figure above on a level with other control protocols, since they use the same standard.

How to record a bank card on an NFC tag

You can switch your bank card to a contactless version by linking it to a mobile device equipped with an NFC chip. The following services are most suitable for this purpose:

  • Google Pay. Provides operation of Android NFC applications used in smartphones.
  • Apple Pay. Intended for use only with iPhones.
  • Samsung Pay. A proprietary application that works exclusively with Samsung gadgets.

The solution to the problem of how to write a bank card onto a tag is performed in the following sequence:

  • Log in to the application that provides contactless payment.
  • Click on the add card option.
  • Enter your card details or scan it.
  • Agree to all terms and conditions.
  • Enter the code received via SMS.

If the linking is done correctly, you can pay using your mobile device at all retail outlets where contactless payment is possible.

Reading distance NFS tags

The average distance providing stable contactless communication is 4-5 cm. For the most advanced devices, this figure reaches 10 cm. The effective distance may vary depending on certain factors affecting performance:

  • Each phone has an NFS reader of varying performance.
  • The size and configuration of the tags must be considered before using contactless communication.
  • Environment. The presence of metal objects creates a serious obstacle to contactless connection.
  • Microchip model. The performance of bracelets and rings is much higher than that of conventional stickers.

NDEF

NDEF is used to format exchange data between devices and tags. This format typifies all messages that are used in NFC, and it does not matter for the card or for the device. Each NDEF message contains one or more NDEF records. Each contains a unique record type, ID, length, and a field for the information to be reported.

There are several common types of NDEF records:

  1. Regular text entries. They can send any string and do not contain instructions for the target, but do contain metadata about the text's language and encoding.
  2. URI. Such records contain data about Internet links. A target that receives such a record will open it in an application that can display it. For example, a web browser.
  3. Smart recording. Contains not only web links, but also a text description of them, so that it is clear what is located on this link. Depending on the recording data, the phone can open the information in the desired application, be it SMS or e-mail, or change the phone settings (sound volume, screen brightness, etc.).
  4. Signature. It allows you to prove that the information that was transmitted or is being transmitted is reliable.

You can use multiple types of records in one NDEF message.

You can think of a message as a paragraph and entries as sentences. A paragraph is a specific unit of information that contains one or more sentences. Whereas a sentence is a smaller unit of information that contains just one idea. For example, you can make birthday invitations in the form of a paragraph and write in separate sentences information about the date, time and location, and using NDEF messages, send friends a reminder about this event, where there will be a text message describing the event, a smart entry with the location and a web link with directions to that location.

The second main difference between NFC and RFID is the NFC data exchange format (NDEF). NDEF defines the data format in messages, which in turn consist of NDEF records. There are several types of records, which will be discussed in more detail below. NDEF makes it possible to control the process of reading and writing NFC tags, peer-to-peer data exchange, and card emulation using program code.

Where to buy NFC tags and how much they cost

The widest range of tags is presented on the Aliexpress site. Most of the items here are simple stickers, sold in sets of 10 pieces. On average, one such set costs 220 rubles.

All manufacturers produce tags using the same protocol, so the work is carried out according to the same schemes. The main differences between the chips are their configuration and the applied pattern. Higher quality labels use thicker paper. As an example, we can cite sets from AnyNFC, consisting of 6 stickers at a price of 312 rubles.

For unusual or specific teams, inexpensive stickers without pictures are available, costing 83 rubles for 6 pieces. They only bear a logo displaying the NFS wireless technology. After installation and programming, their own designs are applied to them, created on a computer and printed on a printer.

My home scripts


I use NFC quite actively. Many scenarios may seem redundant and even stupid - however, they simplify life for me, corresponding to certain habits and peculiarities of thinking.

Perhaps some of them will interest readers. Some may seem strange. Shall we discuss?

Hallway and public access


As my main home router, I use a Xiaomi R1D with built-in 1TB storage and additional USB storage. The factory NFC tag is hidden under the top cover of the device.

The router is placed in the hallway closet in such a way that it is easily accessible, but the device remains out of sight. It's not just about aesthetics.

The NFC tag reveals to guests the password for the home Wi-Fi network, giving them rights to read shared folders in the router’s internal storage. Archives of family photographs, useful distributions and educational materials are stored here.

At work


My three-meter-long desktop is a treasure trove of hidden NFC tags. Each corresponds to a specific trigger, or a whole sequence of actions.

The main one is hidden in the smartphone holder: it turns on Wi-Fi and starts a chain of exchange processes - updating programs, synchronizing cloud services, archiving photos and files downloaded to the smartphone to the home NAS.


It also stops the playback of any content on the smartphone, be it music, a movie or an audiobook.

The second area of ​​the table is intended to be occupied by a 3D printer and a soldering iron. Nearby there is a label that forces the smartphone to turn on the speakerphone mode and automatically receive incoming calls. It also launches a reference application for electronic components.

Another tag is intended for testing new smartphones. It provides the administrator's Wi-Fi password, saves photos and screenshots from the device to a file exchanger, and starts downloading a software package for testing.

Front of the TV


A tag is hidden in the armrest of the sofa, which puts the smartphone into vibration mode and turns on the MiTVAssistant program to control the TV.

The zone next to it hides another tag that turns on Bluetooth, pairs the smartphone and TV set-top box, and then turns on music playback in Google Music.

In the bedroom


Everything here is incredibly simple: the mark lies on the bedside table. I put my smartphone down - the sound and wireless interfaces turned off, and the economical power supply turned on.

And the alarm clock, of course, which starts the reverse process.

Now I'm planning to glue another one next to the crib. When touched, it will have to launch a separate program with a children's audiobook.

In the kitchen


The kitchen is conventionally divided into 2 zones: the dining room and the actual food preparation area. Accordingly, the layout of the marks is more complex than in the bedroom.

The first mark hangs on the refrigerator at the entrance. If you touch it, the smartphone communicates with the wireless speaker.

The other two are hiding next to the common table. One is for my wife’s smartphone; it includes audiobooks. The second is mine, and it forces the smartphone to open an application with the latest news and weather forecast.

In transport


I do not use a car, since all my travel is now done by public transport and taxis. It costs several times less.

A bicycle is another matter. An NFC tag is also hidden in the smartphone holder on the steering wheel. I secured the smartphone - the navigator started, Bluetooth (connection with headphones), vibration turned off.

Personal items


Triggers are so convenient that they have found a place in clothes and bags and even a diary. The latter has 2 of them: hidden under the front side is a label that turns off sounds on the smartphone and turns on the application for creating tasks. On the back there is a mark that returns everything back.

Hidden in the smartphone pocket of the backpack is a mark to enable the loud notification mode and enable the “In Pocket” operating mode, in which the smartphone does not react to accidental shaking or quick touches. It also forces the smartphone to launch the audio player.

Rating
( 1 rating, average 4 out of 5 )
Did you like the article? Share with friends:
For any suggestions regarding the site: [email protected]
Для любых предложений по сайту: [email protected]