Source: https://mokxi.com/rfid-simulator

Simulator

# An RFID simulator: an RC522 reader and four cards

Mokxi is a free online RFID simulator that runs in your browser, with nothing to install and no account needed. An Arduino Uno talks to an MFRC522 reader over SPI with the MFRC522 library. Lay a card on the reader and its UID appears in the serial monitor: three cards and fobs with four-byte UIDs, and a sticker with seven.

Start building free or read the RC522 tutorial

- 455 parts on the bench
- 43 boards running now
- 1.00x real time, on every board

Click to open it in the editor

Click the reader and pick a card to lay on it, or click anything else to open it in the editor.

## What you can do here

In the circuit above, or in the editor it opens.

- Read card UIDs with the MFRC522 library
- Pick from four cards, one of them with a seven-byte UID
- Change the cards’ UIDs in the properties panel
- Build a door that lets two of the cards in
- Print the reader’s firmware version, and see what a loose wire does to it
- Edit the code and press Run again

## What the running circuit shows

A serial number, read through the air.

The RC522 sits on the Uno’s SPI bus, pins 11, 12 and 13, with its chip select on 10 and its reset on 9. Its antenna powers a card held near it, and every card carries a serial number, its UID, which the reader can read without knowing anything else about the card. The sketch asks the library whether a new card is present, reads its UID, prints it, and puts the card to sleep with PICC_HaltA.

In the engine the four cards read “C3 5A 1E 94”, “7B 02 D4 19”, “91 E6 3C A7” and the seven-byte “04 6F 2A D2 5B 71 80”. Because the sketch halts the card, one left on the reader prints once, not once a loop; take it off and lay it on again to read it again.

## How the reader is modeled

Registers, commands and the cards’ own memory.

The MFRC522 part answers the library at the register level: its version register reads 0x92, version 2.0, and the cards answer the request, anticollision and select commands a real card does, cascading for a seven-byte UID. A four-byte card is a MIFARE Classic 1K, its memory behind the factory keys, so a sketch can authenticate, read and write blocks; the sticker is an NTAG213. A sketch written for the MFRC522 library, the one every RC522 tutorial uses, runs unchanged.

What it leaves out: the radio. There is no range or angle, a card is either on the reader or not, and only one is on it at a time, so two cards never collide. The RC522 runs on 3.3 V and is wired to the Uno’s 3.3 V pin here; on a real board, never give it 5 V.

RC522 RFID with Arduino SPI, explained The LCD simulator The servo simulator

## Questions

Is it free?

Yes. The circuit on this page, every part in it and the editor it opens in are on the free plan, with no card.

Do I need an account?

No. The circuit runs the moment the page does, and the editor opens without one. A free account is only for saving a project to the cloud and sharing it by link.

Can I simulate an RFID door lock?

Yes. The RFID door project lets two of the four cards in with a green LED and turns the others away with a red one, and the RC522 tutorial walks through it.

Why does my RC522 say communication failure?

The library could not read the reader’s version register, so a wire or the supply is wrong. In the RFID door project, which prints the version as it starts, pull MISO or the 3.3 V wire and the version reads 0xFF (a MISO with nothing driving it floats, and reads all ones or all zeros), with the same warning a real board prints.

Does it use the MFRC522 library?

Yes: #include <MFRC522.h>, PCD_Init, PICC_IsNewCardPresent and PICC_ReadCardSerial, as in the library’s own examples.

## More simulators

Each one opens on a circuit that is already running.

Online circuit simulator Breadboard simulator ESP32 simulator Op-amp simulator Logic gate simulator LED circuit simulator Servo simulator LCD simulator OLED simulator NeoPixel simulator 7 segment display simulator LED matrix simulator Stepper motor simulator Motor driver simulator Ultrasonic sensor simulator Rectifier simulator Digital circuit simulator Potentiometer simulator PWM simulator Relay simulator Shift register simulator DHT11 simulator Accelerometer simulator RGB LED simulator Buzzer simulator MOSFET simulator Circuit simulator for kids Flip-flop simulator Multiplexer simulator Full adder simulator I2C simulator UART simulator Thermistor simulator PIR sensor simulator Oscilloscope simulator Multimeter simulator DC motor simulator Traffic light simulator Diode simulator Capacitor simulator Series and parallel circuit simulator Wheatstone bridge simulator Voltage regulator simulator Soil moisture sensor simulator Zener diode simulator Solar panel simulator AC circuit simulator Thevenin simulator Decoder simulator Encoder simulator PID simulator Robot arm simulator Load cell simulator IR sensor simulator LM35 simulator HC-05 Bluetooth simulator nRF24L01 simulator

## Read a card

Open the circuit, lay a card on the reader and press Run. Nothing to install, and no account needed.

Start building free Open the editor
