Op werkdagen vóór 14:00 uur besteld = dezelfde dag verzonden en in 98% van de gevallen de volgende dag in huis. Gratis retourneren 30 dagen bedenktijd 1 jaar garantie
← Tillbaka till översikten

Vid uppspelning laddas videon från YouTube.

Kopplingsschema och kodexempel

Så här kopplar du RFID-RC522 NFC Kit MFRC522 S50 Mifare inkl. RFID Fudan Card en Key Tag till en Arduino UNO eller ESP32, med ett exempel­sketch som du kan ladda upp direkt.

RC522 RFID Card Reader UID Scanner

This project reads the unique identifier (UID) and card type from 13.56 MHz RFID cards or key fobs using the RC522 module. An external 4-channel logic level shifter safely translates the Arduino Uno's 5V SPI and control signals to 3.3V. Open the Serial Monitor at 115200 baud and bring a card close to the reader to view its UID.

Kopplingsschema: RFID-RC522 NFC Kit MFRC522 S50 Mifare inkl. RFID Fudan Card en Key Tag på en Arduino UNO
Kopplingsschema · Klicka för att förstora
Kopplingstabell: RFID-RC522 NFC Kit MFRC522 S50 Mifare inkl. RFID Fudan Card en Key Tag på en Arduino UNO
Kopplingstabell · Klicka för att förstora
RC522_RFID_Card_Reader_UID_Scanner.ino · kompilerad och testad
/*
 * ==================================================================
 *  Generated by Codey.online  —  https://www.codey.online
 * ==================================================================
 *  Project   : RC522 RFID Card Reader UID Scanner
 *  Board     : Arduino UNO (arduino:avr:uno)
 *  Parts     : RFID RC522 Module 13.56MHz
 *  Libraries : MFRC522 1.4.12
 *
 *  Codey Online is an AI-powered browser IDE for Arduino and ESP32.
 *  Describe your project and Codey writes the code, draws the wiring
 *  diagram and uploads it to your board, straight from the browser.
 *  This code is free to use, modify and share, without warranty.
 * ==================================================================
 */

#include <SPI.h>
#include <MFRC522.h>

#define SS_PIN 10
#define RST_PIN 9

MFRC522 rfid(SS_PIN, RST_PIN);

void setup() {
  Serial.begin(115200);
  while (!Serial) {
    ; // Wait for serial port
  }

  SPI.begin();
  rfid.PCD_Init();

  Serial.println(F("RC522 RFID Reader Ready."));
  Serial.println(F("Place an RFID card/tag near the antenna..."));
}

void loop() {
  // Look for new RFID cards
  if (!rfid.PICC_IsNewCardPresent() || !rfid.PICC_ReadCardSerial()) {
    return;
  }

  Serial.print(F("Card UID: "));
  for (byte i = 0; i < rfid.uid.size; i++) {
    if (rfid.uid.uidByte[i] < 0x10) {
      Serial.print(F("0"));
    }
    Serial.print(rfid.uid.uidByte[i], HEX);
    if (i < rfid.uid.size - 1) {
      Serial.print(F(" "));
    }
  }
  Serial.println();

  // Print card type
  MFRC522::PICC_Type piccType = rfid.PICC_GetType(rfid.uid.sak);
  Serial.print(F("Card Type: "));
  Serial.println(rfid.PICC_GetTypeName(piccType));
  Serial.println();

  // Stop reading current card
  rfid.PICC_HaltA();
  rfid.PCD_StopCrypto1();
}

Nödvändiga bibliotek: MFRC522 1.4.12

Wiring diagram and example code generated by Codey.online — https://www.codey.online

RFID RC522 Card UID Reader with ESP32

This project reads RFID tags and smart cards using the RC522 13.56 MHz RFID module over SPI. When a card or key fob is brought near the reader, its Unique Identifier (UID) and card type are printed to the Serial Monitor.

