Header Ads Widget

Responsive Advertisement

IoT-Based Bank Security Lock System (Blynk Integration)

 Circuit Diagram:





🏦 Bank Security Lock System

Multi-Layered Security with Blynk IoT Remote Control

This IoT-based security system is engineered specifically for bank vault protection. It utilizes an ESP32 to manage a sophisticated multi-layered security protocol: motion detection via PIR, physical authentication via RFID, and global remote monitoring/control through the Blynk IoT platform.

📋 Components List

  • MCU: ESP32-S3
  • RFID: RC522 Reader
  • Motion: PIR Sensor
  • Display: I2C OLED (SSD1306)
  • Actuator: 5V Relay Module
  • Alerts: Buzzer & Dual LEDs
  • Cloud: Blynk IoT Platform

📍 Hardware Pinout Mapping

Component Pin Name ESP32 GPIO Description
RFID-RC522SDA (SS)GPIO 5SPI Chip Select
SCKGPIO 18SPI Clock
MOSIGPIO 23Master Out
MISOGPIO 19Master In
RSTGPIO 4Reset
OLED DisplaySDAGPIO 21I2C Data
SCLGPIO 22I2C Clock
PIR SensorOUTGPIO 32Motion Input
RelayINGPIO 33Lock Actuator
IndicatorsBuzzer/LEDs14, 25, 26Audio/Visual Alerts

⚙️ Software Configuration

Blynk Datastreams:
  • V1 (Virtual Pin 1): Button Switch for Manual Relay/Lock Control.
  • V2 (Virtual Pin 2): Button Switch for Manual Alarm/Buzzer Trigger.
Required Libraries: Blynk, MFRC522, Adafruit SSD1306, Adafruit GFX, Adafruit BusIO.

🛡️ Operational Logic

  • 🔄 Authorized Entry: Valid RFID scans override the system, opening the lock for 3 seconds.
  • 🚨 Security Breach: PIR motion detection immediately triggers visual/audio alert states.
  • 🌐 Remote Override: Administrators can manually operate the lock or sound alarms from anywhere via the Blynk Dashboard.

IoT Bank Security Lock System: ESP32, RFID, PIR, and Blynk

In this project, we are engineering an advanced, cloud-connected IoT Bank Security Lock System using an ESP32. This smart terminal integrates a PIR sensor for immediate intrusion detection, an MFRC522 RFID reader for authorized credential verification, a local SSD1306 OLED interface, and full wireless integration via the Blynk IoT cloud engine for real-time remote overrides and monitoring.

System Architecture & Operations

The firmware manages a dual-layered local defense array combined with cloud-based control pathways:

[PIR Motion Tracking] ────────► Instantly Fires RED LED & Buzzer (Warning UI) │ [MFRC522 RFID Scanner] ────────► Validates Card ──► Releases Safe Relay (3s) │ [Blynk Cloud Integration] ─────► Handles Remote Pin Virtual Overrides (V1 / V2) │ ▼ [OLED Display Terminal]
  • 1. Intrusion Monitoring (PIR): The system continuously checks for motion around the secure vault area. If motion is captured, the RED indicator activates and the buzzer sounds a critical warning tone while changing the OLED to "WARNING! MOTION DETECTED".
  • 2. Bi-Directional Cloud Control (Blynk): Operating via 2.4GHz WiFi, the system updates states onto the cloud panel. Administrators can trigger a manual lock release via Virtual Pin V1 (Relay Control) or pulse the audible alarm manually via Virtual Pin V2 (Buzzer Control) right from their mobile dashboard.
  • 3. Contactless Key Verification: When a valid high-frequency RFID transponder passes the antenna array, the system grants immediate local access, switching the GREEN status LED and opening the safe door solenoid loop via the relay channel for 3 seconds.

Hardware Connection Pinout

For high-frequency performance without communication bus errors, wire your prototype according to this exact connection index:

Target Component Component Pin Function ESP32 Assigned GPIO Pin Interface / Signal Type
PIR Motion Sensor OUT (Data Signal) GPIO 32 Digital Input Reference
Relay Module IN (Control Trigger) GPIO 33 Digital Output Logic
GREEN LED Anode (+) Terminal GPIO 25 Access Approved Indication
RED LED Anode (+) Terminal GPIO 26 Intrusion Alert Light
Buzzer Module Positive Input (+) GPIO 14 Audible Telemetry Output
MFRC522 RFID RST (Hardware Reset) GPIO 4 Digital Hardware Reset
MFRC522 RFID SDA / SS (Slave Select) GPIO 5 SPI Master/Slave Select
MFRC522 RFID SCK (Serial Clock) GPIO 18 SPI Shared Clock Bus
MFRC522 RFID MOSI GPIO 23 SPI Main Out Slave In
MFRC522 RFID MISO GPIO 19 SPI Main In Slave Out
SSD1306 OLED Screen SDA / SCL Pins GPIO 21 / GPIO 22 I2C Communication Bus

Blynk Platform Integration Credentials

To successfully route data frames out to your cloud service configuration, make sure the unique identification tokens mapped at the beginning of your code match your device template definitions exactly:

