Arduino electronic door locking with RTC module and LCD display

Hello to everyone.
This is my first project with arduino which i have to do for my subject in school.
My idea was that i use arduino to unlock door. on the lcd screen must be the real time clock and messages when the doors are opened whith a card. I also attach my diagram. The RTC module is not draw in attachemt. I write a program but i have a problem with the counter of false readed cards. Can you please help me to fix that?

kon_na.zip (1.62 KB)

Can you please help me to fix that?

Probably. But, you are going to have to do a lot better than “i have a problem with the counter of false readed cards”.

  if (strlen(newTag)== 0) { // don't do anything if the newTag array is full of zeroes
    return;
  }

  else {

This is almost NEVER the proper approach. Having a return statement in loop() is rarely the correct thing to do. Write the code to do something when there is data, not to return when there is no data.

    int total = 0;

    for (int ct=0; ct < kTags; ct++){
        total += checkTag(newTag, knownTags[ct]);
    }

Your checkTag() method does not handle the case where the two input arrays are not the same length. It does not make sense to ADD the values returned by checkTag().