Kopplingsschema: RFID-RC522 NFC Kit MFRC522 S50 Mifare inkl. RFID Fudan Card en Key Tag på en ESP32 DevKit V1
Kopplingsschema · Klicka för att förstora
Kopplingstabell: RFID-RC522 NFC Kit MFRC522 S50 Mifare inkl. RFID Fudan Card en Key Tag på en ESP32 DevKit V1
Kopplingstabell · Klicka för att förstora
RFID_RC522_Card_UID_Reader_with_ESP32.ino · kompilerad och testad
/*
 * ==================================================================
 *  Generated by Codey.online  —  https://www.codey.online
 * ==================================================================
 *  Project   : RFID RC522 Card UID Reader with ESP32
 *  Board     : ESP32 DEVKIT V1 (esp32:esp32:esp32doit-devkit-v1)
 *  Parts     : RFID RC522 Module 13.56MHz
 *  Libraries : MFRC522 1.4.12
 *
 *  Codey Online is an AI-powered browser IDE for Arduino and ESP32.
 *  Describe your project and Codey writes the code, draws the wiring
 *  diagram and uploads it to your board, straight from the browser.
 *  This code is free to use, modify and share, without warranty.
 * ==================================================================
 */

#include <SPI.h>
#include <MFRC522.h>

#define SS_PIN  5
#define RST_PIN 4

MFRC522 rfid(SS_PIN, RST_PIN);

void setup() {
  Serial.begin(115200);
  while (!Serial);

  SPI.begin();     // Initialize SPI bus
  rfid.PCD_Init(); // Initialize MFRC522 reader

  Serial.println("--- RFID RC522 Initialized ---");
  Serial.println("Hold an RFID card or key fob near the reader...");
}

void loop() {
  // Look for new RFID cards
  if (!rfid.PICC_IsNewCardPresent()) {
    return;
  }

  // Select one of the cards
  if (!rfid.PICC_ReadCardSerial()) {
    return;
  }

  // Print Card UID
  Serial.print("Card UID: ");
  for (byte i = 0; i < rfid.uid.size; i++) {
    if (rfid.uid.uidByte[i] < 0x10) {
      Serial.print(" 0");
    } else {
      Serial.print(" ");
    }
    Serial.print(rfid.uid.uidByte[i], HEX);
  }
  Serial.println();

  // Print PICC type
  MFRC522::PICC_Type piccType = rfid.PICC_GetType(rfid.uid.sak);
  Serial.print("Card Type: ");
  Serial.println(rfid.PICC_GetTypeName(piccType));

  // Halt PICC and stop encryption
  rfid.PICC_HaltA();
  rfid.PCD_StopCrypto1();

  delay(1000);
}

Nödvändiga bibliotek: MFRC522 1.4.12

Wiring diagram and example code generated by Codey.online — https://www.codey.online

Tidigare visade

CNC aluminium servoarm M3 - 25T, för MG995 MG946R MG996R MG945 S3003

CNC aluminium servoarm M3 - 25T, för MG995 MG946R MG996R MG945 S3003

€ 2,25
Startkit för Arduino Uno R3 med 0.96 inch OLED-display & 40-delars Dupont-kabelset

Startkit för Arduino Uno R3 med 0.96 inch OLED-display & 40-delars Dupont-kabelset

€ 15,80
Visa
Smart Car Model Robot Gummihjul/Auto däck 85x38mm för Arduino, passar 4WD/2WD - Metallic Röd

Smart Car Model Robot Gummihjul/Auto däck 85x38mm för Arduino, passar 4WD/2WD - Metallic Röd

€ 5,15
Digital skjutmått i rostfritt stål med display 0-150 mm inkl. batteri och förvaringsetui

Digital skjutmått i rostfritt stål med display 0-150 mm inkl. batteri och förvaringsetui

€ 18,35
Visa
Svart | RFID-tag nyckelring droppe | 13,56Mhz | 1K S50 | Mifare Classic

Svart | RFID-tag nyckelring droppe | 13,56Mhz | 1K S50 | Mifare Classic

€ 0,90
10-polig Connector/Terminal-kabel, 1-sidig - male, 26AWG 20cm, XH2.54mm

10-polig Connector/Terminal-kabel, 1-sidig - male, 26AWG 20cm, XH2.54mm

€ 0,95
Dupont jumperkablar 40 st (hane-hona) 10cm trådbyglar för breadboard

Dupont jumperkablar 40 st (hane-hona) 10cm trådbyglar för breadboard

€ 1,70