Source: https://mokxi.com/teachers/plans/rfid-and-nfc
Updated: 2026-11-19

Lesson plan

# RFID and NFC lesson plan

MIFARE Classic and NTAG cards on an MFRC522 and a PN532: how a passive tag is powered, UIDs of four and seven bytes, sectors, keys and blocks, NTAG pages and NDEF, an access list with a master card, honest security (UIDs clone, Crypto1 is broken), and a spaceship crew airlock.

3 chapters, 7 lessons, about 6 hours, on the Arduino Uno R3. Every lesson runs in the browser, with nothing to install.

Start a class from this course

The unit

## Objectives and materials

### By the end, students can

- How tags work, their UIDs, and the memory inside a MIFARE Classic.
- NFC on the PN532, access lists, and the limits of card security.
- A crew airlock that knows who is aboard.

### Materials for the whole unit

- Arduino Uno R3
- Buzzer
- Character LCD with I2C backpack
- LED x 2
- NFC reader, PN532
- Resistor x 2
- RFID reader, MFRC522

Every part is already on the simulator’s bench, so there is nothing to buy or hand out. The counts are the most any one lesson uses, if you build it on real breadboards too.

Chapter 1. About 2 h 25 min

## Cards and readers

How tags work, their UIDs, and the memory inside a MIFARE Classic.

Lesson | Time | What students do

How tags work A reader that powers the card it reads: the MFRC522’s 13.56 MHz field, a passive tag’s coil and chip, and the ATQA and SAK that tell a MIFARE Classic 1K from an NTAG213 before anything else is said. | 45 min

- Run it: a reader on SPI
- Tap a card
- The reader sees it
- A different kind of tag
- Low frequency and high frequency

MFRC522 UIDs Every card’s UID, four bytes or seven, sent in the clear before anything secret; PICC_HaltA() makes a card held on the reader count once per tap; and the property that decides which UIDs the cards on this bench carry. | 45 min

- Run it: read a UID
- Seven bytes
- A UID is public
- Once per tap
- Cards of your own

Sectors and blocks Inside a MIFARE Classic 1K: 16 sectors of four 16-byte blocks, keys and access bits in every sector trailer, the wrong key timing out, the transport key FF FF FF FF FF FF working, and a name written to block 4 and read back. | 55 min

- Run it: tap card 1
- The wrong key
- The sector trailer
- Write a block
- Read it back
- Your own data

### Materials

- Arduino Uno R3
- RFID reader, MFRC522

### Check for understanding

Each student finishes "Sectors and blocks" on their own, without opening the hints. The simulator checks 6 of its 6 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Your own data".

Chapter 2. About 2 h 35 min

## Building with tags

NFC on the PN532, access lists, and the limits of card security.

Lesson | Time | What students do

PN532 and NFC The PN532 NFC controller on I2C: firmware version 1.6, a card’s UID through command frames, an NTAG213’s capability container E1 10 12 00, and a page of user memory written and read back with no key. | 55 min

- Run it: a reader with firmware
- Tap the NTAG
- Pages, not blocks
- Write a page
- A Classic on the PN532
- Your own message

Access lists A door controller: an allow list of UIDs with names, a green lamp for Ana, a red lamp and a buzzer for a stranger, and a master card that enrolls the stranger as a guest, who then gets in. | 55 min

- Run it: a door with a list
- Ana
- A stranger
- The master card
- The guest gets in
- Add someone in code

Security limits A door that trusts the UID lets in a card that only copies it. A door that gives each card a secret in a keyed sector and checks it on every tap refuses the copy. And why even that is not enough: MIFARE Classic’s Crypto1 has been broken since 2008. | 45 min

- Run it: a door that trusts the UID
- The clone
- Crypto1 is broken
- Check a secret
- Honest security

### Materials

- Arduino Uno R3
- Buzzer
- LED x 2
- NFC reader, PN532
- Resistor x 2
- RFID reader, MFRC522

### Check for understanding

Each student finishes "Security limits" on their own, without opening the hints. The simulator checks 5 of its 5 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Honest security".

Chapter 3. About 55 min

## Boss project

A crew airlock that knows who is aboard.

Lesson | Time | What students do

Boss: the crew airlock The airlock of a deep-space ship: crew cards board and leave for spacewalks, the LCD keeps the count aboard, the outer door lamp cycles on every crossing, and an unknown card sounds the intruder alarm. | 55 min

- Run it: three crew aboard
- A spacewalk
- The screen
- Back aboard
- Intruder
- A new crew member

### Materials

- Arduino Uno R3
- Buzzer
- Character LCD with I2C backpack
- LED x 2
- Resistor x 2
- RFID reader, MFRC522

### Check for understanding

Each student finishes "Boss: the crew airlock" on their own, without opening the hints. The simulator checks 6 of its 6 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "A new crew member".

Your class

## Teach this unit as a class

Start a class from this course and its 7 lessons are assigned in one go, in order. Students join with a six-character code or printed login cards, and each one’s work comes back to you.

The class tools are free for 30 days for one class of up to 20 students, with no card. The lessons themselves are free either way.

Start a class from this course See the demo class

More units

## Other lesson plans

Electronics basics 20 lessons, about 10 h. Embedded on the Arduino Uno 16 lessons, about 12 h. Embedded on the ESP32-C3 13 lessons, about 11 h. Embedded on the Raspberry Pi Pico 7 lessons, about 6 h. Build your own fight stick 5 lessons, about 4 h. Embedded on the STM32F411 6 lessons, about 6 h. C++ on a board 13 lessons, about 10 h. Digital logic and memory 4 lessons, about 4 h. Interactive devices on the Uno 9 lessons, about 8 h. From gates to a computer 23 lessons, about 16 h. Build a claw machine 8 lessons, about 6 h. Every unit All the courses as ready-made units, on the teachers page.
