Projects / RFID name tag reader

RFID name tag reader

Beginner2.5 hGuided buildReviewed

Build it step by step

0 of 8 done
  1. UNORC522

    Wire the reader

    3.3V, GND, RST to D9, SDA to D10, MOSI to D11, MISO to D12, SCK to D13.

  2. UNO

    Wire the display

    SDA to A4, SCL to A5, VCC to 5V, GND to GND.

  3. UNO

    Upload the sketch

    The display says Hold a tag here.

  4. UNORC522

    Hold a tag to the reader

    The serial monitor prints its ID.

  5. UNO

    Copy the ID into the table

    Change a message and its line text.

  6. UNO

    Upload again and tap the tag

    The display shows its message.

  7. UNO

    Tap an unknown tag

    The display says Unknown tag.

  8. UNO

    Wait four seconds

    The display returns to the idle message.

In short

How do you build an RFID name tag reader?

A classroom sign shows a welcome message for each tag held to the reader, with no personal data stored. You need Arduino Uno R3, RC522 RFID reader, RFID tags 13.56 MHz (MIFARE Classic 1K) × 3, 16x2 LCD with I2C backpack (PCF8574) and Breadboard 830 Tie Points. It takes 8 steps and about 150 minutes.

Level
Beginner
Time
About 150 min
Parts
5

Parts list

Tick what you already own. It saves to My Garage, so “Build with what I have” knows.

Wiring

FromToWhy
RC522 3.3VUno 3.3VThe reader runs on 3.3 V only, never 5 V
RC522 GNDUno GNDGround
RC522 RSTUno D9Reset
RC522 SDA (SS)Uno D10Chip select
RC522 MOSIUno D11SPI data in
RC522 MISOUno D12SPI data out
RC522 SCKUno D13SPI clock
LCD backpack SDA and SCLUno A4 and A5I2C, address 0x27 or 0x3F
LCD backpack VCC and GNDUno 5V and GNDPower

Code

A 13.56 megahertz RFID tag carries a unique ID number. The RC522 reader powers the tag through its antenna and reads the number, which the sketch turns into a text string. A small table matches each ID to a friendly message, so holding a blue tag to the reader shows Welcome and holding a green one shows Good morning. Read your own tag numbers from the serial monitor and paste them into the table. The sign deliberately keeps no personal data: it shows a colour or a first name chosen by the user, never a surname, address or student number, and it does not log who came when. The ID alone is not a secret, and a tag can be copied with the right equipment, so never use this for access control or payments. The RC522 module works at 3.3 volts only. Connecting its power to 5 volts can damage it, and the Uno's 3.3 volt pin supplies enough current for it. Use it with the people's consent, and tell everyone what the sign does.

Runs on a virtual Arduino Uno in your browser, with sliders for the sensors. Happy with it? Verify and upload to your real board from the same page (Chrome or Edge on a computer).

#include <SPI.h>
#include <MFRC522.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>

MFRC522 reader(10, 9);                     // SS on D10, RST on D9
LiquidCrystal_I2C lcd(0x27, 16, 2);        // try 0x3F if blank

struct Tag { const char* uid; const char* line1; const char* line2; };
// Replace the example IDs with the numbers your own tags print on the serial monitor.
const Tag TAGS[] = {
  {"04A1B2C3", "Welcome!",     "Blue tag"},
  {"04D4E5F6", "Good morning", "Green tag"},
  {"04112233", "Hello there",  "White tag"}
};
const int TAG_COUNT = sizeof(TAGS) / sizeof(TAGS[0]);

unsigned long shownAt = 0;

void showText(const char* a, const char* b) {
  lcd.clear();
  lcd.setCursor(0, 0); lcd.print(a);
  lcd.setCursor(0, 1); lcd.print(b);
  shownAt = millis();
}

void setup() {
  Serial.begin(9600);
  SPI.begin();
  reader.PCD_Init();
  lcd.init(); lcd.backlight();
  showText("Hold a tag here", "");
}

void loop() {
  if (shownAt && millis() - shownAt > 4000) {     // return to the idle message
    showText("Hold a tag here", "");
    shownAt = 0;
  }
  if (!reader.PICC_IsNewCardPresent() || !reader.PICC_ReadCardSerial()) return;

  char uid[21] = "";
  for (byte i = 0; i < reader.uid.size && i < 10; i++) {
    char part[3];
    sprintf(part, "%02X", reader.uid.uidByte[i]);
    strcat(uid, part);
  }
  Serial.print("Tag: "); Serial.println(uid);       // copy this into the table above

  bool known = false;
  for (int i = 0; i < TAG_COUNT; i++) {
    if (strcmp(uid, TAGS[i].uid) == 0) { showText(TAGS[i].line1, TAGS[i].line2); known = true; break; }
  }
  if (!known) showText("Unknown tag", "Ask the teacher");
  reader.PICC_HaltA();
}

Test checklist

What you should see at each check. If a reading is far off, stop and use the troubleshooting list.

CheckExpected
Known tagIts message appears
Unknown tagUnknown tag message
No tagIdle message
Tag held for a long timeMessage shown once
Reader powered at 3.3 VReads tags reliably

If it does not work

Reader not detected

Check the 3.3 V supply and the SPI wiring.

Tag ID not matching

Compare the serial monitor output exactly, uppercase and no spaces.

Display blank

Try address 0x3F and adjust the contrast screw.

Reads are intermittent

Hold the tag flat and within three centimetres.

Library error

Install MFRC522 from the Library Manager.

Still stuck? Find the fault step by step with your multimeter →

Ask Lark AI

Common questions

What parts do I need for the RFID name tag reader?

Arduino Uno R3, RC522 RFID reader, RFID tags 13.56 MHz (MIFARE Classic 1K) × 3, 16x2 LCD with I2C backpack (PCF8574) and Breadboard 830 Tie Points.

How long does the RFID name tag reader take to build?

About 150 minutes for a beginner maker, in 8 steps.

How do I know the RFID name tag reader works?

Known tag: Its message appears. Unknown tag: Unknown tag message. No tag: Idle message.

Reader not detected: what should I check?

Check the 3.3 V supply and the SPI wiring.

Tag ID not matching: what should I check?

Compare the serial monitor output exactly, uppercase and no spaces.

Display blank: what should I check?

Try address 0x3F and adjust the contrast screw.

Reads are intermittent: what should I check?

Hold the tag flat and within three centimetres.