DEV Community

POXO
POXO

Posted on Fully Autonomous

Working With UHF RFID Tag Data: EPC, TID, RSSI and Duplicate Reads Explained

If you're writing software around UHF RFID for the first time, such as a warehouse app, a gate system or an asset register, the reader will hand you a stream of reads that looks simple but hides a few traps. This post explains what each field means and how to turn raw reads into clean events.

What a read actually contains

Most UHF readers built to the EPC Gen2 standard (ISO/IEC 18000-63) report these fields for every tag they see:

  • EPC: the ID stored in the tag's EPC memory bank. Usually 96 bits, shown as 24 hex characters. This is the number your database will key on.
  • TID: a serial number written into the chip at the factory. It can't be changed, so it helps you spot cloned or re-encoded tags.
  • Antenna port: which antenna saw the tag. On a dock door with two antennas, this tells you which side.
  • RSSI: received signal strength, often reported as a negative dBm value. Closer to zero means a stronger reply.
  • Timestamp: when the read happened.

Some readers also report phase and frequency channel. You won't need them for basic tracking.

Trap 1: one tag, hundreds of reads

A reader in continuous mode reads every tag in its field many times a second. A pallet sitting at a dock door for a minute can produce thousands of reads of the same EPC. Never write raw reads straight into your business tables.

Instead, keep a small in-memory map of EPC to first seen, last seen, best RSSI and antenna. Emit one "arrived" event when a tag first appears, and one "departed" event when it hasn't been seen for a timeout. A few seconds is a common starting point; tune it on site.

import time

seen = {}
TIMEOUT = 3.0  # seconds; tune on site

def on_read(epc, antenna, rssi):
    now = time.time()
    tag = seen.get(epc)
    if tag is None:
        seen[epc] = {"first": now, "last": now, "rssi": rssi, "antenna": antenna}
        emit("arrived", epc, antenna)
    else:
        tag["last"] = now
        if rssi > tag["rssi"]:
            tag["rssi"], tag["antenna"] = rssi, antenna

def sweep():
    now = time.time()
    for epc, tag in list(seen.items()):
        if now - tag["last"] > TIMEOUT:
            emit("departed", epc, tag["antenna"])
            del seen[epc]
Enter fullscreen mode Exit fullscreen mode

Here emit is whatever pushes events to your queue or API, and sweep runs on a timer.

Trap 2: stray reads from next door

UHF signals bounce. A tag on a shelf near the dock can be read faintly by the dock antenna. Two simple filters help:

  • RSSI threshold: ignore reads weaker than a value you measure on site.
  • Minimum read count: only accept a tag after it has been read several times within a short window.

Tune both with real items in place. Values from a lab rarely hold in a working building.

Trap 3: working out direction

With two antennas, one inside and one outside, the order in which each antenna sees its strongest RSSI tells you direction. Outside first, then inside, means inbound. Keep RSSI per antenna per tag and compare the peaks, rather than trusting the very first read.

Trap 4: assuming the EPC is unique

EPCs are only unique if someone planned them. If different sites or suppliers encode tags on their own, duplicates happen. Agree an EPC numbering scheme early, or ask for tags pre-encoded to your scheme. Store the TID as well, so you can tell two physical tags apart if an EPC is ever duplicated.

Trap 5: blaming the code for a hardware problem

If read rates are poor, check the physical setup before the software: tag type versus surface (metal and liquids cause trouble for standard tags), tag orientation, antenna placement and reader power. In India, also confirm the tags are tuned for the 865–867 MHz band used here.

Quick checklist

  1. Key your records on EPC, and keep the TID alongside it.
  2. De-duplicate reads into arrived and departed events.
  3. Filter by RSSI and read count, tuned on site.
  4. Use per-antenna RSSI peaks to work out direction.
  5. Agree an EPC numbering plan before the first order.

If you're still at the hardware stage, it's worth understanding the main RFID tag types (labels, hard tags, on-metal, windshield and laundry tags) before you write any code, because the tag you choose decides the data quality you'll get.

Written by the team at POXO, a New Delhi manufacturer of RFID tags, readers and RFID/IoT solutions.

Top comments (0)