Go Down

Topic: RFID - RC522 problem - not working. (Read 160 times) previous topic - next topic

almogsh

Sep 19, 2018, 12:44 am Last Edit: Sep 19, 2018, 12:48 am by almogsh
Code: [Select]

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

#define RST_PIN         9          // Configurable, see typical pin layout above
#define SS_PIN          10         // Configurable, see typical pin layout above

MFRC522 mfrc522(SS_PIN, RST_PIN);  // Create MFRC522 instance

void setup() {
 Serial.begin(9600); // Initialize serial communications with the PC
 while (!Serial); // Do nothing if no serial port is opened (added for Arduinos based on ATMEGA32U4)
 SPI.begin(); // Init SPI bus
 mfrc522.PCD_Init(); // Init MFRC522
 mfrc522.PCD_DumpVersionToSerial(); // Show details of PCD - MFRC522 Card Reader details
 Serial.println(F("Scan PICC to see UID, SAK, type, and data blocks..."));
}

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

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

 // Dump debug info about the card; PICC_HaltA() is automatically called
 mfrc522.PICC_DumpToSerial(&(mfrc522.uid));
}


when i open the Serial monitor this that i see :
"
firmware Version: 0x0 = (unknown)
WARNING: communication failure, is the MFR522 properly connected?
Scan PICC to see UID, SAK, type , and date blocks..."

what is the problem ?

PaulS

Post a link to the device you are using. Is it really a 3.3V device? If it IS, you MAY need level shifters to get the 3.3V output up to the 5V levels that the Arduino expects.
The art of getting good answers lies in asking good questions.

almogsh


PaulS

i use - arduino mega 2560
So? That's a 5V device, too. Your picture shows the reader connected to the 3.3V pin for power. If it's a 5V device, it is connected incorrectly.
The art of getting good answers lies in asking good questions.

almogsh

So? That's a 5V device, too. Your picture shows the reader connected to the 3.3V pin for power. If it's a 5V device, it is connected incorrectly.
But i conect to the 3.3v in the bord, not to the 5v pin.
So What is the corect pin ?

PaulS

But i conect to the 3.3v in the bord, not to the 5v pin.
So What is the corect pin ?
That depends. Is your RFID reader a 5V device or a 3.3V device?

If it is a 5V device, you need to connect it to the 5V pin. If it is a 3.3V device, you need to connect it to the 3.3V pin BUT you also need level shifters (to get the 3.3V outputs up to 5V and to get the 5V outputs down to 3.3V).
The art of getting good answers lies in asking good questions.

almogsh

That depends. Is your RFID reader a 5V device or a 3.3V device?

If it is a 5V device, you need to connect it to the 5V pin. If it is a 3.3V device, you need to connect it to the 3.3V pin BUT you also need level shifters (to get the 3.3V outputs up to 5V and to get the 5V outputs down to 3.3V).
my connections the same like the friz photo that i uplode in the main post. the FRID need 3.3V and its connect to the 3.3V output pin in the arduino mega.
maybe i missing somethings but its still giving my that annoying massage in the Serial monitor.

Grumpy_Mike

Quote
maybe i missing somethings
You are missing something.

A 5V board will produce 5V signals at the outputs. If you feed 5V signals into the inputs of 3V3 device then you destroy that device. It looks like that is what you have done. Also the 3V3 output of your reader feeding into a 5V board's input is just below the minimum voltage needed to register as a logic one. Sometimes it works but they are not guaranteed to.

PaulS

Quote
maybe i missing somethings
You are. You are missing a link to the freaking device you are using that proves that is a 3.3V device.

If it IS, you are missing level shifters on the output lines.
The art of getting good answers lies in asking good questions.

Go Up