Door lock Using RF-ID Tags

we have all seen them on the doors of big company buildings, letting those that have the mystical keyfob or ID-Card and is some cases injected directly under the skin (too extreme for me).

I have put together a simple door lock that you can put on your bedroom door to keep people out, quite cheap too!

as it stands the door will unlock with only the correct keyfob's and will only lock when the inside button is pressed. the button will give you abouyt 5 seconds to get out and close the door before locking it completely. also there is no way from opening it from the inside except from resetting the board as by default the servo resets in the open position (happy coincidence).

the code for the RF-ID reader and servo controls are straight from the other examples.

Source Code Zip
#include "mbed.h"
#include "RFID.h"
#include "Servo.h"

Servo myServo (21);
DigitalOut myled(LED1);
DigitalOut myled2(LED2);
RFID rfid (13,14);
DigitalIn door (20);
DigitalOut buz (19);
void warning(void);
void open(void);
void close(void);
void buzz(float);
int i;
int main() {
  while (1){
    int id = rfid.read();
    if (id == /*your tag id here*/ | /*and here*/ )
    {
        myled = 1;
        buzz(0.1);
    open();
    wait(3);
        while (door != 1)
            {
        wait(0.00001);
        }
        warning();
        myled = 0;
        close();
    }
    else
        {
            myled2 = 1;
            wait(1);
            myled2 = 0;
        }
    }
}
void warning(void)
{
    buzz(0.1);
    wait(1);
    buzz(0.1);
    wait(1);
    buzz(0.1);
    wait(1);
    buzz(0.5);
}
void open(void)
{
    for (i=0 ; i<100 ; i++){
      myServo = i/100.0;
     }
}
void close(void)
{
      for (i=100 ; i>0 ; i--){
      myServo = i/100.0;
      }
}
void buzz(float l)
{
buz = 1;
wait(l);
buz = 0;
}
/lock/examples/rfid_lock.zip

I will be adding pictures as soon as I take them q -_- p

List of Parts
Mbed
Servo
RF-ID (ID-12) Reader
Sounder
Battry Pack
Button
Switch