RFID-RC522 Issue

Hi!
Im not sure if this is the ritgh forum for my issue.

I bougth a RFID-RC522 Module on Dx:

And I try everything, and still doesnt work with my Arduino UNO.

I use this miguelbalboa library (GitHub - miguelbalboa/rfid: Arduino RFID Library for MFRC522) and I follow the this pin connection:

MOSI: Pin 11
MISO: Pin 12
SCK: Pin 13
SDA: Pin 10
RST: Pin 9
3.3v: Pin 3.3v
gnd: Ping GND

After trying to debug i found that the rfid.isCard() function returns a 2 value (MI_ERR). can anyone help me please? Maybe my pinout or the library is wrong.

Regards!

I just tried his code on mine, and it works swell.

Double check your serial baud rate - that your monitor matches his setting in the code.

If you can post of picture of your wiring, I can help you verify your correct pinout.

I just tried his cardReadout program, it works very well, though there is a flaw within. Its not detrimental, but if two of your cards have an identical integer in the same place as the last card read, it will ignore it and print out dots instead. It will think it is the same card. It is easily repairable though. Change all the (&&)s to (||)s.

Thks!
After try and try, finally works. it was a connection issue!

I am also having trouble with my RFID-RC522.
The code complies and loads (below).

But nothing happens when I put a card up to it?

Is there anyway I can test the parts so i can figure out which isn't?

/**
* Read a card using a mfrc522 reader on your SPI interface
* Pin layout should be as follows (on Arduino Uno):
* MOSI: Pin 11 / ICSP-4
* MISO: Pin 12 / ICSP-1
* SCK: Pin 13 / ISCP-3
* SS: Pin 10
* RST: Pin 9
*
* Script is based on the script of Miguel Balboa. 
* New cardnumber is printed when card has changed. Only a dot is printed
* if card is the same.
*
* @version 0.1
* @author Henri de Jong
* @since 06-01-2013
*/

#include <SPI.h>
#include <RFID.h>

#define SS_PIN 10
#define RST_PIN 9

RFID rfid(SS_PIN, RST_PIN); 

// Setup variables:
    int serNum0;
    int serNum1;
    int serNum2;
    int serNum3;
    int serNum4;

void setup()
{ 
  Serial.begin(9600);
  SPI.begin(); 
  rfid.init();
  
}

void loop()
{
    
    if (rfid.isCard()) {
        if (rfid.readCardSerial()) {
            if (rfid.serNum[0] != serNum0
                && rfid.serNum[1] != serNum1
                && rfid.serNum[2] != serNum2
                && rfid.serNum[3] != serNum3
                && rfid.serNum[4] != serNum4
            ) {
                /* With a new cardnumber, show it. */
                Serial.println(" ");
                Serial.println("Card found");
                serNum0 = rfid.serNum[0];
                serNum1 = rfid.serNum[1];
                serNum2 = rfid.serNum[2];
                serNum3 = rfid.serNum[3];
                serNum4 = rfid.serNum[4];
               
                //Serial.println(" ");
                Serial.println("Cardnumber:");
                Serial.print("Dec: ");
		Serial.print(rfid.serNum[0],DEC);
                Serial.print(", ");
		Serial.print(rfid.serNum[1],DEC);
                Serial.print(", ");
		Serial.print(rfid.serNum[2],DEC);
                Serial.print(", ");
		Serial.print(rfid.serNum[3],DEC);
                Serial.print(", ");
		Serial.print(rfid.serNum[4],DEC);
                Serial.println(" ");
                        
                Serial.print("Hex: ");
		Serial.print(rfid.serNum[0],HEX);
                Serial.print(", ");
		Serial.print(rfid.serNum[1],HEX);
                Serial.print(", ");
		Serial.print(rfid.serNum[2],HEX);
                Serial.print(", ");
		Serial.print(rfid.serNum[3],HEX);
                Serial.print(", ");
		Serial.print(rfid.serNum[4],HEX);
                Serial.println(" ");
             } else {
               /* If we have the same ID, just write a dot. */
               Serial.print(".");
             }
          }
    }
    
    rfid.halt();
}

Hello,

I have the same reader as in OP, and an Arduino Mega; so I use the specified pin layout:
SDA -> 53
SCK -> 52
MOSI -> 51
MISO -> 50
IRQ -> Not connected
GND -> GND
RST -> 5
3.3V -> 3.3V

I added the library from GitHub - miguelbalboa/rfid: Arduino RFID Library for MFRC522 to the library folder and when I compile one of the examples like "DumpInfo.ino", there don't seem to be any errors. But when I upload it , the serial monitor prints "Scan PICC to see UID and type..." from the setup like it should, but if I try to scan my tags, nothing happens...
To make the library, I copied the .h and .cpp files into notepad and saved with a .h and .cpp extention, and then placed them both in a folder, all named MFRC522. I assume this is the right way?
Do you have to do anything else to get this working? Is my reader broken? Any advice would be very helpful, since I'm all out of ideas.

Thank you,
Aaron

