DEV Community

Cover image for Why One RFID Badge Can Generate Multiple Scan Events
stampiq
stampiq

Posted on

Why One RFID Badge Can Generate Multiple Scan Events

Why One RFID Badge Can Generate Multiple Scan Events

When building an RFID application, one of the first surprises can be the number of events produced by a single tag.

A badge remaining inside a reader's coverage area may generate repeated detections.

This behaviour can be useful at the hardware level, but applications need to decide what each detection means.

Raw reads are not business events

Consider an attendee arriving at a conference entrance.

The RFID reader may detect the attendee's badge several times. However, the event management application may only need to record one check-in.

Without appropriate filtering, repeated detections could distort attendance statistics or create duplicate records.

A simple filtering example

One approach is to keep track of recently processed tag and reader combinations.

const recentReads = new Map();
const WINDOW_MS = 5000;

function processRead(tagId, readerId) {
  const key = `${readerId}:${tagId}`;
  const now = Date.now();
  const previous = recentReads.get(key);

  if (
    previous !== undefined &&
    now - previous < WINDOW_MS
  ) {
    return false;
  }

  recentReads.set(key, now);
  return true;
}
Enter fullscreen mode Exit fullscreen mode

This example suppresses repeated detections for the same tag and reader within a five-second window.

It is intentionally simplified and is not a production-ready attendance system.

What production applications need

A real implementation should also consider:

  • Memory management and expiration.
  • Multiple application instances.
  • Persistent event identifiers.
  • Entry and exit logic.
  • Network interruptions.
  • Consistent timestamps.
  • Data privacy requirements.

The appropriate filtering window should be determined through testing.

A five-second window might work for one application but incorrectly suppress meaningful activity in another.

RFID in event applications

These considerations become particularly important when RFID hardware is connected to registration and attendee management software.

The application needs to convert raw detections into information that event organizers can actually use.

StampIQ's overview of RFID attendee tracking provides additional context about this application area.

Final thought

Receiving RFID data is only the first step.

Building reliable software means understanding which hardware events are meaningful, which are repeated observations and which require additional processing.

Disclosure: This educational example is contributed by the StampIQ team.

Top comments (0)