I tried many ways to get and print UID and other data from a MIFARE Ultralight, but it always ends with an error. I am using the RFID-RC522 reader with an Arduino UNO and thr MFRC522 Library.

I can normally get and print the PICC type of the chip, but that's the only thing that works.

This is how I have connected my RC522 reader:

enter image description here
(source: ytimg.com)

This is my code:

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

#define RST_PIN 9
#define SS_PIN 10

MFRC522 rfid(SS_PIN, RST_PIN);

unsigned long noSignal = 0;

bool lastState = true;
bool read = true;

void setup()
    pinMode(2, OUTPUT); //Red led
    pinMode(3, OUTPUT); //Green led

    while (!Serial);

    Serial.println("RFID ctecka byla uspesne spustena."); //Prints "RFID Reader succesfully started"


void changeLed(bool red) 
    digitalWrite(2, red);
    digitalWrite(3, !red);

void loop()
    if (millis() - noSignal >= 300) 
        read = true;

    bool state = !rfid.PICC_IsNewCardPresent() && !rfid.PICC_ReadCardSerial();

    if (state != lastState)
        if (state)
            noSignal = millis();
        else if (read)
            read = false;

            noSignal = millis();

            Serial.println("---------Cip detekovan----------"); //Prints "Chip detected"

            MFRC522::PICC_Type piccType = rfid.PICC_GetType(rfid.uid.sak);

            Serial.print("Znacka cipu: ");//Prints chip type

            rfid.PICC_DumpToSerial(&rfid.uid); //Here is the error

            Serial.println("---------Cteni skoncilo----------");//prints "Read ended"


    lastState = state;

Serial monitor snapshot:

Maybe an important thing is that when I call PCD_DumpVersionToSerial() I get:

Firmware Version: 0x12 = (unknown)

Somewere I read that my Arduino isn't compatibile with MIFARE Ultralight and I need MIFARE Classic cards. Is that true? Can I solve this problem by using another library or is it a hardware problem?

EDIT: I asked my friend, who has an Arduino too from the same shop as me, if he can read MIFARE Ultralight cards. He said that it's working for him. So my problem will be probably on the hardware side. We both have unofficial Arduinos from AliExpress.

1 Answer 1


In the first lines of code there are two lines that say:

#define RST_PIN 9
#define SS_PIN 10

They define the RESET pin to be on the D9 pin and the SDA on the D10 pin. So you have an connection error try connecting like shown and you should be good to go.

default connection

  • Sorry, I made mistake. I have connected pins like in your picture. I will update my question.
    – mozkomor05
    Commented May 11, 2018 at 17:21
  • @DavidMoškoř have you tried the original example?
    – Coder_fox
    Commented May 11, 2018 at 17:33
  • Yes, same result
    – mozkomor05
    Commented May 11, 2018 at 17:35
  • Is it possible that my cards are using encryption DES3 that my arduino cannot decrypt?
    – mozkomor05
    Commented May 11, 2018 at 17:37
  • 1
    @DavidMoškoř it is possible that your card use a different frequency.
    – Coder_fox
    Commented May 13, 2018 at 8:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.