RFID reader MFRC522, wiring issue

Hey everyone,
I'm currently working with a MFRC522 for a project, and i'm having a weird wiring issue. If I use a 22awg 6 conductor wire to power and communicate with the MFRC522, everything works. If I split the power in another 22awg 2 conductor wire without changing anything else (same MFRC522, exact same power bus, exact same code, same RFID tag) the MFRC522 just won't work anymore. It initializes but won't read or write. We're trying to split the connections in a 2 conductor and a 4 conductor (2+4 = 6) to allow a better cable management. Do you guys have any idea? Here's my code:

#include <Arduino.h>
#include <MFRC522.h>
#include <RFID.h>
#include <Config.h>

void writeRFID();
void readRFID();

void setup() {
Serial.begin(9600);
RFID_init(rfid_sda_pin);
Serial.println("setup done");
readRFID();
}

void loop() {
// put your main code here, to run repeatedly:
}

void writeRFID()
{
uint16_t NumCassette = 1325;
Serial.println(NumCassette);
while (!RFID_write_ID(NumCassette))
;
Serial.print("wrote successfully : ");
Serial.println(NumCassette);
}

void readRFID()
{
byte dataWritten[ID_LENGTH];
int i = 0;
while (!read_chip(mIdPage, ID_LENGTH, dataWritten, false))
{
delay(500);
}

uint16_t combinedValue = ((uint16_t)dataWritten[1] << 8) | dataWritten[0];
Serial.print("Read : ");
Serial.println(combinedValue);
}

Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'

Use code tags (the < CODE/ > icon above the compose window) to make it easier to read and copy for examination

https://forum.arduino.cc/t/how-to-get-the-best-out-of-this-forum

What you have done is to replace 6 wires with 6 wires so it should still work. My guess is that you have not wired it correctly when you used the 4+2 wiring

What Arduino?
Which MFRC522 breakout board?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.