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 Module | Raspberry Pi Pico |
| VCC | 3.3V |
| RST | GP0 |
| GND | GND |
| IRQ | Not connected |
| MISO | GP4 |
| MOSI | GP3 |
| SCK | GP2 |
| SDA | GP1 |
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
Post a Comment