RFID sensor with less then 1 cm distance activation ... WHYY ???

So guys,

This is my very first topic, and I'm really embarrassed about this situation.
Really Asking for help !!!!

I have two projects: 4 and 9 RFIDs next to each other ( RFID RC522). If all of them has the token nearby, so a maglock will open.

Sound simple, but i faced a huge problem here :((((

The first problem it was after the first test i realized that my Cards NOT working. Neither of them. Only the tokens. Well, this was not a big issue for me, because anyway, i wanted to use my tokens only. But it was REALLY strange ... Anyway, I made this program, and i can't make the sensor range more than 8mm ??? I mean, what is happening here? As i know the RFID token must be working max 6cm !!!! , and i can't even go further than 1 cm.

First, i thought i have a hardware problem... I bought different Arduinos and sensors, but i have exactly the same problem here.

Now i think i have an issue with my program ... Can anyone help me, please ? I would really appreciate it

Here is the program:

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

#define RST_PIN 9

#define SS_1_PIN 10
#define SS_2_PIN 8
#define SS_3_PIN 7
#define SS_4_PIN 6

#define NR_OF_READERS 4

byte ssPins[] = {SS_1_PIN, SS_2_PIN, SS_3_PIN, SS_4_PIN};

int a = 0;
int b = 0;
int c = 0;
int d = 0;

int rele = 5;

const byte ROWS = 1; //four rows
const byte COLS = 1; //four columns
//define the cymbols on the buttons of the keypads
char hexaKeys[ROWS][COLS] = {
{'1'}
};
byte rowPins[ROWS] = {2}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {3}; //connect to the column pinouts of the keypad

//initialize an instance of class NewKeypad
Keypad customKeypad = Keypad( makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS);

MFRC522 mfrc522[NR_OF_READERS]; // Create MFRC522 instance.

/**
Initialize.
*/
void setup() {

Serial.begin(115200); // Initialize serial communications with the PC
//while (!Serial); // Do nothing if no serial port is opened (added for Arduinos based on ATMEGA32U4)

pinMode(rele, OUTPUT);
digitalWrite(rele, HIGH);

SPI.begin(); // Init SPI bus

for (uint8_t reader = 0; reader < NR_OF_READERS; reader++)
{
mfrc522[reader].PCD_Init(ssPins[reader], RST_PIN); // Init each MFRC522 card
mfrc522.PCD_SetRegisterBitMask(mfrc522.RFCfgReg, (0x07<<4));
}
}

void loop()
{
for (uint8_t reader = 0; reader < NR_OF_READERS; reader++)

{
// Look for new cards

if (mfrc522[reader].PICC_IsNewCardPresent() && mfrc522[reader].PICC_ReadCardSerial())
{
Serial.print(F("Reader "));
Serial.print(reader);
Serial.println(F(":"));
// Show some details of the PICC (that is: the tag/card)
Serial.print(F("Card UID:"));
dump_byte_array(mfrc522[reader].uid.uidByte, mfrc522[reader].uid.size);
Serial.println();
Serial.print(F("PICC type: "));
MFRC522::PICC_Type piccType = mfrc522[reader].PICC_GetType(mfrc522[reader].uid.sak);
Serial.println(mfrc522[reader].PICC_GetTypeName(piccType));
Serial.println();

if (mfrc522[reader].uid.uidByte[0] == 22 &
mfrc522[reader].uid.uidByte[1] == 112 &
mfrc522[reader].uid.uidByte[2] == 38 &
mfrc522[reader].uid.uidByte[3] == 126 &
reader == 0 )
{
Serial.println(F("0-s kartya oke"));
a++;
}
if (mfrc522[reader].uid.uidByte[0] != 22 &
mfrc522[reader].uid.uidByte[1] != 112 &
mfrc522[reader].uid.uidByte[2] != 38 &
mfrc522[reader].uid.uidByte[3] != 126 &
reader == 0)
{
Serial.println(F("nem 0-s kartya"));
a = 0;
}

if (mfrc522[reader].uid.uidByte[0] == 86 &
mfrc522[reader].uid.uidByte[1] == 220 &
mfrc522[reader].uid.uidByte[2] == 36 &
mfrc522[reader].uid.uidByte[3] == 126 &
reader == 1 )
{
Serial.println(F("1-es kartya oke"));
b++;
}
if (mfrc522[reader].uid.uidByte[0] != 86 &
mfrc522[reader].uid.uidByte[1] != 220 &
mfrc522[reader].uid.uidByte[2] != 36 &
mfrc522[reader].uid.uidByte[3] != 126 &
reader == 1 )
{
Serial.println(F("nem 1-s kartya"));
b = 0;
}

if (mfrc522[reader].uid.uidByte[0] == 134 &
mfrc522[reader].uid.uidByte[1] == 57 &
mfrc522[reader].uid.uidByte[2] == 25 &
mfrc522[reader].uid.uidByte[3] == 126 &
reader == 2 )
{
Serial.println(F("2-es kartya oke"));
c++;
}
if (mfrc522[reader].uid.uidByte[0] != 134 &
mfrc522[reader].uid.uidByte[1] != 57 &
mfrc522[reader].uid.uidByte[2] != 25 &
mfrc522[reader].uid.uidByte[3] != 126 &
reader == 2 )
{
Serial.println(F("nem 2-s kartya"));
c = 0;
}

if (mfrc522[reader].uid.uidByte[0] == 06 &
mfrc522[reader].uid.uidByte[1] == 106 &
mfrc522[reader].uid.uidByte[2] == 34 &
mfrc522[reader].uid.uidByte[3] == 126 &
reader == 3 )
{
Serial.println(F("3-es kartya oke"));
d++;
}
if (mfrc522[reader].uid.uidByte[0] != 06 &
mfrc522[reader].uid.uidByte[1] != 106 &
mfrc522[reader].uid.uidByte[2] != 34 &
mfrc522[reader].uid.uidByte[3] != 126 &
reader == 3 )
{
Serial.println(F("nem 3-s kartya"));
d = 0;
}

Serial.println();

// Halt PICC
mfrc522[reader].PICC_HaltA();
// Stop encryption on PCD
mfrc522[reader].PCD_StopCrypto1();
} //if (mfrc522[reader].PICC_IsNewC
} //for(uint8_t reader

if (a > 0 & b > 0 & c > 0 & d > 0)
{

char key = customKeypad.getKey();

digitalWrite(rele, LOW);
Serial.println("NYITVA");
if(key == '1')
{
Serial.println("ZÁRVA");
digitalWrite(rele, HIGH);
a = 0;
b = 0;
c = 0;
d = 0;
}

}

}

/**
Helper routine to dump a byte array as hex values to Serial.
/
void dump_byte_array(byte buffer, byte bufferSize)
{
for (byte i = 0; i < bufferSize; i++)
{
Serial.print(buffer < 0x10 ? " 0" : " ");
_ Serial.print(buffer
, DEC);
_
* }*
}

I have two projects: 4 and 9 RFIDs next to each other

The readers interfere with each other.

Post code properly, using code tags.

Hello, Thank you for the reply.

Well the strange thing, that i tried this program with only 1 RFID connected, and i experienced same issue.

The reader didnt read the card, but only the token. And the distance had to be less then 1 cm :////

I will post the code with the correct tags yestarday.

Here is the 9RFID program.
Can you see any problem there?

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

#define RST_PIN 40

#define SS_1_PIN 30
#define SS_2_PIN 29
#define SS_3_PIN 28
#define SS_4_PIN 27
#define SS_5_PIN 26
#define SS_6_PIN 25
#define SS_7_PIN 24
#define SS_8_PIN 23
#define SS_9_PIN 22

#define NR_OF_READERS 9

byte ssPins[] = {SS_1_PIN, SS_2_PIN, SS_3_PIN, SS_4_PIN, SS_5_PIN, SS_6_PIN, SS_7_PIN, SS_8_PIN, SS_9_PIN};

int a = 0;
int b = 0;
int c = 0;
int d = 0;
int e = 0;
int f = 0;
int g = 0;
int h = 0;
int i = 0;

int rele = 5;

MFRC522 mfrc522[NR_OF_READERS]; // Create MFRC522 instance.

void setup() {

Serial.begin(115200); // Initialize serial communications with the PC

pinMode(rele, OUTPUT);
digitalWrite(rele, HIGH);

SPI.begin(); // Init SPI bus

for (uint8_t reader = 0; reader < NR_OF_READERS; reader++)
{
mfrc522[reader].PCD_Init(ssPins[reader], RST_PIN); // Init each MFRC522 card
}
}

void loop()
{
for (uint8_t reader = 0; reader < NR_OF_READERS; reader++)

{
// Look for new cards

if (mfrc522[reader].PICC_IsNewCardPresent() && mfrc522[reader].PICC_ReadCardSerial())
{
Serial.print(F("Reader "));
Serial.print(reader);
Serial.println(F(":"));
// Show some details of the PICC (that is: the tag/card)
Serial.print(F("Card UID:"));
dump_byte_array(mfrc522[reader].uid.uidByte, mfrc522[reader].uid.size);
Serial.println();
Serial.print(F("PICC type: "));
MFRC522::PICC_Type piccType = mfrc522[reader].PICC_GetType(mfrc522[reader].uid.sak);
Serial.println(mfrc522[reader].PICC_GetTypeName(piccType));
Serial.println();

if (mfrc522[reader].uid.uidByte[0] == 22 &
mfrc522[reader].uid.uidByte[1] == 112 &
mfrc522[reader].uid.uidByte[2] == 38 &
mfrc522[reader].uid.uidByte[3] == 126 &
reader == 0 )
{
Serial.println(F("0-s kartya oke"));
a++;
}
if (mfrc522[reader].uid.uidByte[0] != 22 &
mfrc522[reader].uid.uidByte[1] != 112 &
mfrc522[reader].uid.uidByte[2] != 38 &
mfrc522[reader].uid.uidByte[3] != 126 &
reader == 0)
{
Serial.println(F("nem 0-s kartya"));
a = 0;
}

if (mfrc522[reader].uid.uidByte[0] == 86 &
mfrc522[reader].uid.uidByte[1] == 220 &
mfrc522[reader].uid.uidByte[2] == 36 &
mfrc522[reader].uid.uidByte[3] == 126 &
reader == 1 )
{
Serial.println(F("1-es kartya oke"));
b++;
}
if (mfrc522[reader].uid.uidByte[0] != 86 &
mfrc522[reader].uid.uidByte[1] != 220 &
mfrc522[reader].uid.uidByte[2] != 36 &
mfrc522[reader].uid.uidByte[3] != 126 &
reader == 1 )
{
Serial.println(F("nem 1-es kartya"));
b = 0;
}

if (mfrc522[reader].uid.uidByte[0] == 134 &
mfrc522[reader].uid.uidByte[1] == 57 &
mfrc522[reader].uid.uidByte[2] == 25 &
mfrc522[reader].uid.uidByte[3] == 126 &
reader == 2 )
{
Serial.println(F("2-es kartya oke"));
c++;
}
if (mfrc522[reader].uid.uidByte[0] != 134 &
mfrc522[reader].uid.uidByte[1] != 57 &
mfrc522[reader].uid.uidByte[2] != 25 &
mfrc522[reader].uid.uidByte[3] != 126 &
reader == 2 )
{
Serial.println(F("nem 2-es kartya"));
c = 0;
}

if (mfrc522[reader].uid.uidByte[0] == 06 &
mfrc522[reader].uid.uidByte[1] == 106 &
mfrc522[reader].uid.uidByte[2] == 34 &
mfrc522[reader].uid.uidByte[3] == 126 &
reader == 3 )
{
Serial.println(F("3-as kartya oke"));
d++;
}
if (mfrc522[reader].uid.uidByte[0] != 06 &
mfrc522[reader].uid.uidByte[1] != 106 &
mfrc522[reader].uid.uidByte[2] != 34 &
mfrc522[reader].uid.uidByte[3] != 126 &
reader == 3 )
{
Serial.println(F("nem 3-as kartya"));
d = 0;
}

if (mfrc522[reader].uid.uidByte[0] == 06 &
mfrc522[reader].uid.uidByte[1] == 106 &
mfrc522[reader].uid.uidByte[2] == 34 &
mfrc522[reader].uid.uidByte[3] == 126 &
reader == 4 )
{
Serial.println(F("4-es kartya oke"));
e++;
}
if (mfrc522[reader].uid.uidByte[0] != 06 &
mfrc522[reader].uid.uidByte[1] != 106 &
mfrc522[reader].uid.uidByte[2] != 34 &
mfrc522[reader].uid.uidByte[3] != 126 &
reader == 4 )
{
Serial.println(F("nem 4-es kartya"));
e = 0;
}
if (mfrc522[reader].uid.uidByte[0] == 06 &
mfrc522[reader].uid.uidByte[1] == 106 &
mfrc522[reader].uid.uidByte[2] == 34 &
mfrc522[reader].uid.uidByte[3] == 126 &
reader == 5 )
{
Serial.println(F("5-ös kartya oke"));
f++;
}
if (mfrc522[reader].uid.uidByte[0] != 06 &
mfrc522[reader].uid.uidByte[1] != 106 &
mfrc522[reader].uid.uidByte[2] != 34 &
mfrc522[reader].uid.uidByte[3] != 126 &
reader == 5 )
{
Serial.println(F("nem 5-ös kartya"));
f = 0;
}
if (mfrc522[reader].uid.uidByte[0] == 06 &
mfrc522[reader].uid.uidByte[1] == 106 &
mfrc522[reader].uid.uidByte[2] == 34 &
mfrc522[reader].uid.uidByte[3] == 126 &
reader == 6 )
{
Serial.println(F("6-os kartya oke"));
g++;
}
if (mfrc522[reader].uid.uidByte[0] != 06 &
mfrc522[reader].uid.uidByte[1] != 106 &
mfrc522[reader].uid.uidByte[2] != 34 &
mfrc522[reader].uid.uidByte[3] != 126 &
reader == 6 )
{
Serial.println(F("nem 6-os kartya"));
g = 0;
}

if (mfrc522[reader].uid.uidByte[0] == 06 &
mfrc522[reader].uid.uidByte[1] == 106 &
mfrc522[reader].uid.uidByte[2] == 34 &
mfrc522[reader].uid.uidByte[3] == 126 &
reader == 7 )
{
Serial.println(F("7-es kartya oke"));
h++;
}
if (mfrc522[reader].uid.uidByte[0] != 06 &
mfrc522[reader].uid.uidByte[1] != 106 &
mfrc522[reader].uid.uidByte[2] != 34 &
mfrc522[reader].uid.uidByte[3] != 126 &
reader == 7 )
{
Serial.println(F("nem 7-es kartya"));
h = 0;
}

if (mfrc522[reader].uid.uidByte[0] == 06 &
mfrc522[reader].uid.uidByte[1] == 106 &
mfrc522[reader].uid.uidByte[2] == 34 &
mfrc522[reader].uid.uidByte[3] == 126 &
reader == 8 )
{
Serial.println(F("8-as kartya oke"));
i++;
}
if (mfrc522[reader].uid.uidByte[0] != 06 &
mfrc522[reader].uid.uidByte[1] != 106 &
mfrc522[reader].uid.uidByte[2] != 34 &
mfrc522[reader].uid.uidByte[3] != 126 &
reader == 8 )
{
Serial.println(F("nem 8-as kartya"));
i = 0;
}

Serial.println();

// Halt PICC
mfrc522[reader].PICC_HaltA();
// Stop encryption on PCD
mfrc522[reader].PCD_StopCrypto1();
} //if (mfrc522[reader].PICC_IsNewC
} //for(uint8_t reader

if (a > 0 & b > 0 & c > 0 & d > 0 & e > 0 & f > 0 & g > 0 & h > 0 & i > 0)
{
digitalWrite(rele, LOW);
Serial.println("NYITVA");
delay(30000);
Serial.println("ZÁRVA");
digitalWrite(rele, HIGH);
a = 0;
b = 0;
c = 0;
d = 0;
e = 0;
f = 0;
g = 0;
h = 0;
i = 0;
}

}

/**
Helper routine to dump a byte array as hex values to Serial.
/
void dump_byte_array(byte buffer, byte bufferSize)
{
for (byte i = 0; i < bufferSize; i++)
{
Serial.print(buffer < 0x10 ? " 0" : " ");
_ Serial.print(buffer
, DEC);
_
* }*
}

Why did you not use code tags when posting? Please edit your posts to add them ("</>" button).

How do i do that ?

Read "How to use this forum".

Done.

So what can be the problem, do you know?

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

#define RST_PIN         40

#define SS_1_PIN        30
#define SS_2_PIN        29
#define SS_3_PIN        28
#define SS_4_PIN        27
#define SS_5_PIN        26
#define SS_6_PIN        25
#define SS_7_PIN        24
#define SS_8_PIN        23
#define SS_9_PIN        22

#define NR_OF_READERS  9

byte ssPins[] = {SS_1_PIN, SS_2_PIN, SS_3_PIN, SS_4_PIN, SS_5_PIN, SS_6_PIN, SS_7_PIN, SS_8_PIN, SS_9_PIN};

int a = 0;
int b = 0;
int c = 0;
int d = 0;
int e = 0;
int f = 0;
int g = 0;
int h = 0;
int i = 0;

int rele = 5;

MFRC522 mfrc522[NR_OF_READERS];   // Create MFRC522 instance.

void setup() {

  Serial.begin(115200); // Initialize serial communications with the PC

  pinMode(rele, OUTPUT);
  digitalWrite(rele, HIGH);

  SPI.begin();        // Init SPI bus

  for (uint8_t reader = 0; reader < NR_OF_READERS; reader++)
  {
    mfrc522[reader].PCD_Init(ssPins[reader], RST_PIN); // Init each MFRC522 card
  }
}

void loop()
{
  for (uint8_t reader = 0; reader < NR_OF_READERS; reader++)

  {
    // Look for new cards

    if (mfrc522[reader].PICC_IsNewCardPresent() && mfrc522[reader].PICC_ReadCardSerial())
    {
      Serial.print(F("Reader "));
      Serial.print(reader);
      Serial.println(F(":"));
      // Show some details of the PICC (that is: the tag/card)
      Serial.print(F("Card UID:"));
      dump_byte_array(mfrc522[reader].uid.uidByte, mfrc522[reader].uid.size);
      Serial.println();
      Serial.print(F("PICC type: "));
      MFRC522::PICC_Type piccType = mfrc522[reader].PICC_GetType(mfrc522[reader].uid.sak);
      Serial.println(mfrc522[reader].PICC_GetTypeName(piccType));
      Serial.println();

      if (mfrc522[reader].uid.uidByte[0] == 22 &
          mfrc522[reader].uid.uidByte[1] == 112 &
          mfrc522[reader].uid.uidByte[2] == 38 &
          mfrc522[reader].uid.uidByte[3] == 126 &
          reader == 0 )
      {
        Serial.println(F("0-s kartya oke"));
        a++;
      }
      if (mfrc522[reader].uid.uidByte[0] != 22 &
          mfrc522[reader].uid.uidByte[1] != 112 &
          mfrc522[reader].uid.uidByte[2] != 38 &
          mfrc522[reader].uid.uidByte[3] != 126 &
          reader == 0)
      {
        Serial.println(F("nem 0-s kartya"));
        a = 0;
      }

      if (mfrc522[reader].uid.uidByte[0] == 86 &
          mfrc522[reader].uid.uidByte[1] == 220 &
          mfrc522[reader].uid.uidByte[2] == 36 &
          mfrc522[reader].uid.uidByte[3] == 126 &
          reader == 1 )
      {
        Serial.println(F("1-es kartya oke"));
        b++;
      }
      if (mfrc522[reader].uid.uidByte[0] != 86 &
          mfrc522[reader].uid.uidByte[1] != 220 &
          mfrc522[reader].uid.uidByte[2] != 36 &
          mfrc522[reader].uid.uidByte[3] != 126 &
          reader == 1 )
      {
        Serial.println(F("nem 1-es kartya"));
        b = 0;
      }

      if (mfrc522[reader].uid.uidByte[0] == 134 &
          mfrc522[reader].uid.uidByte[1] == 57 &
          mfrc522[reader].uid.uidByte[2] == 25 &
          mfrc522[reader].uid.uidByte[3] == 126 &
          reader == 2 )
      {
        Serial.println(F("2-es kartya oke"));
        c++;
      }
      if (mfrc522[reader].uid.uidByte[0] != 134 &
          mfrc522[reader].uid.uidByte[1] != 57 &
          mfrc522[reader].uid.uidByte[2] != 25 &
          mfrc522[reader].uid.uidByte[3] != 126 &
          reader == 2 )
      {
        Serial.println(F("nem 2-es kartya"));
        c = 0;
      }

      if (mfrc522[reader].uid.uidByte[0] == 06 &
          mfrc522[reader].uid.uidByte[1] == 106 &
          mfrc522[reader].uid.uidByte[2] == 34 &
          mfrc522[reader].uid.uidByte[3] == 126 &
          reader == 3 )
      {
        Serial.println(F("3-as kartya oke"));
        d++;
      }
      if (mfrc522[reader].uid.uidByte[0] != 06 &
          mfrc522[reader].uid.uidByte[1] != 106 &
          mfrc522[reader].uid.uidByte[2] != 34 &
          mfrc522[reader].uid.uidByte[3] != 126 &
          reader == 3 )
      {
        Serial.println(F("nem 3-as kartya"));
        d = 0;
      }

      if (mfrc522[reader].uid.uidByte[0] == 06 &
          mfrc522[reader].uid.uidByte[1] == 106 &
          mfrc522[reader].uid.uidByte[2] == 34 &
          mfrc522[reader].uid.uidByte[3] == 126 &
          reader == 4 )
      {
        Serial.println(F("4-es kartya oke"));
        e++;
      }
      if (mfrc522[reader].uid.uidByte[0] != 06 &
          mfrc522[reader].uid.uidByte[1] != 106 &
          mfrc522[reader].uid.uidByte[2] != 34 &
          mfrc522[reader].uid.uidByte[3] != 126 &
          reader == 4 )
      {
        Serial.println(F("nem 4-es kartya"));
        e = 0;
      }
      if (mfrc522[reader].uid.uidByte[0] == 06 &
          mfrc522[reader].uid.uidByte[1] == 106 &
          mfrc522[reader].uid.uidByte[2] == 34 &
          mfrc522[reader].uid.uidByte[3] == 126 &
          reader == 5 )
      {
        Serial.println(F("5-ös kartya oke"));
        f++;
      }
      if (mfrc522[reader].uid.uidByte[0] != 06 &
          mfrc522[reader].uid.uidByte[1] != 106 &
          mfrc522[reader].uid.uidByte[2] != 34 &
          mfrc522[reader].uid.uidByte[3] != 126 &
          reader == 5 )
      {
        Serial.println(F("nem 5-ös kartya"));
        f = 0;
      }
      if (mfrc522[reader].uid.uidByte[0] == 06 &
          mfrc522[reader].uid.uidByte[1] == 106 &
          mfrc522[reader].uid.uidByte[2] == 34 &
          mfrc522[reader].uid.uidByte[3] == 126 &
          reader == 6 )
      {
        Serial.println(F("6-os kartya oke"));
        g++;
      }
      if (mfrc522[reader].uid.uidByte[0] != 06 &
          mfrc522[reader].uid.uidByte[1] != 106 &
          mfrc522[reader].uid.uidByte[2] != 34 &
          mfrc522[reader].uid.uidByte[3] != 126 &
          reader == 6 )
      {
        Serial.println(F("nem 6-os kartya"));
        g = 0;
      }


      if (mfrc522[reader].uid.uidByte[0] == 06 &
          mfrc522[reader].uid.uidByte[1] == 106 &
          mfrc522[reader].uid.uidByte[2] == 34 &
          mfrc522[reader].uid.uidByte[3] == 126 &
          reader == 7 )
      {
        Serial.println(F("7-es kartya oke"));
        h++;
      }
      if (mfrc522[reader].uid.uidByte[0] != 06 &
          mfrc522[reader].uid.uidByte[1] != 106 &
          mfrc522[reader].uid.uidByte[2] != 34 &
          mfrc522[reader].uid.uidByte[3] != 126 &
          reader == 7 )
      {
        Serial.println(F("nem 7-es kartya"));
        h = 0;
      }


      if (mfrc522[reader].uid.uidByte[0] == 06 &
          mfrc522[reader].uid.uidByte[1] == 106 &
          mfrc522[reader].uid.uidByte[2] == 34 &
          mfrc522[reader].uid.uidByte[3] == 126 &
          reader == 8 )
      {
        Serial.println(F("8-as kartya oke"));
        i++;
      }
      if (mfrc522[reader].uid.uidByte[0] != 06 &
          mfrc522[reader].uid.uidByte[1] != 106 &
          mfrc522[reader].uid.uidByte[2] != 34 &
          mfrc522[reader].uid.uidByte[3] != 126 &
          reader == 8 )
      {
        Serial.println(F("nem 8-as kartya"));
        i = 0;
      }



      Serial.println();

      // Halt PICC
      mfrc522[reader].PICC_HaltA();
      // Stop encryption on PCD
      mfrc522[reader].PCD_StopCrypto1();
    } //if (mfrc522[reader].PICC_IsNewC
  } //for(uint8_t reader

  if (a > 0 & b > 0 & c > 0 & d > 0 & e > 0 & f > 0 & g > 0 & h > 0 & i > 0)
  {
    digitalWrite(rele, LOW);
    Serial.println("NYITVA");
    delay(30000);
    Serial.println("ZÁRVA");
    digitalWrite(rele, HIGH);
    a = 0;
    b = 0;
    c = 0;
    d = 0;
    e = 0;
    f = 0;
    g = 0;
    h = 0;
    i = 0;
  }


}

/**
  Helper routine to dump a byte array as hex values to Serial.
*/
void dump_byte_array(byte *buffer, byte bufferSize)
{
  for (byte i = 0; i < bufferSize; i++)
  {
    Serial.print(buffer < 0x10 ? " 0" : " ");
    Serial.print(buffer, DEC);
  }
}