Code and modified library to Read/Write data in MIFARE RFID Cards and Tokens using Raspberry Pi Pico Microcontroller and MFRC522 Module. Written in MicroPython.
SRC:https://datasheets.raspberrypi.com/pico/Pico-R3-A4-Pinout.pdf
SRC:https://microcontrollerslab.com/wp-content/uploads/2020/01/RC522-RFID-CARD-READERS-Pinout.png
RC522 RFID Reader Module | Raspberry Pi Pico |
---|---|
VCC | 3.3V |
RST | GP0 |
GND | GND |
IRQ | Not connected |
MISO | GP4 |
MOSI | GP3 |
SCK | GP2 |
SDA | GP1 |
To set-up Pico with micropython READ THIS PDF
source : https://datasheets.raspberrypi.com/pico/raspberry-pi-pico-python-sdk.pdf (27 May 2022, 20:10 IST)
Run the modules via minicom or other serial interface. serial interface on Pico will interact with MicroPython To learn how to communicate with MicroPython of Pico in Windows using WSL, read THIS ARTICLE.
This module is used to read data from RFID card, to use
import readRFID
readRFID.RUN()
This module will write 16bytes of data at address 0x08, this can be changed at -
stat = rdr.write(8, b"\x44\xFF\x4d\x6f\xFF\x47\xFF\x49\x6d\x6d\x55\xFF\x73\x4a\x44\x65")
Then run the module -
import writeRFID
writeRFID.RUN()
PS PiPicoRFID\src> python3 .\KeyGen.py
Key : RYhpNkAgIpBmbrL9
HexData to Write : "\x52\x59\x68\x70\x4e\x6b\x41\x67\x49\x70\x42\x6d\x62\x72\x4c\x39"
import SampleRFIDScanner
SampleRFIDScanner.RUN()
import CloneCardData
CloneCardData.RUN()