RC522 RFID Reader

 Wiring and example

https://microcontrollerslab.com/raspberry-pi-pico-rfid-rc522-micropython/

https://github.com/danjperron/micropython-mfrc522/blob/master/mfrc522.py

13.56 MHz






RC522 RFID Reader ModuleRaspberry Pi Pico
VCC3.3V
RSTGP0
GNDGND
IRQNot connected
MISOGP4
MOSIGP3
SCKGP2
SDAGP1





from mfrc522 import MFRC522
import utime

reader = MFRC522(spi_id=0,sck=2,miso=4,mosi=3,cs=1,rst=0)

print("Bring TAG closer...")
print("")


while True:
    reader.init()
    (stat, tag_type) = reader.request(reader.REQIDL)
    if stat == reader.OK:
        (stat, uid) = reader.SelectTagSN()
        if stat == reader.OK:
            card = int.from_bytes(bytes(uid),"little",False)
            print("CARD ID: "+str(card))
utime.sleep_ms(500) 





Comments