PC Access Control with RFID and Arduino

In modern workplaces and shared computing environments, maintaining data privacy and hardware-level access control is essential. At Arduino Expert, we have developed an innovative security project — “PC Access Control with RFID using Arduino” — that ensures only authorized users can operate a computer.

This system is built using an Arduino UNO/Nano an RFID module, and a USB hub control circuit, which enables or disables the keyboard and mouse connected to the PC. The concept is simple yet powerful: unless a valid RFID card is scanned, the system cuts off the USB hub’s 5V power supply, locking the computer peripherals and preventing unauthorized usage.

This project beautifully combines Arduino programming, hardware interfacing, and product design and development to demonstrate how embedded systems can enhance real-world security and automation applications.

PC access control with RFID and Arduino

Project Overview: PC Access Control with RFID

The PC Access Control with RFID project uses an RC522 RFID reader to identify authorized users. The Arduino UNO/Nano acts as the main controller, processing the RFID tag data and controlling the BC547 NPN transistor, which switches the 5V line of a USB hub.

  • When a registered RFID card is detected, the Arduino enables the USB hub, allowing the keyboard and mouse to communicate with the computer.
  • When the same card is scanned again, or when a push button is pressed, the Arduino disables the USB hub, cutting off the 5V power line and instantly locking the PC.

This ensures that even if the computer remains powered ON, no input devices will function unless access is granted again through RFID authentication.

This unique approach provides a hardware-level security layer, unlike typical password-based systems, making it suitable for personal computers, offices, shared labs, or sensitive data environments.

Components Used in PC Access Control Arduino Project

  1. Arduino UNO/Nano – Acts as the main microcontroller, handling RFID input and output control.
  2. RC522 RFID Reader – Used to detect and identify authorized RFID cards or tags.
  3. BC547 NPN Transistor – Functions as a digital switch that controls the USB hub’s 5V supply line.
  4. USB Hub – Connects peripherals like a keyboard and mouse to the PC.
  5. Push Button – Provides manual access lock/unlock functionality.
  6. Jumper Wires & Breadboard – Used for circuit connections and prototyping.

Working Principle of PC Access Control Arduino Project

1. RFID Authentication

  • The RFID module continuously scans for nearby cards or tags.
  • When a card is detected, the Arduino reads its unique ID (UID).
  • If the UID matches one of the authorized IDs stored in the Arduino’s code, access is granted; otherwise, the system remains locked.

2. USB Hub Switching

  • Upon valid authentication, Arduino sends a HIGH signal to the BC547 transistor, powering the 5V line of the USB hub.
  • The keyboard and mouse become active, allowing normal PC operation.
  • The access LED (optional) can indicate system status (ON = Access Granted, OFF = Locked).

3. Access Lock/Unlock

  • When the authorized RFID card is swiped again, the Arduino toggles the state, switching OFF the transistor and cutting USB hub power.
  • Alternatively, the manual push button can trigger a lock command for instant deactivation.
  • This ensures the system can be manually secured even without the RFID card present.

Circuit Diagram of PC Access Control Project with RFID and Arduino

The circuit design is straightforward and easy to replicate:

  • The RFID reader is connected to the Arduino UNO/Nano via SPI communication pins (SDA, SCK, MOSI, MISO, and RST).
  • The BC547 transistor controls the 5V line going to the USB hub. The transistor acts as a low-side switch, meaning it can connect or disconnect the USB hub’s ground or power line depending on the digital signal from Arduino.
  • The push button is connected to a digital input pin and configured with a pull-down resistor, allowing manual control of access.
  • The Arduino’s digital pin sends HIGH or LOW signals to the BC547 base through a 220Ω resistor, toggling the hub’s power.

When the Arduino outputs HIGH, the transistor conducts, powering ON the USB hub.
When LOW, the transistor switches off, cutting power to the hub — effectively disabling the connected devices.

Circuit Diagram of PC Access Control Project with RFID and Arduino

Arduino Code for PC Access Control RFID Project

#include <SPI.h>
#include <MFRC522.h>
#include <Wire.h> 
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
 
