RFID Logic-Based Security Vault

by dakshmahajan in Circuits > Arduino

206 Views, 1 Favorites, 0 Comments

RFID Logic-Based Security Vault

IMG_2080 (1).jpg

Here is a Link to a video which shows the final project working: https://youtu.be/f3Nk2F5YSOE?feature=shared

This project is a multi-layer security system that combines digital logic circuits, RFID authentication, analog electronics, and Arduino programming.

Traditional RFID locks only require a valid RFID card to gain access. In this project, an additional hardware security layer was added using a Sum of Products (SOP) logic circuit. Before RFID authentication can occur, the user must first enter the correct switch combination using three slide switches. The outputs of the SOP circuit are connected to the Arduino and act as a hardware authentication mechanism.

If the SOP conditions are met, the Arduino enables the RFID reader. The user can then scan an RFID card. If the card's UID matches the authorized UID stored in the program, access is granted and a green LED turns on. If the card is not recognized, a red LED illuminates and a 555 timer circuit activates a buzzer alarm.

This project combines concepts from multiple TEJ4M units including:

  1. Digital Logic Gates
  2. SOP Expressions
  3. RFID Technology
  4. Arduino Programming
  5. Analog Electronics
  6. 555 Timer Circuits
  7. LED Output Systems

Before building the circuit, I first planned how the security system would work. The goal was not to make a basic RFID lock, but to create a two-step authentication system. This means the RFID card alone is not enough to unlock the system. The user must first satisfy a hardware logic condition using the slide switches.

  1. The system was divided into smaller sections so it would be easier to build and troubleshoot. The first section is the SOP logic circuit, which uses three slide switches and logic gates. The second section is the Arduino and RFID reader, which handles the card scanning. The third section is the output system, which includes the green LED, red LED, and buzzer alarm. Dividing the project this way made it easier to test each part separately before combining everything together.

Supplies

Arduino Uno R3 (1x)

The Arduino Uno serves as the central controller of the project. It processes the SOP logic outputs, communicates with the RFID reader, and controls the LEDs and alarm system.

Purchase Link:

Arduino Uno Rev3 Official Store

MFRC522 RFID Reader Module (1x)

The RFID reader is used to scan RFID cards and transmit their unique identification numbers (UIDs) to the Arduino.

Purchase Link:

MFRC522 RFID Reader Module

RFID Card / RFID Key Fob (1x)

The RFID card acts as the authentication credential used to unlock the security vault.

Purchase Link:

RFID Cards and Tags Kit

Slide Switches (3x)

Three slide switches are used as the inputs for the SOP logic circuit. Different switch combinations produce different logic outputs.

Purchase Link:

Mini Slide Switch

Logic Gate ICs (AND/OR/NOT Gates)

Logic gates implement the SOP expression that determines when RFID authentication is enabled.

Purchase Links:

74HC08 Quad AND Gate IC

74HC32 Quad OR Gate IC

Green LED (1x)

Used to indicate successful authentication and access granted.

Purchase Link:

5mm Green LED Example

Red LED (1x)

Used to indicate an invalid switch combination or unauthorized RFID card.

Purchase Link:

5mm Red LED Example

220 Ω Resistors (2x)

Current-limiting resistors used to protect the LEDs.

Purchase Link:

220 Ω Resistor Pack Example

10 µF Electrolytic Capacitor (1x)

Used in the 555 timer circuit to create the timing interval for the alarm pulses.

Purchase Link:

10 µF Capacitor Example

NE555 Timer IC (1x)

Generates the pulsing alarm signal for the buzzer when unauthorized access is detected.

Purchase Link:

NE555 Timer IC

Piezo Buzzer (1x)

Provides an audible alarm when access is denied.

Purchase Link:

Piezo Buzzer Example

Breadboard (1x)

Used to assemble and test the entire circuit without soldering.

Purchase Link:

Solderless Breadboard Example

Male-to-Male Jumper Wires (~20x)

Used to make electrical connections between components.

Purchase Link:

Jumper Wire Kit Example


Software Used

Arduino IDE

