Home > Other >Special Application Circuits > How to Unlock Your Windows Laptop Using an RFID Tag

How to Unlock Your Windows Laptop Using an RFID Tag

Source: InternetPublisher:兰博 Keywords: RFID WINDOWS Arduino Updated: 2024/12/24

Many of us know that computers were invented around 1871, but we didn’t password protect them until 1961. In the early 1900s, we used pins and alphanumeric characters as passwords for our computers, and today we have many types of authentication methods like passwords, pins, patterns, gestures, fingerprint recognition, facial recognition, and more. However, logging into my office computer is still a pain every time I come back to it after a short break.

So in this project we will learn how to unlock a Windows laptop using an RFID tag. The Arduino board and the RFID reader will always be connected to the computer and unlock the system, I just need to swap the RFID tag to the RFID reader. With this Arduino RFID windows login project I can unlock the system very quickly without having to enter any password, later on I plan to use my office ID card as an RFID tag, since my ID card already has an RFID tag I can program the Arduino to verify it. Sounds interesting, so let's get started......

Materials Needed:

Arduino UNO (any Arduino can be used)

RC522 RFID Reader

RFID Tags

Connection lines

USB cable

RC522 RFID module:

There are many types of RFID readers available in the market but in this project, we have used RC522 SPI based RFID module. This is cheap and easily available on online shopping sites. This is RFID has SPI, UART and I2C interfaces but by default, it comes with SPI interface. The MFRC522 RFID reader module is shown below.

poYBAGMDOr-ANFF2AAWd4M5S_xg205.png

In this project, the RC522 RFID module shown above is connected to an Arduino which itself is connected to a computer. When an RFID tag is placed near this reader, the Arduino reads the rfid tag ID number and sends it to the computer.

Circuit diagram:

Given below is the complete circuit diagram for interfacing RFID RC522 with Arduino.

pYYBAGMDOruASxJRAAKLym1mNpQ497.png

As you can see, the connections are very simple. Since the RFID module uses SPI communication, we have connected the MISO, MOSI, SCK and NSS pins to the SPI pins of the Arduino Uno board. The RFID module is powered by the 5V pin of the Arduino. The Arduino UNO itself will always be connected to the laptop, so we can power it through the laptop's USB port. The connection details are shown in the table below.

poYBAGMDOraAXMKbAAAO1vQvhaw471.png

poYBAGMDOrOAMIEzAAdzv79NzRE660.png

To set up the RFID unlocking system:

Once the circuit is built, connect the USB cable between the Arduino and the system (laptop or PC) as shown in the above figure. Now the user needs to find the com port of the Arduino. To find the com port, you can use the device manager or you can find it in the Arduino IDE as shown below. My COM port number here is 1; yours may be different, please note this COM port number so that you can use it later.

pYYBAGMDOq-AI75bAAVXHtqlmVw519.png

Now the user needs to upload the RC522 Arduino code to your Arduino module. The complete code is given at the bottom of this page; the explanation of the code will also be discussed later in this article. Open the serial monitor after the code is uploaded. Then place the RFID tag on the RFID reader and you will see 5 values ​​on the serial monitor. The user needs to copy it and close the serial monitor. My values ​​are shown in the serial monitor snapshot below.

poYBAGMDOquAfmrIAAD1E4P1xag045.png

After extracting the ZIP file, go into the folder named 32-bit or 64-bit folder (depending on your operating system) and open the notepad named RFIDcreden tials.txt. Paste the RFID values ​​and update the system username and password. If you are adding two cards, add the same credentials in the second line as shown below.

pYYBAGMDOqeAHHPbAAHY9-nC7pA491.png

Then save and close this file. Now come back to open the RFIDCredSettings notepad and update the Arduino port in it, then save and close. My COM port number is 1 again, update it with your COM port number. Leave the rest as default as shown below.

pYYBAGMDOqOAWufaAAE7H3PDWEs419.png

Now copy all four items and paste them to C:WindowsSystem32. If it asks for any permission, just give or click yes. Now run the registration file to register the changes.

poYBAGMDOqCAHTHnAAEP60PSFZo694.png

When you run the registration file, you may see the following dialog box.

pYYBAGMDOpyANHeiAAHBua7jYvA478.png

Press Yes and then OK. The system is now locked and the user will see another user option available to the current user.

pYYBAGMDOpiAU0J5AAVdjgTagoo442.png

Now users can use RFID card to unlock the system. It means, now we don't need to enter the password, just put the RFID tag on the RFID reader and the window will be unlocked immediately.

RFID Arduino Code:

The coding part of this project is straightforward; explanations for the same are given. First, we need to include the header file and define the pins for the RFID RST_ PIN and SS_PIN. If you don't already have the mfrc522 library installed, you can download it from the following link and add it.

#include

#include

Then in void setup, we have initialized the serial and SPI communication and the RFID reader

void setup()
{
SerialNumber.Start(9600);
while (!Serial);
SPI.begin();
mfrc522.PCD_Init();
f

Now in the loop function we are waiting for the card.

void loop()
{
if (!mfrc522.PICC_IsNewCardPresent())
   return;
if (!mfrc522.PICC_Re

If the card finds an RFID tag data with the send_tag_val call, the data will be transferred to the system using serial print. This serial print value will be compared to the file we placed earlier, and if it matches, the windows will unlock itself.

void send_tag_val (byte *buffer, byte buffersize)
{
   SerialNumber.print("ID");
   for (byte i = 0; i < buffer size; i++)
{
   serial.print(buffer[i],DEC);
   SerialNumber.print("");
}
   serial.printIn(0, DEC);
    serial.print('>');
}

#include

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号