Build it step by step
0 of 8 doneWire the reader
3.3V, GND, RST to D9, SDA to D10, MOSI to D11, MISO to D12, SCK to D13.
Wire the display
SDA to A4, SCL to A5, VCC to 5V, GND to GND.
Upload the sketch
The display says Hold a tag here.
Hold a tag to the reader
The serial monitor prints its ID.
Copy the ID into the table
Change a message and its line text.
Upload again and tap the tag
The display shows its message.
Tap an unknown tag
The display says Unknown tag.
Wait four seconds
The display returns to the idle message.
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
| From | To | Why |
|---|---|---|
| RC522 3.3V | Uno 3.3V | The reader runs on 3.3 V only, never 5 V |
| RC522 GND | Uno GND | Ground |
| RC522 RST | Uno D9 | Reset |
| RC522 SDA (SS) | Uno D10 | Chip select |
| RC522 MOSI | Uno D11 | SPI data in |
| RC522 MISO | Uno D12 | SPI data out |
| RC522 SCK | Uno D13 | SPI clock |
| LCD backpack SDA and SCL | Uno A4 and A5 | I2C, address 0x27 or 0x3F |
| LCD backpack VCC and GND | Uno 5V and GND | Power |
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.
| Check | Expected |
|---|---|
| Known tag | Its message appears |
| Unknown tag | Unknown tag message |
| No tag | Idle message |
| Tag held for a long time | Message shown once |
| Reader powered at 3.3 V | Reads 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 →
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.
