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

Arduino UNO-Based Secure Entry System with RFID, Keypad, and LCD Display

View and Edit Project In Cirkit DesignerImage of Arduino UNO-Based Secure Entry System with RFID, Keypad, and LCD Display

Secure Entry Management System Documentation

Summary

This document provides a detailed overview of a Secure Entry Management System designed using an Arduino UNO microcontroller. The system integrates an RFID-RC522 module, a 4x4 membrane matrix keypad, an I2C LCD 16x2 screen, a servo motor, and a buzzer. The system provides real-time feedback and controls a locking mechanism based on user input and RFID authentication.

Component List

  1. Arduino UNO

    • Description: Microcontroller board based on the ATmega328P.
    • Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0, A1, A2, A3, A4, A5, SCL, SDA, AREF, D13, D12, D11, D10, D9, D8, D7, D6, D5, D4, D3, D2, D1, D0
  2. I2C LCD 16x2 Screen

    • Description: 16x2 character LCD display with I2C interface.
    • Pins: SCL, SDA, VCC (5V), GND, VDD, VO, RS, RW, E, D0, D1, D2, D3, D4, D5, D6, D7, BLA, BLK
  3. RFID-RC522

    • Description: RFID module for reading and writing RFID tags.
    • Pins: VCC (3.3V), RST, GND, IRQ, MISO, MOSI, SCK, SDA
  4. 4X4 Membrane Matrix Keypad

    • Description: 4x4 matrix keypad for user input.
    • Pins: R1, R2, R3, R4, C1, C2, C3, C4
  5. Servo

    • Description: Servo motor for controlling the locking mechanism.
    • Pins: GND, VCC, PWM
  6. Buzzer

    • Description: Buzzer for audio feedback.
    • Pins: PIN, GND

Wiring Details

Arduino UNO

I2C LCD 16x2 Screen

RFID-RC522

4X4 Membrane Matrix Keypad

Servo

Buzzer

Code Documentation

/*
 * Secure Entry Management System
 * This Arduino sketch controls an access system using an RFID-RC522 module,
 * a 4x4 membrane matrix keypad, an I2C LCD 16x2 screen, a servo motor, and
 * a buzzer. The system provides real-time feedback and controls a locking
 * mechanism based on user input and RFID authentication.
 */

#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <Servo.h>
#include <MFRC522.h>
#include <Keypad.h>

// Pin definitions
#define RST_PIN 9
#define SS_PIN 10
#define BUZZER_PIN 7
#define SERVO_PIN 6

// Create instances
LiquidCrystal_I2C lcd(0x27, 16, 2);
Servo myServo;
MFRC522 rfid(SS_PIN, RST_PIN);

// Keypad setup
const byte ROWS = 4;
const byte COLS = 4;
char keys[ROWS][COLS] = {
  {'1','2','3','A'},
  {'4','5','6','B'},
  {'7','8','9','C'},
  {'*','0','#','D'}
};
byte rowPins[ROWS] = {2, 3, 4, 5};
byte colPins[COLS] = {A0, A1, A2, A3};
Keypad keypad = Keypad(makeKeymap(keys), rowPins, colPins, ROWS, COLS);

void setup() {
  // Initialize serial communication
  Serial.begin(9600);
  // Initialize LCD
  lcd.begin();
  lcd.backlight();
  // Initialize Servo
  myServo.attach(SERVO_PIN);
  myServo.write(0); // Lock position
  // Initialize RFID
  SPI.begin();
  rfid.PCD_Init();
  // Initialize Buzzer
  pinMode(BUZZER_PIN, OUTPUT);
  // Welcome message
  lcd.setCursor(0, 0);
  lcd.print("Welcome!");
  lcd.setCursor(0, 1);
  lcd.print("Scan your card");
}

void loop() {
  // Check for RFID card
  if (rfid.PICC_IsNewCardPresent() && rfid.PICC_ReadCardSerial()) {
    lcd.clear();
    lcd.setCursor(0, 0);
    lcd.print("Card detected");
    // Add your RFID authentication logic here
    // For now, we assume the card is valid
    lcd.setCursor(0, 1);
    lcd.print("Access Granted");
    myServo.write(90); // Unlock position
    digitalWrite(BUZZER_PIN, HIGH);
    delay(1000);
    digitalWrite(BUZZER_PIN, LOW);
    delay(5000); // Keep unlocked for 5 seconds
    myServo.write(0); // Lock position
    lcd.clear();
    lcd.setCursor(0, 0);
    lcd.print("Welcome!");
    lcd.setCursor(0, 1);
    lcd.print("Scan your card");
  }
  // Check for keypad input
  char key = keypad.getKey();
  if (key) {
    lcd.clear();
    lcd.setCursor(0, 0);
    lcd.print("Key pressed:");
    lcd.setCursor(0, 1);
    lcd.print(key);
    // Add your keypad handling logic here
    delay(1000);
    lcd.clear();
    lcd.setCursor(0, 0);
    lcd.print("Welcome!");
    lcd.setCursor(0, 1);
    lcd.print("Scan your card");
  }
}

This code initializes the components and provides the main logic for the Secure Entry Management System. The system checks for RFID card presence and keypad input, providing appropriate feedback and controlling the servo motor and buzzer accordingly.