primensa.blogg.se

Card reader and writer raspberry pi
Card reader and writer raspberry pi








card reader and writer raspberry pi

We have placed this code in an infinite loop, which means that the Raspberry Pi will continuously read the output from the RFID module. To read the RFID card date, we call the read() function and store its output in the variables id and text.įinally, we print the ID and text of the card to the terminal with print(id) and print(text), respectively.

card reader and writer raspberry pi card reader and writer raspberry pi

Then we use rfid = SimpleMFRC522() to create a new object which we will call RFID. import RPi.GPIO as GPIOįirst, we import the necessary modules. Then, create a Python file rfidReader.py and paste the following code. To do this, connect the components as shown in the diagram above. Our first step will be to read the information on the RFID card. Then, install the MFRC522 Python library with the following command: sudo pip3 install mfrc522 Code to Read the RFID Card You also need to install pip3 with this command: sudo apt-get -y install python3-pip How to Program the RFID Card Reader with Pythonīefore we get started programming, make sure the SPI interface is enabled on your Raspberry Pi.










Card reader and writer raspberry pi