Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFID-RC522 module usage instructions #2613

Closed
pelwell opened this issue Jul 10, 2018 · 4 comments
Closed

RFID-RC522 module usage instructions #2613

pelwell opened this issue Jul 10, 2018 · 4 comments

Comments

@pelwell
Copy link
Contributor

pelwell commented Jul 10, 2018

A few years ago I wrote some tried and tested instructions for wiring up the RFID-RC522 module, installing the SPI-Py library, and the MFRC-522 python library and test application. The thread where it appeared (#1547) is now so long that the relevant comment is hidden by default, and the whole thread takes ages to load.

This issue is a repost of that comment.

========

Starting from a clean current Raspbian install:

  1. Use the following wiring:
RFID-RC522 Pin Raspberry Pi Pin Raspberry Pi Pin name SPI1 Pin SPI1 Pin name
SDA/NSS 24 GPIO8 12 GPIO18
SCK 23 GPIO11 40 GPIO21
MOSI 19 GPIO10 38 GPIO20
MISO 21 GPIO9 35 GPIO19
IRQ None None None None
GND 20 GND 34 GND
RST 22 GPIO25 22 GPIO25
3.3V/VCC 17 3V3 17 3V3

Note that there are multiple versions of the module with different pin-outs - I've shown the pin names from two that I know.

  1. Run sudo raspi-config, choose Advanced Options -> SPI -> Yes . You can reboot, but it isn't necessary (dtoverlay -l will show that there is a run-time overlay that enables the SPI interface).

  2. Install git and python-dev:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install python-dev git
  1. Install the SPI-Py library:
git clone https://github.com/lthiery/SPI-Py.git
cd SPI-Py
sudo python setup.py install
cd ..
  1. Install MFCR522-python:
cd ~
git clone https://github.com/pelwell/MFRC522-python.git
cd MFRC522-python/
  1. Run the script:
sudo python Read.py

If it still doesn't work, triple-check your wiring then upload a photo of it. Also make sure your power-supply is up to the task - 2.5A for a Pi3.

@pelwell
Copy link
Contributor Author

pelwell commented Jul 10, 2018

Closing to escape the attentions of the @JamesH65 bot.

@pelwell pelwell closed this as completed Jul 10, 2018
@JamesH65
Copy link
Contributor

Too late...

Is this something that out to be in docs somewhere, or perhaps the projects section (not my domain)?

@pelwell
Copy link
Contributor Author

pelwell commented Jul 11, 2018

Is there any equivalent, application-specific documentation? It does seem like more of a project to me, but just having this short (but growing...) thread with the important information at the top should be sufficient.

@pelwell
Copy link
Contributor Author

pelwell commented Nov 26, 2018

There's also a simple Python app that uses the SPI-Py library to read registers here.

When you run it you should see output like this:

pi@raspberrypi:~$ python MFRC522_test.py
00: 00 20 80 00 14 00 00 21
08: 00 93 00 08 10 00 a0 00
10: 00 3f 00 00 80 00 10 84
18: 84 4d 00 00 62 00 00 eb
20: 00 ff ff 88 26 87 48 88
28: 20 20 00 00 00 00 00 00
30: 00 00 00 80 00 00 40 92
38: 00 00 00 88 ff 00 03 00

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants