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.
Let's go
Step-1First, 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 here
Equipment List- Raspberry Pi
- Micro SD Card
- Power Supply
- RC522 RFID Reader
- Breadboard
- Breadboard Wire
This book will help you to learn more about other Raspberry Pi projects and Raspberry Pi
Step-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
sudo raspi-config
Flow this for Changing your setting
Some default setting Change
2. Now you have to need to restart your system
sudo reboot
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-4
Now time to update your system and install a libraryBefore 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
Step-5
Code
My previous tutorial
PIR Motion Sensor using Raspberry Pi4 | Interfacing Tutorial
Raspberry pi4 Workshop PIR Sensor -Email Sending Movement Detector using IFTTT
Controlling a DC Motor with Raspberry Pi4
How to Use the Raspberry Pi4 Camera And PIR Sensor to Send Emails
Raspberry Pi4 Distance Sensor using the JSN-SR04T
How to connect 16x2 LCD with Raspberry pi4
Comments
Please log in or sign up to comment.