Here is a video of it in action:
Step 1: Supplies
1 ID-12 RFID Reader (and breakout board)
1 RFID Tag
Step 2: Assemble
RFID reader pin 1 to ground.
RFID reader pin 2 to 5v.
RFID reader pin 11 to 5v.
RFID reader pin 10 to LED.
RFID reader pin 9 to Arduino pin 6.
RFID reader pin 7 to ground.
Step 3: Arduino Code
SoftwareSerial RFID = SoftwareSerial(6, 7); //RX is 6, TX is 7
String key; //The key that was scanned
void setup ()
RFID.begin(9600); //Begins connection with the reader
Serial.println("RFID is all set.");
char read; //The most recent character read
void loop ()
while(RFID.available() > 0)
read = RFID.read();
key += read;
if(key.indexOf("4F0088AE355C") >= 0) Serial.print("unlock"); //Should be changed to your RFID key
Step 4: Processing Code
boolean locked = false;
println(Serial.list()); //Prints available ports
port = new Serial(this, Serial.list(), 9600); //Chooses the first available port
robot = new Robot(); //Creates robot
catch (AWTException e)
if (locked == true) robot.mouseMove(0, 0); //If locked, moves mouse to top left corner
while (port.available() > 0)
String input = port.readString();
locked = false; //If anything is recieved it'll unlock. I wasn't trying to make it all that secure
void keyPressed ()
if (key == 'l')
locked = true; //Locks it
if (key == 'u')
//locked = false; //Uncomment this if you're a wimp (or if you're testing)
if (key == ESC)
key = 0; //Disables escape as quit
Step 5: Instructions for Operation
1. Plug in assembled reader.
2. Open up Arduino IDE, and upload supplied code.
3. Open up Processing IDE, and run supplied code.
4. Click into processing script and press 'l' to lock.
5. Hold card over reader to unlock.
It's that simple!
Keep in mind that you should use some precautions when testing the first few times. When building this, I got locked out of my computer many, many times. If you have any errors (like RXTX version mismatch), post them in the comments and I will be able to give you the solution.
Have fun and happy locking! (And unlocking hopefully)