A python wrapper API that allows you to interface with the mfrc522 RFID card reader and a Raspberry Pi Zero W
This code requires you to have the mfrc522 and RPi.GPIO libraries installed. They can be installed using the following commands respectively sudo pip3 install mfrc522
and pip install RPi.GPIO
. It is also recommended that you make use of a python virtual environment before installing the libraries, by making use of tools such as venv or virtualenv.
This API provides you with functions allowing you to:
- Enable/disable SPI communication between the Raspberry Pi and the RFID card reader
- Reset RFID cards and tags by clearing the text stored in them
- Read the text and id number associated to RFID cards and tags
- Write text to RFID cards and tags
Copy the class into your project directory and import it at the top of your script, for your personal use. Refer to Table 1 below, for how to connect the Raspberry Pi and RFID card reader
Table 1:
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 | 3V3 |
Alternatively, you can also have a look at the demonstration application that was made for the API. It can be found here
This API made use of Mario Gómez' class to interface with the NFC reader Module MFRC522 on the Raspberry Pi. It can be found here
- EEE3097S Group 19:
Iviwe Malotana:@IviweMalotana
Samuel Mbiya: @samuelmbiya
This project is under the MIT License