Introduction: Unlock PC With RFID and Arduino Uno
This is my first Instructable. So in this project i am going to making unlocking your PC with RFID & Arduino Uno which most of the members have after doing this again you have to make few changes in order for to work like a normal arduino board again. So Lets Get Started :-
Step 1: Connecting RFID Scanner to Arduino UNO
The RFID Scanner has 8 Pins and we need 7 Pins from that
Arduino ----------------> RFID Scanner
D9 -----------------> Reset
D10 ------------------> SDA
D11 -----------------> MOSI
D12 -----------------> MISO
D13 -----------------> SCK
GND ----------------> GND
3.3V ------------------> 3.3V
Dont Change D11, D12, D13,
You can Change D9, D10 which are SDA And Reset but need to change in the code also the pins
Step 2: Changing Code and Uploading
First Add MFRC522 Library to Arduino IDE
MFRC522 LIbrary For Arduino IDE
Download the library and Extract it into libraries folder in Arduino Sketch Folder
Now Changing the Code
First go into the code and the UID Number to your UID no you want to gain access as in picture
the line highlighted in picture is the one you have to change in order for your card to work if you want to add more give space a comma again space and another UID of Card
Eg:-
content.substring(1) == "Card 1 " , "Card 2"
Changing the Keystrokes
First Go in the code to
delay(50);
buf[0] = 0;
buf[2] = 0x13; // Change this number 13 to the one in the USBKeyScan.PDF file the key you want to press when card scanned
Serial.write(buf, 8);
releaseKey();
if you want to press more keys after one another
copy the code and paste it below the before one in if statement
and then change the number to key you want to press
now upload the code into Arduino uno By selecting correct board and correct COM Port
Step 3: Upgrading the Firmware of Atmega16U2 on Board
Download and Install the Software Atmel Flip 3.4.7 from Link Below
Firmware Files first place a jumper on reset and ground and remove it like in the picture
Open Atmel Flip and select the firmware file Arduino-Keyboard-0.3.hex from File Tab -> Load Hex File
And
Select Run
Remove Usb And Plug it in Again
Step 4: Done
Now Scan the card you have programmed and test it
if you want to see mine which i made check below the video
sorry for video clarity
if you want to use it like normal arduino you have to run the firmware file called arduino-usbserial-uno.hex
and done
hope you enjoyed this project and if you have any questions dont forget comment down
and here is my youtube Channel link dont forget to subscribe in youtube

Participated in the
Microcontroller Contest
12 Comments
4 years ago
hi man , can it work on windows 10 ?!
Reply 4 years ago
yes
but you have to configure your keystrokes from pdf and it can work with any pc as it is recognized as hid device
Reply 2 years ago
Hello Dear,
thanks for this project. I need your help for keytstrokes. I want to lock windows by press " win + L " how can ı press at the same time win lef gui and l ( win L buton + L ) please help
Question 2 years ago
Hello Dear,
thanks for this project. I need your help for keytstrokes. I want to lock windows by press " win + L " how can ı press at the same time win lef gui and l ( win L buton + L )
4 years ago
my others rfid card that I don't set in the arduino ide also can enter the password.. how can this happen?
Reply 3 years ago
sorry for late reply i guess you should check in the if statement of cards like the one in 1st pic of step 2
Question 4 years ago on Step 3
how to load hex file
Answer 3 years ago
sorry for late reply we can load hex file using the atmel flip software to the programmer chip and to load hex file onto the main mcu then use XLoader
Question 5 years ago
I followed your instructions but when I tried to scan my 2 cards to find there uids and I got this
Answer 5 years ago
change baudrate to 9600 and there should be no line in code with serial.print as the chip is no more usb2serial it is keyboard
5 years ago
Great first Instructable. Thanks for sharing.
Reply 5 years ago
No Problem for that i will make few more of my projects