The Arduino IDE was used to write, compile, and upload the code to the Arduino Uno.

Reference:

https://www.arduino.cc/en/software

SPI Library

The SPI library was used to facilitate communication between the Arduino and RFID reader.

Reference:

https://docs.arduino.cc/language-reference/en/functions/communication/spi/

MFRC522 Library

The MFRC522 library was used to simplify communication with the RFID reader and obtain card UID values.

Reference:

https://github.com/miguelbalboa/rfid

Design the SOP Logic Circuit

Screenshot 2025-04-11 214201.png
Screenshot 2026-06-18 132018.png

The SOP logic circuit is the first layer of security. SOP stands for Sum of Products. This type of logic circuit uses combinations of AND, OR, and sometimes NOT gates to produce an output based on the switch inputs.

In this project, three slide switches are used as inputs. These switches represent binary values, where OFF is 0 and ON is 1. The logic gate circuit processes these inputs and produces output signals. The Arduino does not directly check the individual switch positions. Instead, the Arduino only checks the final SOP outputs on pins 6 and 7.

This is important because it shows that part of the decision-making is happening in hardware, not just in the Arduino code. If either SOP output is LOW, the RFID reader is disabled and the red LED stays on. If both SOP outputs are HIGH, the Arduino allows the RFID card to be scanned.

Build and Test the SOP Circuit

IMG_2075 (1).jpg


After designing the SOP expression, I built the logic circuit on the breadboard using slide switches and logic gate ICs. The switches were connected as the input values, and the logic gates were wired to match the SOP expression.

Before connecting the SOP outputs to the Arduino, the circuit should be tested separately. This is important because if the logic circuit is incorrect, the Arduino will receive the wrong HIGH or LOW signals. Testing the SOP circuit first makes troubleshooting easier because it confirms that the hardware logic works before the RFID system is added.

A multimeter or LED tester can be used to check whether the outputs become HIGH for the correct switch combination. Once the correct outputs are confirmed, the two SOP outputs can be connected to Arduino pins 6 and 7.

Connect the RFID Reader

IMG_2076.jpg

The RFID reader is the sensor used in this project. It reads the UID, or unique identification number, stored inside the RFID card. Every card has a different UID, so the Arduino can compare the scanned card with the authorized UID stored in the code.

The RFID module communicates with the Arduino using SPI communication. SPI uses multiple pins to send and receive data quickly between the Arduino and the RFID reader. The MFRC522 RFID reader must be powered using 3.3V, not 5V. Connecting it to 5V can damage the module.

The wiring used was:

  1. NSS → D10
  2. RST → D9
  3. MOSI → D11
  4. MISO → D12
  5. SCK → D13
  6. VCC → 3.3V
  7. GND → GND
  8. IRQ → Not connected

After wiring the RFID reader, I tested it using a simple RFID scanning program. This allowed me to confirm that the reader was working before adding the rest of the project code.

Connect the SOP Outputs to the Arduino

Once the SOP circuit was tested, the two final outputs were connected to the Arduino. Output 1 was connected to pin 6, and Output 2 was connected to pin 7.

The Arduino code checks these two pins using digitalRead(). Arduino digital pins can detect whether an input signal is HIGH or LOW. In this project, both pins must be HIGH for the RFID system to activate.

This makes the SOP circuit act like a hardware lock. If the switch combination is wrong, the Arduino blocks RFID scanning completely. If the switch combination is correct, the RFID reader becomes active and the user can scan a card.

Connect the LED Indicators

Two LEDs were used to give visual feedback to the user. The green LED shows that access has been granted. The red LED shows that the vault is locked or access has been denied.

The green LED was connected to Arduino pin 3 through a 220 Ω resistor. The red LED was connected to Arduino pin 4 through a 220 Ω resistor. Resistors are needed because LEDs cannot safely be connected directly to power. Without a resistor, too much current can flow through the LED and damage it.

LED polarity is also important. The longer leg of the LED is the positive side, and the shorter leg is the negative side. If the LED is connected backwards, it will not turn on.

Build the 555 Timer Alarm Circuit