I should mention I tried three different credible libraries without success. Maybe the tags are broken or empty or something?

I tried this code:

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

#define SAD 10
#define RST 5

MFRC522 nfc(SAD, RST);

void setup() {
  SPI.begin();
  Serial.begin(115200);

  Serial.println("Looking for MFRC522.");
  nfc.begin();

  uint8_t version = nfc.getFirmwareVersion();
  if (! version) {
    Serial.print("Didn't find MFRC522 board.");
    while(1); //halt
  }

  Serial.print("Found chip MFRC522 ");
  Serial.print("Firmware ver. 0x");
  Serial.print(version, HEX);
  Serial.println(".");
  
  if (nfc.digitalSelfTestPass()) {
      Serial.print("Digital self test by MFRC522 passed.");
  } else {
      Serial.print("Digital self test by MFRC522 failed.");
  }
}

void loop() {

}

with the libraries on this site:

and I got the following on my serial monitor:

Looking for MFRC522.
Didn't find MFRC522 board.

So does this mean the reader is broken?
The LED is on and the wires should be connected ok.
I tried with and without connecting RST to pin 5.

I'm sorry for triple posting.

I've finally managed to get a reading out of my cards.
When using Arduino Mega 2560, you should wire the pins like mentioned on this page:
http://arduino.cc/en/Main/arduinoBoardMega under "Input and Output":
SPI: 50 (MISO), 51 (MOSI), 52 (SCK), 53 (SS). These pins support SPI communication, which, although provided by the underlying hardware, is not currently included in the Arduino language. The SPI pins are also broken out on the ICSP header, which is physically compatible with the Duemilanove and Diecimila.
then adjust the

#define SS_PIN 10
#define RST_PIN 5

to

#define SS_PIN 53
#define RST_PIN 5

in the sketch.

Finally i can start implementing :slight_smile:

I spent a couple of hours trying to figure out what was going wrong with my RC522 board, wondering if it was broken or if was a software problem. I checked the pins and the code several times, over and over again. Just before giving up and conclude that the board was damaged, I remade the pins soldering and voilá, it worked! So, if the settings and pin connections seem okay and you're still having problems, mind the soldering XD

well, Im here, with the same problem

I have 2 RC522 cards, the arduino leonardo and Mega2560, I have proven all the combinations, I have been trying for 3 days, and i dont have any results, I cant read anything!, anything!, even I tried with 4 codes, and nothing.

I've connected and disconnected, uploaded the codes many times.

I read the suggestion above, and I remade the pins soldering of the two RC522 cards, but nothin yet.
I dont know what to do, I am desperate and hopeless, nothing works :frowning:

I saw the code step by step and the problem is that the card doesn't detect anything. I alway get a TIME_OUT ERROR.

please help.

It finally works, but with another tag that I bought in another place, and not with that came along with it.

Someone knows why?, the tag is perfect

After testing, mine worked with Arduino version 1.0.4. I don't know why but maybe the latest as of the writing which is Arduino 1.5.8 doesn't seem to respond with the example codes of the MFRC522.h library of Miguel Balboa. Please post your Arduino version and let everyone know, which versions worked and not. Please try the 1.0.4 version. Mine worked in that version and not in the latest.

I too had a similar issue where a crappy soldering job left me searching for hours to find out that I needed to re-solder. I have my RC522 attached to a sainsmart mega 2560 with an LCD keypad shield.
Attached is a picture for reference in case someone is looking for a similar setup.

I hame a similar problem. I connected mc522 RFID reader/writer to arduino uno, loaded dumpinfo from library i downloaded from here and it worked for a while. Then a created my own program that didn't work so i loaded back that dumpinfo but sadly that didn't work either. Do you have any idea what did i f****d up?

Aaron90:
I tried this code:

#include <MFRC522.h>

#include <SPI.h>

#define SAD 10
#define RST 5

MFRC522 nfc(SAD, RST);

void setup() {
  SPI.begin();
  Serial.begin(115200);

Serial.println("Looking for MFRC522.");
  nfc.begin();

uint8_t version = nfc.getFirmwareVersion();
  if (! version) {
    Serial.print("Didn't find MFRC522 board.");
    while(1); //halt
  }

Serial.print("Found chip MFRC522 ");
  Serial.print("Firmware ver. 0x");
  Serial.print(version, HEX);
  Serial.println(".");
 
  if (nfc.digitalSelfTestPass()) {
      Serial.print("Digital self test by MFRC522 passed.");
  } else {
      Serial.print("Digital self test by MFRC522 failed.");
  }
}

void loop() {

}



with the libraries on this site:
https://github.com/ljos/MFRC522
and I got the following on my serial monitor:So does this mean the reader is broken?
The LED is on and the wires should be connected ok. 
I tried with and without connecting RST to pin 5.

I'm sorry for triple posting.

I tryed that too and this came up on my serial monitor:
Looking for MFRC522.
Found chip MFRC522 Firmware ver. 0x92.
0
Digital self test by MFRC522 failed.

I'm getting realy desperate.