RFID card reader issues with MEGA...need help!

I am having issues with my RFID scanner not working...

I have hooked it up to the UNO, changed the pins to work...

When I hook it up to the MEGA, wont work.

There are no error messages either.

Can someone check my code for flow errors?? What am I doing wrong???

Thank you!

Hardware:

Arduino Mega
LCD 16x2
Velleman VMA405 reader
Sensor Shield

// Pin layout should be as follows (on Arduino Uno - Velleman VMA100): 
//* MOSI: Pin 51 / ICSP-4 
//*MISO: Pin 50 / ICSP-1 
//* SCK: Pin 52 / ISCP-3 
//* SS/SDA (MSS on Velleman VMA405) : Pin 53 
//* RST: Pin 5
//* VCC: 3,3V (DO NOT USE 5V, VMA405 WILL BE DAMAGED IF YOU DO SO) 
//* GND: GND on Arduino UNO / Velleman VMA100 
//* IRQ: not used 


#include <LiquidCrystal.h>
#include <Wire.h>
#include <MFRC522.h>
#include <SPI.h>
#include <String.h>

#define SS_PIN 53 
#define RST_PIN 5 
MFRC522 mfrc522(SS_PIN, RST_PIN); 


LiquidCrystal lcd(7, 9, 6, 4, 3, 2);

//Constants

const int pirPin1 = 30; //Hall  Motion
const int pirPin2 = 32; //Front Room Motion
const int pirPin3 = 34; //Kitchen Motion
const int pirPin4 = 36; //Den Motion
const int reedPin1 = 38; //Front Door
const int reedPin2 = 40; //Back Sliding Door
const int reedPin3 = 42; //Front Patio Door
const int reedPin4 = 44; //Laundry Room Door

const int speakerPin = A1;
const int Relay = A0;
const int redPin = 24;
const int greenPin = 22;

bool activateAlarm = false; 
bool alarmActivated = false;




void setup(){
  
  pinMode(pirPin1, INPUT);
  pinMode(pirPin2, INPUT);
  pinMode(pirPin3, INPUT);
  pinMode(pirPin4, INPUT);
  pinMode(reedPin1, INPUT);
  pinMode(reedPin2, INPUT);
  pinMode(reedPin3, INPUT);
  pinMode(reedPin4, INPUT);
  pinMode(speakerPin, OUTPUT);
  pinMode(Relay, OUTPUT);
  pinMode(greenPin, OUTPUT);
  pinMode(redPin, OUTPUT);
  
  
  digitalWrite(pirPin1, LOW);
  digitalWrite(pirPin2, LOW);
  digitalWrite(pirPin3, LOW);
  digitalWrite(pirPin4, LOW);
  digitalWrite(reedPin1, LOW);
  digitalWrite(reedPin2, LOW);
  digitalWrite(reedPin3, LOW);
  digitalWrite(reedPin4, LOW);
  analogWrite(speakerPin, LOW);
  analogWrite(Relay, LOW);
  digitalWrite(greenPin, HIGH);
  digitalWrite(redPin, LOW);
  
  Serial.begin(9600);
  lcd.begin(16,2);
  SPI.begin();
  mfrc522.PCD_Init();
  Serial.println("Scan RFID card...");
  Serial.println();

  
  lcd.print("Welcome to");
  lcd.setCursor(2,1);
  lcd.print("Alarm-duino!");
  delay(5000);

}

void alarmOn(){ 

      digitalWrite(redPin, HIGH);
      digitalWrite(greenPin, LOW);

      analogWrite(Relay, LOW);
      analogWrite(speakerPin, LOW);
      
      lcd.clear(); 
      lcd.setCursor(0,0); 
      lcd.print("Alarm will be"); 
      lcd.setCursor(2,1); 
      lcd.print("activated in"); 
  
      int countdown = 60; 
      
      while (countdown != 0) { 
         lcd.setCursor(13,1); 
         lcd.print(countdown); 
         countdown--; 
      
      delay(1000); 
      }
      
      lcd.clear(); 
      lcd.setCursor(0,0); 
      lcd.print("Alarm Activated!"); 

      alarmActivated = true; 
     
}

void alarmDisabled(){
 
    lcd.print(" Alarm Disabled ");
    
    digitalWrite(redPin, LOW);
    digitalWrite(greenPin, HIGH);
    delay(1000);
    digitalWrite(greenPin, LOW);
    delay(1000);
    digitalWrite(greenPin, HIGH);
    delay(1000);
    digitalWrite(greenPin, LOW);
    delay(1000);
    
    alarmActivated = false;

  }

