Wiring For The Raspberry Pi And RFID:
SDA To Pin 24
SCK To Pin 23
MOSI To Pin 19
MISO To Pin 21
GND To Pin 6
RST To Pin 22
3.3v To Pin 1
sudo raspi-config "Enable SPI Setting And Reboot"
sudo apt update
sudo apt upgrade
sudo apt install git python3-dev python3-pip
sudo pip3 install spidev
sudo pip3 install mfrc522
--------------------------------------------------
mkdir rfid
cd rfid
sudo nano write.py "Paste The Following And Save File"
---------------------------------------------------------
#!/usr/bin/env python
import RPi.GPIO as GPIO
from mfrc522 import SimpleMFRC522
reader = SimpleMFRC522()
try:
text = input('New data:')
print("Now place your tag to write")
reader.write(text)
print("Written")
finally:
GPIO.cleanup()
-----------------------------------------------------------
sudo python3 write.py "To Run The write.py Script" "Give New Data A Name"
-----------------------------------------------------------
cd rfid
sudo nano read.py "Paste The Following And Save"
-----------------------------------------------------------
#!/usr/bin/env python
import RPi.GPIO as GPIO
from mfrc522 import SimpleMFRC522
reader = SimpleMFRC522()
try:
id, text = reader.read()
print(id)
print(text)
finally:
GPIO.cleanup()
-----------------------------------------------------------
Now It Should Print Out The New Data ID