The file 'MFRC522.py' was copied from 'MFRC522-python' and modified 'Elieren'
This code requires you to have SPI-Py installed from the following repository: https://github.com/lthiery/SPI-Py
git clone https://github.com/lthiery/SPI-Py.git
cd SPI-Py/
git checkout 8cce26b9ee6e69eb041e9d5665944b88688fca68
sudo python3 setup.py install
Enable SPI in raspberry pi
sudo nano /boot/config.txt
dtparam=spi=on
reboot
Install mfrc522
pip3 install mfrc522
Name | Pin # | Pin name |
---|---|---|
SDA | 24 | GPIO8 |
SCK | 23 | GPIO11 |
MOSI | 19 | GPIO10 |
MISO | 21 | GPIO9 |
IRQ | None | None |
GND | Any | Any Ground |
RST | 22 | GPIO25 |
3.3V | 1 or 17 | 3V3 |
sudo python3 RFID.py
- Read card - read all sectors of the card.
- Write UID - can overwrite the UID of the card (there is a 0 sector unlocked on the card).
- Write sector - can overwrite the given sector with the given values.
- Read text - reads the text written on the card.
- Write text - Writes text to the card.