#define SS_PIN 10
#define RST_PIN 9
MFRC522 mfrc522(SS_PIN, RST_PIN);  
int Relay=2,Btn=3,flag=true;; 
int State=LOW;
String IDs[25];
bool Else=true;
bool Match=false;
int Green_led=4;
int Red_led=5;



 void setup() 
{ Serial.begin(9600);   
  lcd.begin(); lcd.backlight();
  lcd.clear();
  
  SPI.begin();      
  mfrc522.PCD_Init();  
  Serial.println("Approximate your card to the reader...");
  Serial.println();     
  pinMode(Relay,OUTPUT);
  pinMode(Btn,INPUT_PULLUP);
  pinMode(Green_led,OUTPUT);
  pinMode(Red_led,OUTPUT);

  
IDs[0]="72 95 4B 24";
IDs[1]="54 yt 45 24";
IDs[2]="54 yt 45 24";
IDs[3]="54 yt 45 24";
IDs[4]="54 yt 45 24";
IDs[5]="54 yt 45 24";
IDs[6]="54 yt 45 24";
IDs[7]="54 yt 45 24";
IDs[8]="54 yt 45 24";
IDs[9]="54 yt 45 24";
IDs[10]="54 yt 45 24";
IDs[11]="54 yt 45 24";
IDs[12]="54 yt 45 24";
IDs[13]="54 yt 45 24";
IDs[14]="54 yt 45 24";
IDs[15]="54 yt 45 24";
IDs[16]="54 yt 45 24";
IDs[17]="54 yt 45 24";
IDs[18]="54 yt 45 24";
IDs[19]="54 yt 45 24";
IDs[20]="54 yt 45 24";
IDs[21]="54 yt 45 24";
IDs[22]="54 yt 45 24";
IDs[23]="54 yt 45 24";
IDs[24]="54 yt 45 24";
  }

Working Video of PC Access Control Project

Applications of PC Access Control Project

  • Office Security Systems – Allow only staff with valid RFID cards to use specific computers.
  • University or Lab Computers – Limit PC access to registered students or researchers.
  • Data Centers & Servers – Prevent unauthorized system use.
  • Public Terminals or Kiosks – Control when and who can use public PCs.
  • Personal Home PC Security – Add an additional hardware-based protection layer.

Advantages of PC Access Control Project

  • Provides hardware-level security rather than software-based passwords.
  • Easy to install and customize for any USB device.
  • Inexpensive and reliable design using common electronic components.
  • Offers both RFID and manual button control for flexibility.
  • Demonstrates Arduino programming and embedded hardware design principles.
  • Can be expanded into an advanced IoT-based access system with cloud monitoring.

Product Design and Development Perspective

From a product design and development standpoint, this project showcases the integration of embedded control and user authentication in a compact and efficient manner. The system can easily be turned into a commercial access control product for IT labs, co-working spaces, or educational institutions.

By combining RFID technology, microcontroller logic, and USB power management, the project demonstrates a scalable concept that can be extended to:

  • Controlling USB drives, printers, or external hard disks,
  • Enabling IoT-enabled remote access logs, or
  • Integrating biometric or NFC modules for multi-layer security.

At Arduino Expert, we specialize in creating such custom Arduino-based security systems that blend electronics design, embedded programming, and practical innovation — turning ideas into functional products.


Conclusion

The PC Access Control with RFID using Arduino project is a practical and cost-effective solution for managing computer access at the hardware level. It provides a secure and easy-to-use system that ensures only authorized users can operate the PC peripherals.

Through this project, Arduino Expert demonstrates how Arduino programming, hardware control, and product design can work together to enhance data security and system privacy. This concept not only promotes secure access but also lays the groundwork for future IoT-enabled access management systems.

Need Help in this Project?

If you need thisPC Access Control with RFID using Arduino with or without Modifications or Customization then you can contact us through WhatsApp. 

Learn More about the services we offer.

Leave a Reply

Your email address will not be published. Required fields are marked *

Facebook
YouTube