1

i brought a rfid module which is rc 522 but when i upload the code it is not reading the card even when i upload example code i have returned it 2 times and got it replaced but the same problem may i know the solution

#include "SPI.h" // SPI library
#include "MFRC522.h" // RFID library (https://github.com/miguelbalboa/rfid)
const int pinRST = 9;
const int pinSDA = 10;
MFRC522 mfrc522(pinSDA, pinRST); // Set up mfrc522 on the Arduino
void setup() {
 SPI.begin(); // open SPI connection
 mfrc522.PCD_Init(); // Initialize Proximity Coupling Device (PCD)
 Serial.begin(9600); // open serial connection
}
void loop() {
 if (mfrc522.PICC_IsNewCardPresent()) { // (true, if RFID tag/card is present ) PICC = Proximity Integrated Circuit Card
 if(mfrc522.PICC_ReadCardSerial()) { // true, if RFID tag/card was read
 Serial.print("RFID TAG ID:");
 for (byte i = 0; i < mfrc522.uid.size; ++i) { // read id (in parts)
 Serial.print(mfrc522.uid.uidByte[i], HEX); // print id as hex values
 Serial.print(" "); // add space between hex blocks to increase readability
 }
 Serial.println(); // Print out of id is complete.
 }
 }
}

this is one of the many codes i used

asked Nov 8, 2021 at 6:07
4
  • 1
    What gets printed? You have a lot of serial prints there, can you please edit the question and share what you see? Commented Nov 8, 2021 at 6:17
  • 1
    i just see nothing Commented Nov 8, 2021 at 14:50
  • Possibly you have wired it incorrectly. Without seeing any photos, links to the module you bought, or schematics, it is very hard, if not impossible, to say. Commented Nov 9, 2021 at 6:15
  • SDA 10, SCK 13, MOSI 11, MISO 12, IRQ UNUSED, GND GND, RST 9, 3.3V 3.3V, i dont feel they are wrong Commented Nov 9, 2021 at 14:05

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.