Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

RFID-Enabled Access Control System with GSM Notification and Solenoid Lock

View and Edit Project In Cirkit DesignerImage of RFID-Enabled Access Control System with GSM Notification and Solenoid Lock

Circuit Documentation

Summary

This circuit is designed to control access using an RFID system. When a valid RFID card is presented to the RFID-RC522 reader, the Arduino Mega 2560 activates a relay that controls a 12V solenoid lock, granting access. The system also includes a SIM 800L GSM module for communication, a 4x4 keypad for input, and an LCD TFT screen for user interface. The circuit is powered by a 12V power supply, with a step-down converter providing 5V where needed. Multiple resistors are used for interfacing and pull-up/pull-down purposes.

Component List

RFID-RC522

12V Solenoid Lock

12V Power Supply

4X4 Membrane Matrix Keypad

SIM 800L V2.0 GSM

Arduino Mega 2560

Relay Module 1 Channel

2.1mm Barrel Jack with Terminal Block

12V to 5V Step Down Power Converter

LCD TFT Screen ILI9488 HD

Resistor (200 Ohms)

Fingerprint Scanner

Wiring Details

RFID-RC522

12V Solenoid Lock

12V Power Supply

4X4 Membrane Matrix Keypad

SIM 800L V2.0 GSM

Relay Module 1 Channel

LCD TFT Screen ILI9488 HD

Fingerprint Scanner

Documented Code

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

#define SS_PIN 10
#define RST_PIN 9
#define RELAY_PIN 22

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

void setup() {
  Serial.begin(9600);  // Initialize serial communications
  SPI.begin();         // Init SPI bus
  mfrc522.PCD_Init();  // Init MFRC522
  pinMode(RELAY_PIN, OUTPUT);
  digitalWrite(RELAY_PIN, LOW);  // Ensure relay is off at start
  Serial.println("Place your card to the reader...");
  Serial.println();
}

void loop() {
  // Look for new cards
  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 = "";
  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();
  content.toUpperCase();

  // Check if the UID matches a known card
  if (content.substring(1) == "YOUR_CARD_UID") {  // Replace YOUR_CARD_UID with the actual UID of your card
    Serial.println("Access Granted");
    digitalWrite(RELAY_PIN, HIGH);  // Activate relay
    delay(5000);                    // Keep relay on for 5 seconds
    digitalWrite(RELAY_PIN, LOW);   // Deactivate relay
  } else {
    Serial.println("Access Denied");
  }
}

This code is for the Arduino Mega 2560 and is responsible for reading RFID cards and controlling the relay based on the card's UID. The relay, in turn, controls the solenoid lock. The code includes setup and loop functions, SPI communication, and serial output for debugging.