กลับไปหน้ารวมไฟล์
rfid-two-card-door-lock-and-bluetooth-control-8d3ad7-en.md

Multi-Factor Access: RFID and Bluetooth Synergy

Traditional locks are susceptible to picking, but the RFID Two-Card Door Lock introduces a digital fail-safe. This project utilizes the Arduino Mega 2560 to manage a dual-input security system: a physical MFRC522 RFID Reader for on-site access and an HC-05 Bluetooth Module for remote smartphone control. By requiring specific digital "Keys," this system ensures that only authorized users can actuate the heavy-duty door mechanism.

Two-Card Authentication Logic

The "Two-Card" feature adds an extra layer of security similar to a bank vault:

  • Sequential Scans: The Arduino can be programmed to require two different cards to be scanned within a specific time window (e.g., 5 seconds). This "Dual-Key" setup ensures that a single lost card isn't enough to compromise the premises.
  • Whitelist Management: The project utilizes the MFRC522.h library to read the unique UID of each RFID tag. These UIDs are compared against a hard-coded or EEPROM-stored whitelist. If the UID matches, the Arduino grants a "Partial Success" state until the second card is verified.
  • Visual Indication: The system typically uses LEDs (Red/Green) or a buzzer to provide feedback on each scan, guiding the user through the two-step process.

Mechanical Drive: L298N and DC Motors

Unlike a simple solenoid, this project uses a high-torque DC Motor driven by an L298N Dual H-Bridge:

  1. Reversible Direction: The L298N allows the Arduino to spin the motor forward to "Unlock" and reverse to "Lock" the door.
  2. Current Isolation: Because motors generate electrical "Noise" and back-EMF, the L298N isolates the sensitive Arduino Mega from the high-current demands of the lock motor.
  3. Variable Torque: Using PWM (Pulse Width Modulation), the developer can adjust the speed of the motor to ensure the lock closes softly but firmly.

Wireless Override: The Bluetooth Bridge

For convenience, the HC-05 Bluetooth Module serves as a digital override. Using a standard "Serial Bluetooth Terminal" app on a smartphone, the user can send a secret string (e.g., "OPEN_SESAME"). The Arduino parses this incoming serial data and triggers the L298N driver instantly, allowing for "Keyless Entry" without needing a physical RFID card.

Wiring for the Mega 2560

The Arduino Mega is chosen for its abundant SPI and Serial pins:

  • SPI Pins: The MFRC522 requires pins 50 (MISO), 51 (MOSI), 52 (SCK), and 53 (SDA/SS).
  • Serial1: The HC-05 is connected to the Mega's second hardware serial port (TX1/RX1), allowing for reliable wireless communication without interfering with the main USB debugging line.

schmatics

* -----------------------------------------------------------------------------------------

* MFRC522 Arduino Arduino Arduino Arduino Arduino

* Reader/PCD Uno/101 Mega Nano v3 Leonardo/Micro Pro Micro

* Signal Pin Pin Pin Pin Pin Pin

* -----------------------------------------------------------------------------------------

* RST/Reset RST 9 5 D9 RESET/ICSP-5 RST

* SPI SS SDA(SS) 10 53 D10 10 10

* SPI MOSI MOSI 11 / ICSP-4 51 D11 ICSP-4 16

* SPI MISO MISO 12 / ICSP-1 50 D12 ICSP-1 14

* SPI SCK SCK 13 / ICSP-3 52 D13 ICSP-3 15

*/

ข้อมูล Frontmatter ดั้งเดิม

title: "RFID Two-Card Door Lock and Bluetooth Control"
description: "RFID two-card door lock and Bluetooth control."
author: "Amirrezaaaaaa"
category: ""
tags:
  - "communication"
  - "remote control"
  - "security"
  - "rfid"
  - "bluetooth"
views: 3168
likes: 0
price: 699
difficulty: "Easy"
components:
  - "1x DC motor (generic)"
  - "1x HC-05 Bluetooth Module"
  - "1x RFID reader MFRC522"
  - "1x Arduino Mega 2560"
  - "1x Dual H-Bridge motor drivers L298"
  - "1x Jumper wires (generic)"
tools: []
apps:
  - "1x Arduino IDE"
downloadableFiles:
  - "https://projects.arduinocontent.cc/5531965f-750a-4ea8-9cec-2545496eba24.ino"
documentationLinks: []
passwordHash: "43cd2dd60662ca750f8911551f3d5427521620640155a36af7399bcebb094448"
encryptedPayload: "U2FsdGVkX18tgguQh47XZXvw06Mm6itpH5CNmjMeWyMmzCXlFm5B4EMJfjvkzWlBnFMzqWTXKC8hCf0zHyW1wDxImIdPc1Sd+UP7Dt+8Zzg="
seoDescription: "Secure door lock system using RFID two-card authentication and Bluetooth control. Integrated with Arduino for smart access."
videoLinks: []
heroImage: "https://cdn.jsdelivr.net/gh/bigboxthailand/arduino-assets@main/images/projects/rfid-two-card-door-lock-and-bluetooth-control-8d3ad7_cover.jpg"
lang: "en"