Stufin
Home Quick Cart Profile

RFID Card Read

Buy Now on Stufin

Pin Configuration

  • RFID Card Read Component Documentation
  • Overview
  • The RFID Card Read component is a ubiquitous module used in various IoT applications to read and identify radio-frequency identification (RFID) cards. This module is designed to operate at a frequency of 13.56 MHz and supports ISO/IEC 14443A and ISO/IEC 18092 protocols.
  • Pinout Description
  • The RFID Card Read component has a total of 8 pins, which are described below:
  • 1. VCC (Power Supply Pin)
  • Pin Location: Top-left corner
  • Pin Type: Power
  • Description: This pin supplies power to the module. It should be connected to a 3.3V or 5V DC power source.
  • Recommended Connection: Connect to a 3.3V or 5V power supply rail.
  • 2. GND (Ground Pin)
  • Pin Location: Top-right corner
  • Pin Type: Ground
  • Description: This pin provides a ground connection for the module.
  • Recommended Connection: Connect to a common ground point in the system.
  • 3. RST (Reset Pin)
  • Pin Location: Bottom-left corner
  • Pin Type: Digital
  • Description: This pin is used to reset the module. A low pulse (typically 10ms) on this pin resets the module.
  • Recommended Connection: Connect to a digital output pin of a microcontroller or a dedicated reset signal.
  • 4. IRQ (Interrupt Pin)
  • Pin Location: Bottom-center
  • Pin Type: Digital
  • Description: This pin generates an interrupt signal when a card is detected or removed.
  • Recommended Connection: Connect to a digital input pin of a microcontroller to detect card events.
  • 5. SCK (Clock Pin)
  • Pin Location: Top-center
  • Pin Type: Digital
  • Description: This pin is used for clocking data transmission between the module and the microcontroller.
  • Recommended Connection: Connect to a SPI clock output pin of a microcontroller.
  • 6. MOSI (Master Out Slave In Pin)
  • Pin Location: Top-right corner (next to VCC)
  • Pin Type: Digital
  • Description: This pin transmits data from the microcontroller to the module.
  • Recommended Connection: Connect to a SPI MOSI output pin of a microcontroller.
  • 7. MISO (Master In Slave Out Pin)
  • Pin Location: Bottom-right corner
  • Pin Type: Digital
  • Description: This pin receives data from the module and transmits it to the microcontroller.
  • Recommended Connection: Connect to a SPI MISO input pin of a microcontroller.
  • 8. NC (Not Connected Pin)
  • Pin Location: Bottom-left corner (next to RST)
  • Pin Type: N/A
  • Description: This pin is not connected internally and should be left unconnected.
  • Connection Structure
  • To connect the RFID Card Read component to a microcontroller, follow the structure below:
  • VCC -> 3.3V or 5V Power Supply
  • GND -> Common Ground
  • RST -> Microcontroller Digital Output Pin (Reset Signal)
  • IRQ -> Microcontroller Digital Input Pin (Interrupt Detection)
  • SCK -> Microcontroller SPI Clock Output Pin
  • MOSI -> Microcontroller SPI MOSI Output Pin
  • MISO -> Microcontroller SPI MISO Input Pin
  • NC -> Leave Unconnected
  • Note: Ensure to use a suitable voltage level translator or level shifter if the microcontroller operates at a different voltage level than the RFID Card Read component.

Code Examples

RFID Card Read Component Documentation
The RFID Card Read component is a peripheral device that allows for the reading of Radio-Frequency Identification (RFID) tags embedded in cards, passports, or other objects. This component is commonly used in access control systems, inventory tracking, and identification applications.
Technical Specifications:
Operating Frequency: 13.56 MHz
 Communication Interface: UART (Universal Asynchronous Receiver-Transmitter)
 Reading Range: Up to 10 cm (4 inches)
 Supported RFID Protocols: ISO 14443A, ISO 14443B, ISO 18092
 Power Supply: 5V DC, 100 mA
Code Examples:
### Example 1: Basic RFID Card Reading using Arduino
This example demonstrates how to use the RFID Card Read component with an Arduino board to read an RFID card and display the card's unique identifier (UID) on the serial monitor.
```c++
#include <SoftwareSerial.h>
#define RFID_RX_PIN 2
#define RFID_TX_PIN 3
SoftwareSerial rfidSerial(RFID_RX_PIN, RFID_TX_PIN);
void setup() {
  Serial.begin(9600);
  rfidSerial.begin(9600);
}
void loop() {
  String tagUid = readRfidTag();
  if (tagUid != "") {
    Serial.print("RFID Tag UID: ");
    Serial.println(tagUid);
  }
  delay(1000);
}
String readRfidTag() {
  String tagUid = "";
  byte val = 0;
  if (rfidSerial.available() > 0) {
    val = rfidSerial.read();
    if (val == 0x02) { // Start of RFID tag response
      for (int i = 0; i < 5; i++) {
        val = rfidSerial.read();
        tagUid += String(val, HEX);
      }
    }
  }
  return tagUid;
}
```
### Example 2: Using the RFID Card Read component with Raspberry Pi (Python)
This example demonstrates how to use the RFID Card Read component with a Raspberry Pi to read an RFID card and store the card's UID in a SQLite database.
```python
import serial
import sqlite3
# Open the serial connection to the RFID reader
ser = serial.Serial('/dev/ttyUSB0', 9600, timeout=1)
# Connect to the SQLite database
conn = sqlite3.connect('rfid_database.db')
cursor = conn.cursor()
while True:
    # Read the RFID tag
    tag_uid = read_rfid_tag(ser)
if tag_uid:
        # Insert the tag UID into the database
        cursor.execute("INSERT INTO rfid_tags (uid) VALUES (?)", (tag_uid,))
        conn.commit()
        print("RFID Tag UID: ", tag_uid)
# Sleep for 1 second before reading the next tag
    time.sleep(1)
def read_rfid_tag(ser):
    tag_uid = ""
    while True:
        val = ser.read()
        if val == b'x02':  # Start of RFID tag response
            for i in range(5):
                val = ser.read()
                tag_uid += format(val, '02x')
            break
    return tag_uid
```
These code examples demonstrate the basic usage of the RFID Card Read component in different contexts. You can modify and extend these examples to suit your specific application requirements.