IMG_2079.jpg

The buzzer alarm uses a 555 timer circuit. The 555 timer is an active component that can create pulses or timing signals. In this project, it is used to help create an alarm effect when access is denied.

The Arduino controls the alarm by powering the 555 timer through analog pin A5. When A5 is set HIGH in the code, the 555 timer receives power and the buzzer activates. When A5 is set LOW, the timer turns off and the buzzer stops.

The capacitor in the 555 timer circuit charges and discharges, which helps create the timing effect. This connects the project to analog electronics because the alarm is not only controlled by software; it also depends on the physical resistor-capacitor timing circuit.

Upload and Explain the Arduino Code

The Arduino code controls the full system. It first initializes the RFID reader and sets up all input and output pins. Pins 6 and 7 are set as inputs because they receive signals from the SOP logic circuit. Pins 3, 4, and A5 are set as outputs because they control the green LED, red LED, and alarm circuit.

The program constantly checks whether pins 6 and 7 are both HIGH. If either pin is LOW, the red LED stays on and the RFID reader is ignored. This means the vault remains locked.

If both pins are HIGH, the Arduino allows RFID scanning. When a card is scanned, the program compares the scanned UID to the authorized UID. A for loop is used to compare each part of the UID. This makes the code cleaner and avoids repeating the same comparison multiple times.

The code also uses custom functions such as cardMatches(), successBeep(), and failBeep(). These functions make the program more organized and easier to understand.

If attachment does not open here is a link with the code: https://docs.google.com/document/d/1fWCrlv9kqTfb4YIsPJJGra_BeVtxmAV9Thzss7Pn6CI/edit?usp=sharing

Downloads

Test the RFID Authentication

After uploading the code, I tested the RFID system. First, I made sure the SOP outputs were HIGH so that the RFID reader would be enabled. Then I scanned the authorized RFID card.

When the correct card was scanned, the Serial Monitor displayed the card UID and showed that access was granted. The green LED turned on, showing that the system accepted the card.

Then I tested an unauthorized card. Since the UID did not match the authorized card, the system denied access. The red LED turned on and the buzzer alarm activated.

Test the Complete System

IMG_2080 (1).jpg

The final step was testing the entire project as one complete system. This included the SOP circuit, RFID reader, LEDs, Arduino code, and 555 timer alarm.

The system was tested in different conditions. When the SOP outputs were not both HIGH, the red LED stayed on and the RFID reader did not work. When both SOP outputs were HIGH, the RFID reader became active. If the correct card was scanned, the green LED turned on. If the wrong card was scanned, the red LED and buzzer activated.

This confirmed that the two security layers worked together correctly. The SOP circuit handled the hardware logic, and the Arduino handled the RFID authentication and output control.


Here is a Link to a video which shows the final project working: https://youtu.be/f3Nk2F5YSOE?feature=shared

Common Mistakes and Troubleshooting

One common mistake is powering the RFID reader with 5V instead of 3.3V. The MFRC522 RFID reader should use 3.3V, or it may stop working.

Another common issue is not connecting all grounds together. The Arduino, SOP circuit, RFID reader, and 555 timer circuit must share a common ground so they all have the same voltage reference.

LEDs may also fail to turn on if they are reversed or if the resistor is placed incorrectly. The longer leg of the LED should connect toward the Arduino output, and the shorter leg should connect toward ground.

If the buzzer does not work, the 555 timer wiring should be checked carefully. Pin 8 must receive power from A5, and pin 1 must connect to ground. The capacitor polarity should also be checked.

If the RFID reader does not scan cards, the wiring should be checked again, especially NSS, MOSI, MISO, SCK, RST, 3.3V, and GND.

Final Result

IMG_2080 (1).jpg

The final project successfully worked as a multi-layer RFID security vault. The SOP logic circuit acted as the first security layer, and the RFID reader acted as the second security layer.

The project used multiple inputs, outputs, sensors, active components, passive components, and software. It combined digital electronics, analog electronics, and Arduino programming into one complete system.

The final result was a useful and original security device that demonstrates both hardware and software working together.