In this tutorial, I will show you how to interface RFID-RC522 with Raspberry Pi4 with some simple step,
Make sure that the tags you purchase for your RFID RC522 operate on the 13.56MHz frequency otherwise we will fail to read them
I have divided this tutorial into several parts. I believe that if you continue to work with me, you will be able to create projects.
First, you need to collect all the materials or components you need for this project and get an idea about this component I will briefly discuss a few hereEquipment List
This book will help you to learn more about other Raspberry Pi projects and Raspberry PiStep-2Raspberry pi to RFID-RC522 wiring
- SDA connects to Pin 24.
- SCK connects to Pin 23.
- MOSI connects to Pin 19.
- MISO connects to Pin 21.
- GND connects to Pin 6.
- RST connects to Pin 22.
- 3.3v connects to Pin 1.
You need to change some default configuration to connect it to Raspberry Pi, By default, the Raspberry Pi has the SPI (Serial Peripheral Interface) disabled, which is a bit of a problem as that is what our RFID reader circuit runs through. So you have to need to Change This.
. l. et's go your Raspberry Pi terminal and write sudo raspi-config
Flow this for Changing your setting
Some default setting Change
2. Now you have to need to restart your system
3. Once your Raspberry Pi has finished rebooting, we can now check to make sure that it has in fact been enabled. The easiest way to do this is to run the following command to see if spi_bcm2835 is listed.
lsmod | grep spi
Step-4Now time to update your system and install a library
Before we start programming, we first need to update our Raspberry Pi to ensure it’s running the latest version of all the software. Run the following two commands on your Raspberry Pi to update it
and flow this commend
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install python3-dev python3-pip
sudo pip3 install spidev
Now time to install RFID-RC522 library flowing this commend
sudo pip3 install mfrc522
My previous tutorial