#define BLYNK_TEMPLATE_ID "TMPL6U8iA5sE7"
#define BLYNK_TEMPLATE_NAME "Bank Security Lock"
#define BLYNK_AUTH_TOKEN "IDYaAiRF-pJzzegB5QcV1NGQPq1ypC_M"

Arduino Code Configuration

Here is the full source firmware configured for cloud networks. It runs on top of the BlynkSimpleEsp32, MFRC522, and Adafruit_SSD1306 frameworks to process wireless pipelines, motion interrupts, and card scanning events simultaneously:

Bank_Security_Lock.ino
#define BLYNK_TEMPLATE_ID "TMPL6U8iA5sE7"
#define BLYNK_TEMPLATE_NAME "Bank Security Lock"
#define BLYNK_AUTH_TOKEN "IDYaAiRF-pJzzegB5QcV1NGQPq1ypC_M"

#include <SPI.h>
#include <MFRC522.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>

// --- Pin Definitions ---
#define PIR_PIN 32
#define RELAY_PIN 33
#define GREEN_LED 25
#define RED_LED 26
#define BUZZER_PIN 14
#define RST_PIN 4
#define SS_PIN 5

// --- OLED Display Settings ---
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);

// --- RFID Instance ---
MFRC522 mfrc522(SS_PIN, RST_PIN);

// --- WiFi & Blynk Setup ---
char auth[] = BLYNK_AUTH_TOKEN;
char ssid[] = "Wokwi-GUEST"; // Default for Wokwi simulation framework
char pass[] = "";

void setup() {
  Serial.begin(115200);

  // Pin Modes
  pinMode(PIR_PIN, INPUT);
  pinMode(RELAY_PIN, OUTPUT);
  pinMode(GREEN_LED, OUTPUT);
  pinMode(RED_LED, OUTPUT);
  pinMode(BUZZER_PIN, OUTPUT);

  // Initialize Hardware
  SPI.begin();
  mfrc522.PCD_Init();
  
  if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
    Serial.println(F("SSD1306 allocation failed"));
    for(;;);
  }
  
  display.clearDisplay();
  display.setTextSize(1);
  display.setTextColor(WHITE);
  display.setCursor(0, 10);
  display.println("SYSTEM BOOTING...");
  display.display();

  Blynk.begin(auth, ssid, pass);
  
  display.clearDisplay();
  display.setCursor(0, 10);
  display.println("SECURE VAULT");
  display.println("SYSTEM READY");
  display.display();
}

// --- Blynk Controls ---
// V1: Manual Relay Control (Button Widget)
BLYNK_WRITE(V1) {
  int value = param.asInt();
  digitalWrite(RELAY_PIN, value);
}

// V2: Manual Buzzer Control (Button Widget)
BLYNK_WRITE(V2) {
  int value = param.asInt();
  digitalWrite(BUZZER_PIN, value);
}

void loop() {
  Blynk.run();

  // 1. PIR Motion Logic
  int motionDetected = digitalRead(PIR_PIN);
  if (motionDetected == HIGH) {
    digitalWrite(RED_LED, HIGH);
    digitalWrite(BUZZER_PIN, HIGH);
    updateDisplay("WARNING!", "MOTION DETECTED");
  } else {
    digitalWrite(RED_LED, LOW);
    digitalWrite(BUZZER_PIN, LOW); 
  }

  // 2. RFID Logic
  if (mfrc522.PICC_IsNewCardPresent() && mfrc522.PICC_ReadCardSerial()) {
    digitalWrite(RELAY_PIN, HIGH);
    digitalWrite(GREEN_LED, HIGH);
    updateDisplay("ACCESS GRANTED", "LOCK OPENED");
    
    delay(3000); // Keep open for 3 seconds
    
    digitalWrite(RELAY_PIN, LOW);
    digitalWrite(GREEN_LED, LOW);
    updateDisplay("SECURE VAULT", "SYSTEM READY");
    
    mfrc522.PICC_HaltA(); // Stop reading same card
  }
}

// Helper to update OLED quickly
void updateDisplay(String line1, String line2) {
  display.clearDisplay();
  display.setTextSize(1);
  display.setCursor(0, 10);
  display.println(line1);
  display.setCursor(0, 30);
  display.println(line2);
  display.display();
}

System Testing Checklist

  • Network Handshake: Upon booting, the terminal pauses to negotiate a connection with your local gateway router. Once authenticated with the cloud instance, the OLED status displays "SECURE VAULT SYSTEM READY".
  • Motion Telemetry Evaluation: Walk within range of the PIR sensor. The peripheral will trigger the emergency alarm circuit immediately, executing a warning message across the OLED screen.
  • Remote Widget Override: Open your Blynk mobile application dashboard. Pressing the mapped V1 digital switcher button should actuate the lock relay directly, confirming cloud connectivity.
🌐

IoT Bank Lock Simulation

Cloud Enabled

Test the ESP32-S3 integration and RFID authentication logic in this virtual environment. This simulation includes the OLED feedback system and real-time triggers for the Blynk IoT dashboard.

📱

Live IoT Cloud Dashboard

Powered by Blynk.Cloud

Access the remote management interface for the Bank Security System. From this dashboard, you can monitor live motion alerts, view entry logs, and manually override the vault lock from anywhere in the world.

🎥 IoT System: Operation & Logic

🎥 IoT System: Hardware Integration

Post a Comment

0 Comments