Card: Your cardTap a part to see what it does.
Tap the parts to see what each one does. A teaching simulation, not a circuit simulator.
Build it step by step
0 of 5 donePlace the reader
RC522 at the breadboard edge with its 8 pins in separate rows.
Power at 3.3 V
3.3V to the Uno's 3.3V pin, GND to GND. Never 5 V.
Wire the SPI bus
SDA to D10, SCK to D13, MOSI to D11, MISO to D12, RST to D9.
Add the two LEDs
D5 through 220 Ω to green, D6 through 220 Ω to red, short legs to GND.
Learn your card
Upload, tap your card, copy its ID from the log into allowed[], upload again.
How do you build an RFID door log?
Tap a card on an RC522 reader: known cards light green and are logged, unknown cards light red. You need Arduino Uno R3, RC522 RFID reader, LED 5 mm green, LED 5 mm red, Resistor 220 Ω × 2 and Breadboard 830 Tie Points. It takes 5 steps and about 60 minutes.
- Level
- Intermediate
- Time
- About 60 min
- Parts
- 6
Parts list
- Development BoardsBuyArduino Uno R3 × 1
- WirelessBuy
- SemiconductorsBuyLED 5 mm green × 1
- SemiconductorsBuyLED 5 mm red × 1
- PassivesBuyResistor 220 Ω × 2
- PrototypingBuy
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 | Power (never 5 V) |
| RC522 GND | Uno GND | Ground |
| RC522 SDA (SS) | Uno D10 | Chip select |
| RC522 SCK / MOSI / MISO | Uno D13 / D11 / D12 | SPI bus |
| RC522 RST | Uno D9 | Reset |
| Uno D5 / D6 | 220 Ω to green / red LED | Allowed / refused |
Code
Arduino IDE. Install the "MFRC522" library. The RC522 runs on 3.3 V; many modules work with Uno logic, but a level shifter or a 3.3 V board (ESP32) is safer for long-term use.
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>
MFRC522 rfid(10, 9); // SS, RST
const int GREEN = 5, RED = 6;
byte allowed[][4] = { {0xDE, 0xAD, 0xBE, 0xEF} }; // replace with your card's ID
bool isAllowed(byte *uid) {
for (auto &a : allowed) if (memcmp(a, uid, 4) == 0) return true;
return false;
}
void setup() {
Serial.begin(9600);
SPI.begin();
rfid.PCD_Init();
pinMode(GREEN, OUTPUT); pinMode(RED, OUTPUT);
Serial.println("seconds,uid,result");
}
void loop() {
if (!rfid.PICC_IsNewCardPresent() || !rfid.PICC_ReadCardSerial()) return;
bool ok = isAllowed(rfid.uid.uidByte);
Serial.print(millis() / 1000); Serial.print(',');
for (byte i = 0; i < rfid.uid.size; i++) { if (rfid.uid.uidByte[i] < 0x10) Serial.print('0'); Serial.print(rfid.uid.uidByte[i], HEX); }
Serial.println(ok ? ",allowed" : ",refused");
digitalWrite(ok ? GREEN : RED, HIGH);
delay(2000);
digitalWrite(GREEN, LOW); digitalWrite(RED, LOW);
rfid.PICC_HaltA();
}What the serial monitor should show
Open the serial monitor at the baud rate in the code. This is what our simulator prints for a virtual Arduino Uno with its sensors at their default values. Your numbers will follow your real readings, but the format should match.
seconds,uid,result
Test checklist
What you should see at each check. If a reading is far off, stop and use the troubleshooting list.
| Check | Expected |
|---|---|
| Tap your card after adding it | Green for 2 s, log line ends "allowed" |
| Tap another card | Red for 2 s, "refused" |
| Hold the card still | One log line per tap |
If it does not work
Nothing happens on tap
Check SDA is on D10 and RST on D9, and the module has 3.3 V.
Works then stops
Loose SPI wires are common: use short wires and press them in firmly.
Every card is refused
Copy the ID exactly as printed, 4 bytes, into allowed[].
Still stuck? Find the fault step by step with your multimeter →
Common questions
What parts do I need for the RFID door log?
Arduino Uno R3, RC522 RFID reader, LED 5 mm green, LED 5 mm red, Resistor 220 Ω × 2 and Breadboard 830 Tie Points.
How long does the RFID door log take to build?
About 60 minutes for a intermediate maker, in 5 steps.
How do I know the RFID door log works?
Tap your card after adding it: Green for 2 s, log line ends "allowed". Tap another card: Red for 2 s, "refused". Hold the card still: One log line per tap.
Nothing happens on tap: what should I check?
Check SDA is on D10 and RST on D9, and the module has 3.3 V.
Works then stops: what should I check?
Loose SPI wires are common: use short wires and press them in firmly.
Every card is refused: what should I check?
Copy the ID exactly as printed, 4 bytes, into allowed[].
