OpenSource Section | SB.Chetak Innovation | Research • Engineering • Responsible Knowledge Sharing

SURAKSHA

Smart Security Lock with Automatic Attendance System and Automatic Unwanted-Access Stopper System

Security Automation • Embedded Systems • Smart Attendance

Controller: Arduino Mega 2560 Identification: RFID and Fingerprint Lock: 12 V Solenoid Logging: RTC and SD Card Connectivity: ESP32 Open-Source Project

SURAKSHA integrates access verification, automatic attendance, door-lock control and unwanted-access prevention in a single embedded platform. Authorised users can be verified through RFID cards or fingerprint authentication, while unauthorised attempts activate a siren, red warning indicator and access-denied response.

Introduction

Conventional door locks normally provide only physical access control and do not automatically record attendance or identify repeated unauthorised attempts. Separate attendance registers also require manual operation and may contain errors.

SURAKSHA was developed to combine electronic locking, user identification, entry and exit monitoring, attendance logging, role-based permissions and unauthorised-access prevention in one system.

The prototype uses an Arduino Mega as the central controller. RFID and fingerprint systems verify users, while a relay operates the 12 V solenoid lock. The LCD displays access messages, the RTC provides accurate time, and the SD card stores attendance and security events.

SURAKSHA smart security and automatic attendance prototype
Figure 1: SURAKSHA prototype showing the RFID reader, fingerprint sensor, LCD, lock-control circuit, relay and power arrangement.

Abstract

SURAKSHA is a smart electronic access-control and attendance system developed using an Arduino Mega, RFID reader, fingerprint sensor, I2C LCD, RTC, SD-card module, relay and solenoid lock.

When a user presents an RFID card or fingerprint, the system checks the stored authorisation information. Valid users receive access, the solenoid unlocks and the attendance event is recorded with the date and time.

Invalid, blocked or unauthorised credentials are rejected. The system activates a red indicator and siren and stores the denied-access attempt. A magnetic door sensor monitors whether the door is open or closed, while an exit switch supports controlled movement from inside.

Keywords: Smart Security Lock, RFID, Fingerprint Authentication, Automatic Attendance, Solenoid Lock, RTC, SD-Card Logging, Door Sensor, Access Control and Embedded Systems.
SURAKSHA hardware components layout
Figure 2: SURAKSHA hardware components layout including Arduino Mega 2560, DS3231 RTC, SPI SD Module, and Solenoid Lock driver.

Objectives

Secure EntryElectronic access via registered RFID cards & fingerprints
Auto AttendanceLogs entry/exit time automatically on SD card
Unwanted Access StopperTriggers siren & red warning light on invalid attempt
Role PermissionsSupports User, Admin and Super Admin access levels

Features

  • RFID-card identification (RC522)
  • Fingerprint-based biometric verification
  • Automatic entry and exit attendance recording
  • Date & time stamping via DS3231 RTC
  • Attendance & security logs stored on SD card
  • Relay-controlled 12V solenoid door lock
  • Siren & red light alarm for illegal entry
  • ESP32 provision for online sync

Role-Based Access System

Standard Role

Registered User

Can enter using an authorised RFID card or fingerprint. Access is logged automatically.

Management Role

Administrator

Can manage normal access operations, review attendance logs and resolve system alerts.

Highest Permission

Super Administrator

Has unrestricted authorised access, emergency override permission and full system configuration access.

Arduino Mega Source Code

⬇️ Download Code (.ino)

The core C++ Arduino Mega code for SURAKSHA handling MFRC522 RFID, Fingerprint Sensor, DS3231 RTC, SD logging, relay solenoid lock, and alarm system.

#include <SPI.h>
#include <MFRC522.h>
#include <Adafruit_Fingerprint.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <RTClib.h>
#include <SD.h>

#define SS_PIN 53
#define RST_PIN 5
#define RELAY_PIN 7
#define SIREN_PIN 8
#define LED_GREEN 9
#define LED_RED 10

MFRC522 rfid(SS_PIN, RST_PIN);
LiquidCrystal_I2C lcd(0x27, 16, 2);
RTC_DS3231 rtc;

void setup() {
    Serial.begin(9600);
    SPI.begin();
    rfid.PCD_Init();
    lcd.init(); lcd.backlight();

    pinMode(RELAY_PIN, OUTPUT);
    pinMode(SIREN_PIN, OUTPUT);
    pinMode(LED_GREEN, OUTPUT);
    pinMode(LED_RED, OUTPUT);
    digitalWrite(RELAY_PIN, LOW); // Solenoid locked
    
    if (!rtc.begin()) lcd.print("RTC Error");
    if (!SD.begin(4))  lcd.print("SD Error");

    lcd.setCursor(0, 0); lcd.print("SURAKSHA SYSTEM");
    lcd.setCursor(0, 1); lcd.print("Scan Card/Finger");
}

void loop() {
    if (rfid.PICC_IsNewCardPresent() && rfid.PICC_ReadCardSerial()) {
        grantAccess("RFID User");
    }
}
                    

Open-Source Resources

Freely Available for Study and Reproduction

SURAKSHA is released as an open-source research and engineering project on this portal. All hardware schematics, pin configurations, component lists and source code are freely available for educational and non-commercial reproduction.

Arduino Sketch (.ino)
Wiring Schematic
Hardware Components List
SD Card Logging Format

Open-Source Security System Project

SURAKSHA is published as an open-source project on opensource.bagresearch.co.in. You may study, reproduce and modify it in accordance with open-source guidelines.