Skip to content

How to plug the RS522 Raspberry NFC reader to the Raspberry?

Rémy HUBSCHER edited this page Apr 12, 2018 · 1 revision

Use the chip RS522 (with the Velleman VMA405 module for instance) to read RFID tags directly with the Raspberry Pi without using an Arduino Board.

SPI interface

This chip uses the SPI interface. You need to activate it through the Raspberry Pi configuration interface :

$ sudo raspi-config

Python script

This chip can be used with the pi-rc522 library.

Install it with :

$ sudo pip3 install pi-rc522

Then, use it in a Python script :

from pirc522 import RFID
import time

rc522 = RFID()

while True:
  rc522.wait_for_tag()
  (error, tag_type) = rc522.request()
  if not error:
    (error, uid) = rc522.anticoll()
    if not error:
      print("UID: " + str(uid))
      time.sleep(1)

Hardware connection

VMA405 Raspberry Pi
VCC +3.3v (pin 17)
RST GPIO25 (pin 22)
GND GND (pin 20)
MISO SPI0_MISO, GPIO09 (pin 21)
MOSI SPI0_MOSI, GPIO10 (pin 19)
SCK SPI0_CLK, GPIO11 (pin 23)
NSS SPI0_CEO_N, GPIO08 (pin 24)
IRQ SPI0_MOSI, GPIO24 (pin 18)