RFID with Raspberry Pi
RFID with Raspberry Pi
We used a raspberry Pi to read and write our college identification cards which utilise NFC chips to open doors. The raspberry Pi is connected to a breadboard which collects all the wires and formats them conventionally. This breadboard is then connected to an RFID transmitter which is used to read and write the cards. Below is our setup:
Then, we use two python scripts to read and write data to the cards.
read.py
import RPi.GPIO as GPIO
from mfrc522 import SimpleMFRC522
reader=SimpleMFRC522()
try:
id, text = reader.read()
print(id)
print(text)
finally:
GPIO.cleanup()
write.py
import RPi.GPIO as GPIO
from mfrc522 import SimpleMFRC522
reader=SimpleMFRC522()
try:
id, text = reader.read()
print(id)
print(text)
finally:
GPIO.cleanup()
Comments
Post a Comment