Function: what the RC522 does in a circuit
Reads the serial number of a contactless card or key fob held within a few centimetres, like a door-entry or bus-pass reader.
- Reads the number of a contactless card or key fob
- Powers the card by its own magnetic field
- Opens doors and logs attendance
RC522 key facts
| Supply | 3.3 V only |
|---|---|
| Frequency | 13.56 MHz |
| Reading distance | up to about 5 cm |
| Interface | SPI: SDA (SS), SCK, MOSI, MISO, plus RST |
| Cards | MIFARE Classic cards and key fobs, 4-byte UID |
| Library | MFRC522 |
RC522 pinout
The legs from left to right, as the part is drawn in the simulator:
| No. | Name |
|---|---|
| 1 | SDA (SS) |
| 2 | SCK |
| 3 | MOSI |
| 4 | MISO |
| 5 | IRQ |
| 6 | GND |
| 7 | RST |
| 8 | 3.3V |
How it works
The coil on the board makes a magnetic field that changes 13.56 million times a second. A card has its own coil and a tiny chip but no battery: the field powers the chip, which answers by loading the field in a pattern the reader can detect. The reader passes the card’s number (its UID, usually four bytes) to the microcontroller over SPI. Sketches use the MFRC522 library: PICC_IsNewCardPresent(), PICC_ReadCardSerial(), then read uid.uidByte[0] to [3].
What it is made of
- Reader chip: Silicon integrated circuit (MFRC522) Si
- Antenna: Copper coil printed on the board Cu
- Card: PVC plastic with a copper or aluminium coil and a silicon chip CHClCuSi
Where the materials come from: Silicon from quartz sand; copper from ores such as chalcopyrite; PVC from salt and oil.
The chemistry
No chemistry powers the card: a changing magnetic field pushes electrons round its coil (electromagnetic induction), the same effect that charges a phone on a wireless pad.
Biology connection
Some animals sense magnetic fields too: migrating birds and sea turtles use the Earth’s field to find their way. Nerve impulses →
Safety and the environment
Power it from 3.3V only: 5 V destroys the chip. It must use the board’s SPI pins (on the Uno: SCK 13, MOSI 11, MISO 12). A UID is not a secret: cheap cards can be copied, so real locks add encryption.
Did you know? The same 13.56 MHz technology is in contactless bank cards, transport cards and the NFC chip in phones.
Wave simulatorCopper Elements inside: SiCuCHCl
Try it in the simulator
Build and code a circuit with a RFID reader in these practice projects:
Questions students ask
What does the RC522 do?
Reads the serial number of a contactless card or key fob held within a few centimetres, like a door-entry or bus-pass reader. Main functions: reads the number of a contactless card or key fob; powers the card by its own magnetic field; opens doors and logs attendance.
Why does my RC522 not detect a card?
Check that it is powered from 3.3V, that SCK, MOSI and MISO are on the board’s SPI pins (13, 11 and 12 on the Uno), that SDA and RST match MFRC522 rfid(10, 9), and that SPI.begin() and rfid.PCD_Init() are both in setup().
What are the connections of the RC522?
In order: SDA (SS), SCK, MOSI, MISO, IRQ, GND, RST, 3.3V.
How does the RC522 work?
The coil on the board makes a magnetic field that changes 13.56 million times a second. A card has its own coil and a tiny chip but no battery: the field powers the chip, which answers by loading the field in a pattern the reader can detect. The reader passes the card’s number (its UID, usually four bytes) to the microcontroller over SPI. Sketches use the MFRC522 library: PICC_IsNewCardPresent(), PICC_ReadCardSerial(), then read uid.uidByte[0] to [3].
What is the RC522 made of?
Reader chip: Silicon integrated circuit (MFRC522). Antenna: Copper coil printed on the board. Card: PVC plastic with a copper or aluminium coil and a silicon chip.
Is the RC522 safe? How should it be recycled?
Power it from 3.3V only: 5 V destroys the chip. It must use the board’s SPI pins (on the Uno: SCK 13, MOSI 11, MISO 12). A UID is not a secret: cheap cards can be copied, so real locks add encryption.
More sensors
Connected tools
The same idea from another angle, across the site.