nfc tag writing method: from single haircard to batch initialization
RFID Knowledge

nfc tag writing method: from single haircard to batch initialization

PublishedShanghai Zejie Smart Technology Co., Ltd.

A phone and an app like NFC Tools can issue a single card in about ten seconds. Batch initialization requires a professional reader and a script and can achieve one to two cards per second. The two methods serve different purposes: use the first for demonstrations or troubleshooting a single card and the second for production deployment. In either case, settle on the data format, NDEF (NFC Data Exchange Format), and the tag model before writing cards, or later changes will be expensive.

Selecting the right label is the first step.

The NFC labels are written from the very beginning of a selection, not a type. Common models are divided into three groups by capacity: NTAG 213 has 180 bytes, which is enough to hold a short URL or a vCard contact; NTAG215 is 540 bytes, which allows for several records; NTAG216 is 924 bytes, which is suitable for large text or multiple links. The door-to-door closed scene is commonly Mifare Cassic 1K (1KB), but it is divided into 16 sectors, each with an independent key that is much more complex than the NTAG series.

The data structure is also defined after the selection of the model. NDEF is a standard format for NFC Forum definition, specifying multiple record types such as URLs, TEXT, vCard, Wi-Fi configurations, each of which is called a NDEF Record. For example, when you trace a product, write a URL to an traceability system, send members' cards to write contact information in VCard format. When we do projects, it is generally recommended that fields be clearly listed, such as back-sources require product ID, production date, batch number three, corresponding to URLs for query parameters and avoid going up and re-labeling.

The right position for a single hair card.

The most convenient tool for a single haircard is the APP. Android recommends NFC Tools Pro, iPhone can automate the NFC with NFC Towers or Shortcuts. The process is simple: Open the APP Select "Down" and choose the data type (URL, TEXT etc.), fill in, put the label near the NFC antenna position on the back of the phone, hear the beep, complete the whole process 5-15 seconds.

A few details are easily ignored: iPhone supports complete NDF writing only from iOS 14, and limited support for non-Apple ecolabels, confirming the compatibility of APP before writing; second, Androids have different NFC antenna positions, either near cameras or in the middle of their cell phones, and several times find the most sensitive position; third, write to read confirmation immediately after writing, avoid success but error.

This is a suitable way to demonstrate, debug, test, or a label for an item. A customer at an exhibition puts a NFC tag on each exhibit and a viewer at the site scans a video of the product, which is typical of a hand-made hair card.

Batch Initialization: Reader and script are a formula

It's too slow to have more than 50 hair cards. This is a time for specialized NFC readers, such as ACR122U (USB interface, around $200 market value) or ACR1255U (blue teeth, about $500). With Python scripts or plant-side tools, you can write 1 to 2 sheets per second, 1,000 labels are written in 10 to 20 minutes, plus the release card and unusual processing usually run over more than an hour.

The batch process is usually four steps: preparation of data (CSV or database), connecting to a reader, reburning, reading. Python can use the nfcpy or pyscard library, with core code less than 50 lines. The key to mass writing is not the code itself, but rather the abnormal process: labels are mistled, readers fail to respond at short notice, tags themselves have defects that require script recognition and skipping, or a card is broken to the whole process. Shanghai-based Tactical usually adds a dailies and retest mechanism in the script, writes an proof, fails to mark automatically, facilitates subsequent tracing.

A couple of easy-to-touch pits.

sector encrypted and forgot the password.Mifare Classic each sector has two keys: Key A and Key B. Once a custom password is set, it is almost unsolved, only the tags are changed. The key sheet must be backed up in the password manager before encryption.

The tag can not be modified after it is locked.The NTAG series has a CC (Capability Container) configuration that can no longer be written after setting certain positions to read-only. The batch release card confirms whether locking is needed, and whether the locking range is an entire piece or a sector. The demonstration suggests rewrite with labels, and formally deploys before considering the lockcard.

UID is unusual or repeatable.NFC tags have a globally unique identifier (UID). The NTAG series uses a seven-byte UID, like an ID number, and some applications use it to identify tags. Low-quality tags may have duplicate UIDs or fail to comply with ISO 14443, the international protocol underlying NFC, leading to missed reads or misidentification. Before purchasing, sample 10 tags and check their UIDs with a reader/writer.

The cell phone and the reader write into a different compatibility.The same URL, which is used to write down some old Android phones, may not read them, and the reader’s writing is more compatible.

How do you decide which way?

The criteria for the determination are straightforward: a number of less than 10, ad hoc debugging, customer presentation, single haircards with mobile phones; more than 50, official deployment, data can be traced, mass cards can be used in a reader; between 10 and 50 can be mixed, first run through the process to validate data formats with a cell phone, then scale up with a batch program.

There is also a often neglected dimension: frequency of data changes. If the label content needs to be updated regularly, such as membership card expiration time, discount code rotation, it is recommended that the label be rewritten and an updated interface preset; if the content remains permanently unchanged, for example, if the product traces, production information can be directly locked on the bulk card to prevent tampering.

NFC labels are written in a simple way, but they involve hardware selection, data formatting, encryption, lot flow, multiple steps. We have seen many items go well at the demonstration stage, mass deployments have found that label models are not bought correctly, data formats are incompatible, reading and writing is driven wrong, leading to back-to-work. It is recommended that 5 to 10 labels run through the full process, including writing, reading, encryption, abnormal handling, and expose all questions to small batch stages before the formal batch is completed.