void alarmTriggered(){

  digitalWrite(redPin, HIGH);
  digitalWrite(greenPin, LOW);

  analogWrite(Relay, HIGH);
  analogWrite(speakerPin, HIGH);


  lcd.setCursor(3,0);
  lcd.print("Alarm");
  lcd.setCursor(2,1);
  lcd.print("Triggered!");
  delay(5000);
  lcd.clear();
}



void loop(){

  if ( ! mfrc522.PICC_IsNewCardPresent()) 
  {
    return;
  }
  // Select one of the cards
  if ( ! mfrc522.PICC_ReadCardSerial()) 
  {
    return;
  }
  //Show UID on serial monitor
  Serial.print("UID tag :");
  String content= "";
  byte letter;
  for (byte i = 0; i < mfrc522.uid.size; i++) 
  {
     Serial.print(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " ");
     Serial.print(mfrc522.uid.uidByte[i], HEX);
     content.concat(String(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " "));
     content.concat(String(mfrc522.uid.uidByte[i], HEX));
  }
  
  Serial.println();
  Serial.print("Message : ");
  content.toUpperCase();
  if (content.substring(1) == "XX XX XX XX") //NOTE: change here the UID of the card/cards that you want to give access
  
  {
    if (alarmActivated = false){
    Serial.println("Alarm On");
    Serial.println();
    delay(500);
    digitalWrite(redPin,HIGH);
    digitalWrite(greenPin,LOW);

    alarmOn();
    checkSensors();
    
    alarmActivated = true;
  }
   if (alarmActivated = true)
    Serial.println("Alarm Off");
    Serial.println();
    delay(500);
    digitalWrite(redPin,LOW);
    digitalWrite(greenPin, HIGH);

    alarmDisabled();
    alarmActivated = false;
  }
}

void checkSensors(){

      
      if (digitalRead(30) == HIGH)
      {
      Serial.println("Motion Detected!");
      lcd.print("Motion - Hall");
      delay(60000);
      lcd.clear();

      alarmTriggered();
    }
    //Front Room Motion
    if (digitalRead(32) == HIGH)
    {
      Serial.println("Motion Detected!");
      lcd.print("Motion - Front Rm");
      delay(60000);
      lcd.clear();
      alarmTriggered();
    }


    //Kitchen Motion
    if (digitalRead(34) == HIGH)
    {
      Serial.println("Motion Detected!");
      lcd.print("Motion - Kitchen");
      delay(60000);
      lcd.clear();
      alarmTriggered();
    }


    //Den Motion
    if (digitalRead(36) == HIGH)
    {
      Serial.println("Motion Detected!");
      lcd.print("Motion - Den");
      delay(60000);
      lcd.clear();
      alarmTriggered();
    }

    //Front Door
    if (digitalRead(38) == HIGH)
    {
      Serial.println("Front Door Open");
      lcd.print("Front Door Open");
      delay(60000);
      lcd.clear();
      alarmTriggered();
    }

    //Back Sliding Door
    if (digitalRead(40) == HIGH)
    {
      Serial.println("Back Sliding Door Open");
      lcd.print("Bck Sl Door Open");
      delay(60000);
      lcd.clear();
      alarmTriggered();
    }

    //Front Patio Door
    if (digitalRead(42) == HIGH)
    {
      Serial.println("Front Patio Door Open");
      lcd.print("Fr Patio Door Open");
      delay(60000);
      lcd.clear();
      alarmTriggered();
    }

    //Laundry Rm Door
    if (digitalRead(44) == HIGH)
    {
      Serial.println("Laundry Door Open");
      lcd.print("Laundry Door Open");
      delay(60000);
      lcd.clear();
      alarmTriggered();
    }
  
}

What am I doing wrong???

You wrote WAY too much code, and have way too much hardware, for a system that doesn't work.

You did NOT tell us how you actually connected the RFID reader to the MEGA. You tell us that by posting a schematic and by posting a picture that proves you followed the schematic.

The picture should NOT show 4 foot long wires all bunched up, all the same color, running out of and back into the picture, which is poorly lit and out of focus.

The code should do NOTHING more than prove that you can read a tag. No relays. No LEDs. No alarms. And ABSOLUTELY NO LCD. NOTHING but the RFID reader should be attached to the Arduino.

Well I've seen numerous people all over the internet with the exact same system as the photo.

Are they stupid or is it just you? Where do you think I got the sketches and schematics?

And according to Arduino.cc, this forum is supposed to be where people get help!

??? >:(

It seems to me it's a place where smart mouths like you have a place to feel superior while hiding behind your keyboard.

I'll figure my problems out on my own.